-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
116 additions
and
20 deletions.
There are no files selected for viewing
20 changes: 12 additions & 8 deletions
20
.github/workflows/release.yaml → .github/workflows/release-binary.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
name: Tagged Release CI | ||
name: Release docker | ||
|
||
on: | ||
push: | ||
|
@@ -9,36 +9,42 @@ on: | |
- "v*" | ||
|
||
jobs: | ||
|
||
build_and_push: | ||
docker-release: | ||
name: docker release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: AutoModality/action-clean@v1 | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Set up Docker Buildx | ||
|
||
- name: set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Docker Login | ||
|
||
- name: docker login | ||
uses: docker/[email protected] | ||
with: | ||
# registry: ${{ secrets.DOCKERHUB_ADDR }} | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASS }} | ||
- name: Prepare short tag | ||
|
||
- name: prepare short tag | ||
id: prepare_short_tag | ||
run: | | ||
SHORT_TAG=`git describe --abbrev=5 --dirty --tags --always` | ||
echo "::set-output name=image_short_tag::$SHORT_TAG" | ||
echo "::notice title=Build Image Short Tag::$SHORT_TAG" | ||
- name: Prepare tag | ||
- name: prepare tag | ||
id: prepare_tag | ||
run: | | ||
TIME_TAG=`TZ=Zero date +"%y%m%d%H%M%S"` | ||
COMMIT_TAG=`echo $GITHUB_SHA | cut -c 1-7` | ||
TAG="$TIME_TAG-$COMMIT_TAG" | ||
echo "::set-output name=image_tag::$TAG" | ||
echo "::notice title=Build Image Tag::$TAG" | ||
- name: Build and push | ||
- name: build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v2 | ||
appVersion: 1.1.8 | ||
description: helm chart for alertmanager webhook adapter | ||
name: alertmanager-webhook-adapter | ||
version: 1.0.1 | ||
type: application | ||
maintainers: | ||
- name: bougou |
21 changes: 21 additions & 0 deletions
21
deploy/charts/alertmanager-webhook-adapter/templates/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- define "awa.namespace" -}} | ||
{{- if .Values.namespaceOverride -}} | ||
{{- .Values.namespaceOverride -}} | ||
{{- else -}} | ||
{{- .Release.Namespace -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
|
||
{{- define "awa.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} |
35 changes: 35 additions & 0 deletions
35
deploy/charts/alertmanager-webhook-adapter/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "awa.fullname" . }} | ||
namespace: {{ include "awa.namespace" . }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: alertmanager-webhook-adapter | ||
template: | ||
metadata: | ||
labels: | ||
app: alertmanager-webhook-adapter | ||
spec: | ||
containers: | ||
- name: webhook | ||
image: {{ .Values.image.name }}:{{ .Values.image.tag }} | ||
command: | ||
- /alertmanager-webhook-adapter | ||
- --listen-address=:8090 | ||
- --signature={{ .Values.signature }} | ||
- --tmpl-lang={{ .Values.lang | default "en" }} | ||
env: | ||
- name: TZ | ||
value: {{ .Values.timezone }} | ||
resources: | ||
requests: | ||
memory: 50Mi | ||
cpu: 100m | ||
limits: | ||
memory: 250Mi | ||
cpu: 500m | ||
restartPolicy: Always |
14 changes: 14 additions & 0 deletions
14
deploy/charts/alertmanager-webhook-adapter/templates/service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "awa.fullname" . }} | ||
namespace: {{ include "awa.namespace" . }} | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8090 | ||
protocol: TCP | ||
selector: | ||
app: alertmanager-webhook-adapter | ||
sessionAffinity: None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
image: | ||
name: bougou/alertmanager-webhook-adapter | ||
tag: v1.1.8 | ||
signature: MyIDC | ||
lang: en | ||
timezone: Asia/Shanghai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters