This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
k8s-cluster-config/.drone.yml

123 lines
3.0 KiB
YAML
Raw Normal View History

---
# ----------------------------------------------
# -- Helmfile diff changes
# ----------------------------------------------
kind: pipeline
2023-05-18 17:58:57 +00:00
type: docker
name: Show helmfile diffs
2023-05-18 17:58:57 +00:00
platform:
os: linux
arch: amd64
trigger:
branch:
exclude:
- main
event:
- push
steps:
- name: Diff badhouseplants
image: ghcr.io/helmfile/helmfile:canary
environment:
KUBECONFIG_CONTENT:
from_secret: KUBECONFIG_CONTENT
SOPS_AGE_KEY:
from_secret: SOPS_AGE_KEY
commands:
- mkdir $HOME/.kube
- echo "$KUBECONFIG_CONTENT" > $HOME/.kube/config && chmod 0600 $HOME/.kube/config
- helmfile -e badhouseplants diff --suppress-secrets
- name: Diff eterosoft
image: ghcr.io/helmfile/helmfile:canary
environment:
SOPS_AGE_KEY:
from_secret: SOPS_AGE_KEY
KUBECONFIG_CONTENT:
from_secret: KUBECONFIG_CONTENT
commands:
- mkdir $HOME/.kube
- echo "$KUBECONFIG_CONTENT" > $HOME/.kube/config && chmod 0600 $HOME/.kube/config
- helmfile -e etersoft diff --suppress-secrets
---
# ----------------------------------------------
# -- Helmfile apply changes
# ----------------------------------------------
kind: pipeline
2023-05-18 17:58:57 +00:00
type: docker
name: Apply helmfile changes
2023-05-18 17:58:57 +00:00
platform:
os: linux
arch: amd64
trigger:
branch:
- main
event:
- push
steps:
- name: Apply badhouseplants
image: ghcr.io/helmfile/helmfile:canary
environment:
KUBECONFIG_CONTENT:
from_secret: KUBECONFIG_CONTENT
SOPS_AGE_KEY:
from_secret: SOPS_AGE_KEY
commands:
- mkdir $HOME/.kube
- echo "$KUBECONFIG_CONTENT" > $HOME/.kube/config && chmod 0600 $HOME/.kube/config
- helmfile -e badhouseplants apply --suppress-secrets
- name: Apply eterosoft
image: ghcr.io/helmfile/helmfile:canary
environment:
KUBECONFIG_CONTENT:
from_secret: KUBECONFIG_CONTENT
SOPS_AGE_KEY:
from_secret: SOPS_AGE_KEY
commands:
- mkdir $HOME/.kube
- echo "$KUBECONFIG_CONTENT" > $HOME/.kube/config && chmod 0600 $HOME/.kube/config
- helmfile -e etersoft apply --suppress-secrets
---
# ----------------------------------------------
# -- Check da helm pipeline
# ----------------------------------------------
kind: pipeline
2023-05-18 17:58:57 +00:00
type: docker
name: Check helmfiles
trigger:
event:
2023-09-27 03:08:46 +00:00
# - cron
- push
# cron:
# - daily
steps:
- name: Check badhouseplants
image: ghcr.io/allanger/check-da-helm-helmfile-secrets:stable
environment:
RUST_LOG: info
2023-04-19 06:58:38 +00:00
SOPS_AGE_KEY:
from_secret: SOPS_AGE_KEY
commands:
2023-09-27 03:08:46 +00:00
- helmfile -e badhouseplants list
- 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