infrastructure/.drone.yml

44 lines
877 B
YAML

kind: pipeline
type: docker
name: kubernetes
trigger:
branch:
- main
event:
- push
steps:
- name: kubectl
image: bitnami/kubectl
network_mode: host
environment:
KUBE_CONFIG:
from_secret: KUBE_CONFIG
commands:
- echo "$$KUBE_CONFIG" | base64 -d > /.kube/config
- kubectl kustomize ./kustomization/overlays/staging
- kubectl apply -k ./kustomization/overlays/staging
---
kind: pipeline
type: docker
name: production
trigger:
event:
- promote
target:
- production
steps:
- name: kubectl
image: bitnami/kubectl
network_mode: host
environment:
KUBE_CONFIG:
from_secret: KUBE_CONFIG
commands:
- echo "$$KUBE_CONFIG" | base64 -d > /.kube/config
- kubectl kustomize ./kustomization/overlays/production
- kubectl apply -k ./kustomization/overlays/production