2023-02-18 17:46:04 +00:00
|
|
|
---
|
|
|
|
# ----------------------------------------------
|
|
|
|
# -- Helmfile diff changes
|
|
|
|
# ----------------------------------------------
|
|
|
|
kind: pipeline
|
2023-05-18 17:58:57 +00:00
|
|
|
type: docker
|
2023-02-18 17:46:04 +00:00
|
|
|
name: Show helmfile diffs
|
2023-05-18 17:58:57 +00:00
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
2023-02-18 17:46:04 +00:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
2023-03-23 13:49:48 +00:00
|
|
|
exclude:
|
2023-02-18 17:46:04 +00:00
|
|
|
- main
|
|
|
|
event:
|
2023-03-23 13:49:48 +00:00
|
|
|
- push
|
2023-02-18 17:46:04 +00:00
|
|
|
|
|
|
|
steps:
|
2023-03-23 13:49:48 +00:00
|
|
|
- name: Diff badhouseplants
|
|
|
|
image: ghcr.io/helmfile/helmfile:canary
|
|
|
|
environment:
|
2023-05-21 10:08:53 +00:00
|
|
|
KUBECONFIG_CONTENT:
|
|
|
|
from_secret: KUBECONFIG_CONTENT
|
2023-03-23 13:49:48 +00:00
|
|
|
SOPS_AGE_KEY:
|
|
|
|
from_secret: SOPS_AGE_KEY
|
|
|
|
commands:
|
2023-05-21 10:08:53 +00:00
|
|
|
- mkdir $HOME/.kube
|
2023-07-20 16:19:44 +00:00
|
|
|
- echo "$KUBECONFIG_CONTENT" > $HOME/.kube/config && chmod 0600 $HOME/.kube/config
|
2023-03-23 13:49:48 +00:00
|
|
|
- helmfile -e badhouseplants diff --suppress-secrets
|
2023-02-18 17:46:04 +00:00
|
|
|
|
2023-03-23 13:49:48 +00:00
|
|
|
- name: Diff eterosoft
|
|
|
|
image: ghcr.io/helmfile/helmfile:canary
|
|
|
|
environment:
|
|
|
|
SOPS_AGE_KEY:
|
|
|
|
from_secret: SOPS_AGE_KEY
|
2023-05-21 10:08:53 +00:00
|
|
|
KUBECONFIG_CONTENT:
|
|
|
|
from_secret: KUBECONFIG_CONTENT
|
2023-03-23 13:49:48 +00:00
|
|
|
commands:
|
2023-05-21 10:08:53 +00:00
|
|
|
- mkdir $HOME/.kube
|
2023-07-20 16:19:44 +00:00
|
|
|
- echo "$KUBECONFIG_CONTENT" > $HOME/.kube/config && chmod 0600 $HOME/.kube/config
|
2023-03-23 13:49:48 +00:00
|
|
|
- helmfile -e etersoft diff --suppress-secrets
|
2023-02-18 17:46:04 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
# ----------------------------------------------
|
|
|
|
# -- Helmfile apply changes
|
|
|
|
# ----------------------------------------------
|
|
|
|
kind: pipeline
|
2023-05-18 17:58:57 +00:00
|
|
|
type: docker
|
2023-02-18 17:46:04 +00:00
|
|
|
name: Apply helmfile changes
|
|
|
|
|
2023-05-18 17:58:57 +00:00
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
2023-02-18 17:46:04 +00:00
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- main
|
|
|
|
event:
|
2023-03-23 13:49:48 +00:00
|
|
|
- push
|
2023-02-18 17:46:04 +00:00
|
|
|
|
|
|
|
steps:
|
2023-03-23 13:49:48 +00:00
|
|
|
- name: Apply badhouseplants
|
|
|
|
image: ghcr.io/helmfile/helmfile:canary
|
|
|
|
environment:
|
2023-05-21 10:08:53 +00:00
|
|
|
KUBECONFIG_CONTENT:
|
|
|
|
from_secret: KUBECONFIG_CONTENT
|
2023-03-23 13:49:48 +00:00
|
|
|
SOPS_AGE_KEY:
|
|
|
|
from_secret: SOPS_AGE_KEY
|
|
|
|
commands:
|
2023-05-21 10:08:53 +00:00
|
|
|
- mkdir $HOME/.kube
|
2023-07-20 16:19:44 +00:00
|
|
|
- echo "$KUBECONFIG_CONTENT" > $HOME/.kube/config && chmod 0600 $HOME/.kube/config
|
2023-03-23 13:49:48 +00:00
|
|
|
- helmfile -e badhouseplants apply --suppress-secrets
|
2023-02-18 17:46:04 +00:00
|
|
|
|
2023-03-23 13:49:48 +00:00
|
|
|
- name: Apply eterosoft
|
|
|
|
image: ghcr.io/helmfile/helmfile:canary
|
|
|
|
environment:
|
2023-05-21 10:08:53 +00:00
|
|
|
KUBECONFIG_CONTENT:
|
|
|
|
from_secret: KUBECONFIG_CONTENT
|
2023-03-23 13:49:48 +00:00
|
|
|
SOPS_AGE_KEY:
|
|
|
|
from_secret: SOPS_AGE_KEY
|
|
|
|
commands:
|
2023-05-21 10:08:53 +00:00
|
|
|
- mkdir $HOME/.kube
|
2023-07-20 16:19:44 +00:00
|
|
|
- echo "$KUBECONFIG_CONTENT" > $HOME/.kube/config && chmod 0600 $HOME/.kube/config
|
2023-03-23 13:49:48 +00:00
|
|
|
- helmfile -e etersoft apply --suppress-secrets
|
2023-02-18 17:46:04 +00:00
|
|
|
|
2023-03-23 13:49:48 +00:00
|
|
|
---
|
|
|
|
# ----------------------------------------------
|
|
|
|
# -- Check da helm pipeline
|
|
|
|
# ----------------------------------------------
|
|
|
|
kind: pipeline
|
2023-05-18 17:58:57 +00:00
|
|
|
type: docker
|
2023-03-23 13:49:48 +00:00
|
|
|
name: Check helmfiles
|
|
|
|
trigger:
|
|
|
|
event:
|
2023-09-27 03:08:46 +00:00
|
|
|
# - cron
|
|
|
|
- push
|
|
|
|
# cron:
|
|
|
|
# - daily
|
2023-03-23 13:49:48 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check badhouseplants
|
2023-05-04 11:13:08 +00:00
|
|
|
image: ghcr.io/allanger/check-da-helm-helmfile-secrets:stable
|
2023-03-23 13:49:48 +00:00
|
|
|
environment:
|
|
|
|
RUST_LOG: info
|
2023-04-19 06:58:38 +00:00
|
|
|
SOPS_AGE_KEY:
|
|
|
|
from_secret: SOPS_AGE_KEY
|
2023-03-23 13:49:48 +00:00
|
|
|
commands:
|
2023-09-27 03:08:46 +00:00
|
|
|
- helmfile -e badhouseplants list
|
2023-09-14 05:03:41 +00:00
|
|
|
- echo "Hey, bud, some helm releases are outdated:" > message_file.tpl
|
|
|
|
- cdh --kind helmfile -p $DRONE_WORKSPACE/helmfile.yaml --helmfile-environment badhouseplants -o >> message_file.tpl
|
|
|
|
|
|
|
|
- name: Send telegram notification
|
|
|
|
when:
|
|
|
|
status:
|
|
|
|
- failure
|
|
|
|
image: appleboy/drone-telegram
|
|
|
|
settings:
|
|
|
|
token:
|
|
|
|
from_secret: TELEGRAM_TOKEN
|
|
|
|
to: 131601077
|
|
|
|
message_file: message_file.tpl
|