From b770949fde541a8d561ef7313ad5cfc28c71cc4e Mon Sep 17 00:00:00 2001 From: gitromba Date: Fri, 12 Mar 2021 14:10:46 +0100 Subject: [PATCH 01/12] noty --- guestbook/notification.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 guestbook/notification.yaml diff --git a/guestbook/notification.yaml b/guestbook/notification.yaml new file mode 100644 index 0000000..7b3f449 --- /dev/null +++ b/guestbook/notification.yaml @@ -0,0 +1,24 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generateName: app-slack-notification- + annotations: + argocd.argoproj.io/hook: PostSync + argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: slack-notification + image: curlimages/curl + command: + - "curl" + - "-X" + - "POST" + - "-H" + - "Content-type: application/json" + - "--data" + - "{\"text\": \"nemjuhuuu\"}" + - "https://hooks.slack.com/services/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" + restartPolicy: Never + backoffLimit: 2 From d0837170d4df61cf006b019e99d48ad7c38fe95f Mon Sep 17 00:00:00 2001 From: gitromba Date: Fri, 12 Mar 2021 14:40:01 +0100 Subject: [PATCH 02/12] fix: hook url leak --- guestbook/notification.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guestbook/notification.yaml b/guestbook/notification.yaml index 7b3f449..33f0d0e 100644 --- a/guestbook/notification.yaml +++ b/guestbook/notification.yaml @@ -11,6 +11,9 @@ spec: containers: - name: slack-notification image: curlimages/curl + envFrom: + - secretRef: + name: slack command: - "curl" - "-X" @@ -18,7 +21,7 @@ spec: - "-H" - "Content-type: application/json" - "--data" - - "{\"text\": \"nemjuhuuu\"}" - - "https://hooks.slack.com/services/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" + - "{\"text\": \"juhuu\"}" + - "$(HOOK_URL)" restartPolicy: Never backoffLimit: 2 From 3a281daf3eceafb534f3bd03f091ad10b3bcc080 Mon Sep 17 00:00:00 2001 From: gitromba Date: Fri, 12 Mar 2021 14:45:05 +0100 Subject: [PATCH 03/12] cd: fail deploy noty --- guestbook/fail-notification.yaml | 27 +++++++++++++++++++ ...ication.yaml => success-notification.yaml} | 0 2 files changed, 27 insertions(+) create mode 100644 guestbook/fail-notification.yaml rename guestbook/{notification.yaml => success-notification.yaml} (100%) diff --git a/guestbook/fail-notification.yaml b/guestbook/fail-notification.yaml new file mode 100644 index 0000000..40714bf --- /dev/null +++ b/guestbook/fail-notification.yaml @@ -0,0 +1,27 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generateName: app-slack-notification- + annotations: + argocd.argoproj.io/hook: SyncFail + argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: slack-notification + image: curlimages/curl + envFrom: + - secretRef: + name: slack + command: + - "curl" + - "-X" + - "POST" + - "-H" + - "Content-type: application/json" + - "--data" + - "{\"text\": \"auuu\"}" + - "$(HOOK_URL)" + restartPolicy: Never + backoffLimit: 2 diff --git a/guestbook/notification.yaml b/guestbook/success-notification.yaml similarity index 100% rename from guestbook/notification.yaml rename to guestbook/success-notification.yaml From ab5754f5733535f44a799192055bd3559314f1b8 Mon Sep 17 00:00:00 2001 From: gitromba Date: Fri, 12 Mar 2021 14:52:30 +0100 Subject: [PATCH 04/12] cd: fail deploy noty only --- guestbook/success-notification.yaml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 guestbook/success-notification.yaml diff --git a/guestbook/success-notification.yaml b/guestbook/success-notification.yaml deleted file mode 100644 index 33f0d0e..0000000 --- a/guestbook/success-notification.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - generateName: app-slack-notification- - annotations: - argocd.argoproj.io/hook: PostSync - argocd.argoproj.io/hook-delete-policy: HookSucceeded -spec: - template: - spec: - containers: - - name: slack-notification - image: curlimages/curl - envFrom: - - secretRef: - name: slack - command: - - "curl" - - "-X" - - "POST" - - "-H" - - "Content-type: application/json" - - "--data" - - "{\"text\": \"juhuu\"}" - - "$(HOOK_URL)" - restartPolicy: Never - backoffLimit: 2 From fa1206868503d0503841d470700970eb72b08455 Mon Sep 17 00:00:00 2001 From: gitromba Date: Wed, 17 Mar 2021 12:54:36 +0100 Subject: [PATCH 05/12] a --- guestbook/success-notification.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 guestbook/success-notification.yaml diff --git a/guestbook/success-notification.yaml b/guestbook/success-notification.yaml new file mode 100644 index 0000000..40714bf --- /dev/null +++ b/guestbook/success-notification.yaml @@ -0,0 +1,27 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generateName: app-slack-notification- + annotations: + argocd.argoproj.io/hook: SyncFail + argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: slack-notification + image: curlimages/curl + envFrom: + - secretRef: + name: slack + command: + - "curl" + - "-X" + - "POST" + - "-H" + - "Content-type: application/json" + - "--data" + - "{\"text\": \"auuu\"}" + - "$(HOOK_URL)" + restartPolicy: Never + backoffLimit: 2 From d152b2fb5a9adc3aab6fdc65b1092f3178f00a69 Mon Sep 17 00:00:00 2001 From: gitromba Date: Wed, 17 Mar 2021 13:02:23 +0100 Subject: [PATCH 06/12] works? --- guestbook/success-notification.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guestbook/success-notification.yaml b/guestbook/success-notification.yaml index 40714bf..2acf365 100644 --- a/guestbook/success-notification.yaml +++ b/guestbook/success-notification.yaml @@ -3,7 +3,7 @@ kind: Job metadata: generateName: app-slack-notification- annotations: - argocd.argoproj.io/hook: SyncFail + argocd.argoproj.io/hook: PostSync argocd.argoproj.io/hook-delete-policy: HookSucceeded spec: template: @@ -21,7 +21,10 @@ spec: - "-H" - "Content-type: application/json" - "--data" - - "{\"text\": \"auuu\"}" + - "{\"text\": \"it works!\"}" - "$(HOOK_URL)" restartPolicy: Never backoffLimit: 2 + + +# k create secret generic slack --from-literal=HOOK_URL=https://hooks.slack.com/services/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 -n default \ No newline at end of file From 96283190387f4a1c56f6edb1ebc15993891f0ea1 Mon Sep 17 00:00:00 2001 From: gitromba Date: Wed, 17 Mar 2021 13:09:02 +0100 Subject: [PATCH 07/12] ops --- guestbook/success-notification.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/guestbook/success-notification.yaml b/guestbook/success-notification.yaml index 2acf365..f09cafa 100644 --- a/guestbook/success-notification.yaml +++ b/guestbook/success-notification.yaml @@ -24,7 +24,4 @@ spec: - "{\"text\": \"it works!\"}" - "$(HOOK_URL)" restartPolicy: Never - backoffLimit: 2 - - -# k create secret generic slack --from-literal=HOOK_URL=https://hooks.slack.com/services/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 -n default \ No newline at end of file + backoffLimit: 2 \ No newline at end of file From 4a593ac2897f587d09cb15aadba3743497434e62 Mon Sep 17 00:00:00 2001 From: gitromba Date: Thu, 18 Mar 2021 09:55:37 +0100 Subject: [PATCH 08/12] --allow-empty --- guestbook/a | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 guestbook/a diff --git a/guestbook/a b/guestbook/a new file mode 100644 index 0000000..e69de29 From 4d769650cce8acf6a774f8d001ad69044146856a Mon Sep 17 00:00:00 2001 From: gitromba Date: Thu, 18 Mar 2021 09:56:25 +0100 Subject: [PATCH 09/12] --allow-empty --- guestbook/fail-notification.yaml | 27 --------------------------- guestbook/success-notification.yaml | 27 --------------------------- 2 files changed, 54 deletions(-) delete mode 100644 guestbook/fail-notification.yaml delete mode 100644 guestbook/success-notification.yaml diff --git a/guestbook/fail-notification.yaml b/guestbook/fail-notification.yaml deleted file mode 100644 index 40714bf..0000000 --- a/guestbook/fail-notification.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - generateName: app-slack-notification- - annotations: - argocd.argoproj.io/hook: SyncFail - argocd.argoproj.io/hook-delete-policy: HookSucceeded -spec: - template: - spec: - containers: - - name: slack-notification - image: curlimages/curl - envFrom: - - secretRef: - name: slack - command: - - "curl" - - "-X" - - "POST" - - "-H" - - "Content-type: application/json" - - "--data" - - "{\"text\": \"auuu\"}" - - "$(HOOK_URL)" - restartPolicy: Never - backoffLimit: 2 diff --git a/guestbook/success-notification.yaml b/guestbook/success-notification.yaml deleted file mode 100644 index f09cafa..0000000 --- a/guestbook/success-notification.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - generateName: app-slack-notification- - annotations: - argocd.argoproj.io/hook: PostSync - argocd.argoproj.io/hook-delete-policy: HookSucceeded -spec: - template: - spec: - containers: - - name: slack-notification - image: curlimages/curl - envFrom: - - secretRef: - name: slack - command: - - "curl" - - "-X" - - "POST" - - "-H" - - "Content-type: application/json" - - "--data" - - "{\"text\": \"it works!\"}" - - "$(HOOK_URL)" - restartPolicy: Never - backoffLimit: 2 \ No newline at end of file From a3c94bdf44eea6f20d4298f5ee9699edf75018c0 Mon Sep 17 00:00:00 2001 From: gitromba Date: Thu, 18 Mar 2021 09:58:16 +0100 Subject: [PATCH 10/12] --allow-empty --- guestbook/b | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 guestbook/b diff --git a/guestbook/b b/guestbook/b new file mode 100644 index 0000000..e69de29 From 16a5c87000524c6abf4a7150fb2805117eddf75c Mon Sep 17 00:00:00 2001 From: gitromba Date: Thu, 18 Mar 2021 10:28:21 +0100 Subject: [PATCH 11/12] --allow-empty --- guestbook/d | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 guestbook/d diff --git a/guestbook/d b/guestbook/d new file mode 100644 index 0000000..e69de29 From 04b12c6facb5cd03b280bf258a7ebce3ea772c80 Mon Sep 17 00:00:00 2001 From: gitromba Date: Thu, 18 Mar 2021 13:24:30 +0100 Subject: [PATCH 12/12] a --- guestbook/xxxx | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 guestbook/xxxx diff --git a/guestbook/xxxx b/guestbook/xxxx new file mode 100644 index 0000000..e69de29