From 2960dee90c4bd96b2e9cd95adcd4f0f0b8e03834 Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Thu, 19 May 2022 14:59:34 +0200 Subject: [PATCH 01/10] ci: remove --kubeconfig since $KUBECONFIG is used and move --namespace back to the rest of the flags --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 903c5f2..35e4bc5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,6 @@ deploy:prod: environment: name: prod script: - - helm --kubeconfig $KUBECONFIG upgrade --install --namespace wsj wsj-standup ./deploy/chart/wsj-standup --set image.tag=$IMAGE_TAG --set=app.WEBHOOK_URL $DISCORD_WEBHOOK_URL --set app.SENTRY_DSN=$SENTRY_DSN --set image.pullSecretBase64=$REGISTRY_PULL_SECRET_BASE64 + - helm upgrade --install wsj-standup ./deploy/chart/wsj-standup --namespace wsj --set image.tag=$IMAGE_TAG --set=app.WEBHOOK_URL $DISCORD_WEBHOOK_URL --set app.SENTRY_DSN=$SENTRY_DSN --set image.pullSecretBase64=$REGISTRY_PULL_SECRET_BASE64 rules: - if: '$CI_COMMIT_BRANCH == "main"' From a6d9db355300c12ab04d73442e1a6b760604c438 Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Thu, 19 May 2022 15:05:19 +0200 Subject: [PATCH 02/10] ci: add missing = --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 35e4bc5..93641b8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,6 @@ deploy:prod: environment: name: prod script: - - helm upgrade --install wsj-standup ./deploy/chart/wsj-standup --namespace wsj --set image.tag=$IMAGE_TAG --set=app.WEBHOOK_URL $DISCORD_WEBHOOK_URL --set app.SENTRY_DSN=$SENTRY_DSN --set image.pullSecretBase64=$REGISTRY_PULL_SECRET_BASE64 + - helm upgrade --install wsj-standup ./deploy/chart/wsj-standup --namespace wsj --set image.tag=$IMAGE_TAG --set=app.WEBHOOK_URL=$DISCORD_WEBHOOK_URL --set app.SENTRY_DSN=$SENTRY_DSN --set image.pullSecretBase64=$REGISTRY_PULL_SECRET_BASE64 rules: - if: '$CI_COMMIT_BRANCH == "main"' From f018611efb6da6b21e7c234332f3c4a750e84ba3 Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Thu, 19 May 2022 15:34:57 +0200 Subject: [PATCH 03/10] fix(chart): replace with with if --- deploy/chart/wsj-standup/templates/job.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/chart/wsj-standup/templates/job.yaml b/deploy/chart/wsj-standup/templates/job.yaml index 17ba4e4..45b7670 100644 --- a/deploy/chart/wsj-standup/templates/job.yaml +++ b/deploy/chart/wsj-standup/templates/job.yaml @@ -11,7 +11,7 @@ spec: ttlSecondsAfterFinished: 300 template: spec: - {{- with .Values.image.pullSecretBase64 }} + {{- if .Values.image.pullSecretBase64 }} imagePullSecrets: - name: {{ include "wsj-standup.fullname" . }}-registry-credentials {{- end }} From 5ca80252ada155ecd18bc48580dd137e25136ed1 Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Thu, 19 May 2022 15:49:39 +0200 Subject: [PATCH 04/10] feat(chart): make schedule configurable with prod default --- deploy/chart/wsj-standup/templates/job.yaml | 2 +- deploy/chart/wsj-standup/values.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/chart/wsj-standup/templates/job.yaml b/deploy/chart/wsj-standup/templates/job.yaml index 45b7670..29ac348 100644 --- a/deploy/chart/wsj-standup/templates/job.yaml +++ b/deploy/chart/wsj-standup/templates/job.yaml @@ -3,7 +3,7 @@ kind: CronJob metadata: name: {{ include "wsj-standup.fullname" . }}-job spec: - schedule: "* * * * *" + schedule: {{ .Values.schedule | quote }} jobTemplate: spec: backoffLimit: 4 diff --git a/deploy/chart/wsj-standup/values.yaml b/deploy/chart/wsj-standup/values.yaml index af4fcfd..18cab29 100644 --- a/deploy/chart/wsj-standup/values.yaml +++ b/deploy/chart/wsj-standup/values.yaml @@ -22,6 +22,9 @@ resources: cpu: 50m memory: 128Mi +job: + schedule: "0 8 * * 1" + app: WEBHOOK_URL: null SENTRY_DSN: null From 663c8d8ceef96db4a2bcc0fc910104f4e0fd8909 Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Thu, 19 May 2022 15:53:19 +0200 Subject: [PATCH 05/10] rever: "feat(chart): make schedule configurable with prod default" This reverts commit 5ca80252ada155ecd18bc48580dd137e25136ed1. --- deploy/chart/wsj-standup/templates/job.yaml | 2 +- deploy/chart/wsj-standup/values.yaml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/deploy/chart/wsj-standup/templates/job.yaml b/deploy/chart/wsj-standup/templates/job.yaml index 29ac348..45b7670 100644 --- a/deploy/chart/wsj-standup/templates/job.yaml +++ b/deploy/chart/wsj-standup/templates/job.yaml @@ -3,7 +3,7 @@ kind: CronJob metadata: name: {{ include "wsj-standup.fullname" . }}-job spec: - schedule: {{ .Values.schedule | quote }} + schedule: "* * * * *" jobTemplate: spec: backoffLimit: 4 diff --git a/deploy/chart/wsj-standup/values.yaml b/deploy/chart/wsj-standup/values.yaml index 18cab29..af4fcfd 100644 --- a/deploy/chart/wsj-standup/values.yaml +++ b/deploy/chart/wsj-standup/values.yaml @@ -22,9 +22,6 @@ resources: cpu: 50m memory: 128Mi -job: - schedule: "0 8 * * 1" - app: WEBHOOK_URL: null SENTRY_DSN: null From 6acfa28b3625563ae98849eeb1b76bc4f31a1ea3 Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Thu, 19 May 2022 15:53:46 +0200 Subject: [PATCH 06/10] revert: "refactor(chart): debug schedule" This reverts commit 52423cb822173aea635de0078d12827d28aea967. --- deploy/chart/wsj-standup/templates/job.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/chart/wsj-standup/templates/job.yaml b/deploy/chart/wsj-standup/templates/job.yaml index 45b7670..5e95f2c 100644 --- a/deploy/chart/wsj-standup/templates/job.yaml +++ b/deploy/chart/wsj-standup/templates/job.yaml @@ -3,7 +3,7 @@ kind: CronJob metadata: name: {{ include "wsj-standup.fullname" . }}-job spec: - schedule: "* * * * *" + schedule: "0 8 * * 1" jobTemplate: spec: backoffLimit: 4 From c1c93296bfa033604bc7ab67b139e69532706ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Mare=C5=A1?= Date: Sun, 19 Jun 2022 10:17:22 +0000 Subject: [PATCH 07/10] fix(app): use @everyone instead of @here --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 897b1cd..a253e80 100644 --- a/app.js +++ b/app.js @@ -23,7 +23,7 @@ const config = { } const message = { - "content": "**Čas na další standup!**\nAhoj všichni, je pondělí a je tedy čas na další standup!\n\ncc @here", + "content": "**Čas na další standup!**\nAhoj všichni, je pondělí a je tedy čas na další standup!\n\ncc @everyone", "embeds": [ { "title": "HELP: WTF is Standup?", From d548d67b434982495a52347db7e55fe9f1d92dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Mare=C5=A1?= Date: Sun, 19 Jun 2022 10:57:28 +0000 Subject: [PATCH 08/10] refactor: rename chart to charts [ci skip] it is common practice to name the folder charts even though there is only one helm chart --- .gitlab-ci.yml | 2 +- deploy/{chart => charts}/wsj-standup/.helmignore | 0 deploy/{chart => charts}/wsj-standup/Chart.yaml | 0 deploy/{chart => charts}/wsj-standup/templates/_helpers.tpl | 0 deploy/{chart => charts}/wsj-standup/templates/configmap.yml | 0 deploy/{chart => charts}/wsj-standup/templates/job.yaml | 0 .../wsj-standup/templates/registry-secret.yaml | 0 .../{chart => charts}/wsj-standup/templates/serviceaccount.yaml | 0 deploy/{chart => charts}/wsj-standup/values.yaml | 0 9 files changed, 1 insertion(+), 1 deletion(-) rename deploy/{chart => charts}/wsj-standup/.helmignore (100%) rename deploy/{chart => charts}/wsj-standup/Chart.yaml (100%) rename deploy/{chart => charts}/wsj-standup/templates/_helpers.tpl (100%) rename deploy/{chart => charts}/wsj-standup/templates/configmap.yml (100%) rename deploy/{chart => charts}/wsj-standup/templates/job.yaml (100%) rename deploy/{chart => charts}/wsj-standup/templates/registry-secret.yaml (100%) rename deploy/{chart => charts}/wsj-standup/templates/serviceaccount.yaml (100%) rename deploy/{chart => charts}/wsj-standup/values.yaml (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93641b8..4642940 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,6 @@ deploy:prod: environment: name: prod script: - - helm upgrade --install wsj-standup ./deploy/chart/wsj-standup --namespace wsj --set image.tag=$IMAGE_TAG --set=app.WEBHOOK_URL=$DISCORD_WEBHOOK_URL --set app.SENTRY_DSN=$SENTRY_DSN --set image.pullSecretBase64=$REGISTRY_PULL_SECRET_BASE64 + - helm upgrade --install wsj-standup ./deploy/charts/wsj-standup --namespace wsj --set image.tag=$IMAGE_TAG --set=app.WEBHOOK_URL=$DISCORD_WEBHOOK_URL --set app.SENTRY_DSN=$SENTRY_DSN --set image.pullSecretBase64=$REGISTRY_PULL_SECRET_BASE64 rules: - if: '$CI_COMMIT_BRANCH == "main"' diff --git a/deploy/chart/wsj-standup/.helmignore b/deploy/charts/wsj-standup/.helmignore similarity index 100% rename from deploy/chart/wsj-standup/.helmignore rename to deploy/charts/wsj-standup/.helmignore diff --git a/deploy/chart/wsj-standup/Chart.yaml b/deploy/charts/wsj-standup/Chart.yaml similarity index 100% rename from deploy/chart/wsj-standup/Chart.yaml rename to deploy/charts/wsj-standup/Chart.yaml diff --git a/deploy/chart/wsj-standup/templates/_helpers.tpl b/deploy/charts/wsj-standup/templates/_helpers.tpl similarity index 100% rename from deploy/chart/wsj-standup/templates/_helpers.tpl rename to deploy/charts/wsj-standup/templates/_helpers.tpl diff --git a/deploy/chart/wsj-standup/templates/configmap.yml b/deploy/charts/wsj-standup/templates/configmap.yml similarity index 100% rename from deploy/chart/wsj-standup/templates/configmap.yml rename to deploy/charts/wsj-standup/templates/configmap.yml diff --git a/deploy/chart/wsj-standup/templates/job.yaml b/deploy/charts/wsj-standup/templates/job.yaml similarity index 100% rename from deploy/chart/wsj-standup/templates/job.yaml rename to deploy/charts/wsj-standup/templates/job.yaml diff --git a/deploy/chart/wsj-standup/templates/registry-secret.yaml b/deploy/charts/wsj-standup/templates/registry-secret.yaml similarity index 100% rename from deploy/chart/wsj-standup/templates/registry-secret.yaml rename to deploy/charts/wsj-standup/templates/registry-secret.yaml diff --git a/deploy/chart/wsj-standup/templates/serviceaccount.yaml b/deploy/charts/wsj-standup/templates/serviceaccount.yaml similarity index 100% rename from deploy/chart/wsj-standup/templates/serviceaccount.yaml rename to deploy/charts/wsj-standup/templates/serviceaccount.yaml diff --git a/deploy/chart/wsj-standup/values.yaml b/deploy/charts/wsj-standup/values.yaml similarity index 100% rename from deploy/chart/wsj-standup/values.yaml rename to deploy/charts/wsj-standup/values.yaml From 11d3191f049ad3f45025148332ff14de2281a43f Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Sat, 20 Aug 2022 11:31:29 +0200 Subject: [PATCH 09/10] refactor(helm): change default ImagePullPolicy to Always --- deploy/charts/wsj-standup/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/charts/wsj-standup/values.yaml b/deploy/charts/wsj-standup/values.yaml index af4fcfd..8add9a2 100644 --- a/deploy/charts/wsj-standup/values.yaml +++ b/deploy/charts/wsj-standup/values.yaml @@ -1,6 +1,6 @@ image: repository: registry.mareshq.com/skaut/wsj/standup-discord-notification - pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "" pullSecretBase64: null From bc197a9fd0537e6a6288c22834ab3307031e985e Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Sat, 20 Aug 2022 11:32:05 +0200 Subject: [PATCH 10/10] refactor(app): remove time from embed --- app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.js b/app.js index a253e80..ea6895b 100644 --- a/app.js +++ b/app.js @@ -28,8 +28,7 @@ const message = { { "title": "HELP: WTF is Standup?", "description": "Krátké sepsání na čem pracujete, třeba v bodech. Co máte hotové z aktuálního sprintu, na čem pracujete, co vás ještě čeká, případné překážky nebo zda s něčím potřebujete pomoc.", - "color": 5814783, - "timestamp": (new Date()).toISOString() // "2022-05-24T22:00:00.000Z" + "color": 5814783 } ], "attachments": []