test-staging #8

Merged
kleph merged 3 commits from test-staging into master 2020-03-03 01:02:28 +01:00
Showing only changes of commit cd298e4a27 - Show all commits

View file

@ -58,11 +58,26 @@ depends_on:
- unit tests - unit tests
--- ---
deploy_commands_alias:
- &deploy_commands
commands:
- echo "== pre deploy ($${LEVEL}) status:"
- kubectl get pods --namespace=beer
- kubectl get deployments --namespace=beer
- sed "s/__LEVEL__/$${LEVEL}/g" kube/beer-deployment.yaml > kube/beer-deployment-$${LEVEL}.yaml
- sed "s/__NAMESPACE__/$${NAMESPACE}/g" kube/beer-deployment-$${LEVEL}.yaml > kube/beer-deployment-$${NAMESPACE}-$${LEVEL}.yaml
- sed "s/__IMAGE_TAG__/$${IMAGE_TAG}/g" kube/beer-deployment-$${NAMESPACE}-$${LEVEL}.yaml > kube/beer-deployment-$${NAMESPACE}-$${LEVEL}2.yaml
- echo "applying"
- kubectl apply -f kube/beer-deployment-$${NAMESPACE}-$${LEVEL}2.yaml --namespace=beer
- echo "== post deploy ($${LEVEL}) status:"
- kubectl get deployments --namespace=beer
- kubectl get pods --namespace=beer
kind: pipeline kind: pipeline
name: staging name: deploy
steps: steps:
- name: deploy - name: deploy staging
image: sinlead/drone-kubectl image: sinlead/drone-kubectl
settings: settings:
kubernetes_server: kubernetes_server:
@ -75,32 +90,13 @@ steps:
IMAGE_TAG: ${DRONE_COMMIT_SHA:0:8} IMAGE_TAG: ${DRONE_COMMIT_SHA:0:8}
NAMESPACE: beer NAMESPACE: beer
LEVEL: staging LEVEL: staging
commands: <<: *deploy_commands
- echo "== pre deploy ($${LEVEL}) status:"
- kubectl get pods --namespace=beer
- kubectl get deployments --namespace=beer
- sed "s/__LEVEL__/$${LEVEL}/g" kube/beer-deployment.yaml > kube/beer-deployment-$${LEVEL}.yaml
- sed "s/__NAMESPACE__/$${NAMESPACE}/g" kube/beer-deployment-$${LEVEL}.yaml > kube/beer-deployment-$${NAMESPACE}-$${LEVEL}.yaml
- sed "s/__IMAGE_TAG__/$${IMAGE_TAG}/g" kube/beer-deployment-$${NAMESPACE}-$${LEVEL}.yaml > kube/beer-deployment-$${NAMESPACE}-$${LEVEL}2.yaml
- echo "applying"
- kubectl apply -f kube/beer-deployment-$${NAMESPACE}-$${LEVEL}2.yaml --namespace=beer
- echo "== post deploy ($${LEVEL}) status:"
- kubectl get deployments --namespace=beer
- kubectl get pods --namespace=beer
when: when:
branch: branch:
exclude: exclude:
- master - master
depends_on: - name: deploy live
- build
---
kind: pipeline
name: deploy
steps:
- name: deploy
image: sinlead/drone-kubectl image: sinlead/drone-kubectl
settings: settings:
kubernetes_server: kubernetes_server:
@ -113,18 +109,7 @@ steps:
IMAGE_TAG: ${DRONE_COMMIT_SHA:0:8} IMAGE_TAG: ${DRONE_COMMIT_SHA:0:8}
NAMESPACE: beer NAMESPACE: beer
LEVEL: prod LEVEL: prod
commands: <<: *deploy_commands
- echo "== pre deploy ($${LEVEL}) status:"
- kubectl get pods --namespace=beer
- kubectl get deployments --namespace=beer
- sed "s/__LEVEL__/$${LEVEL}/g" kube/beer-deployment.yaml > kube/beer-deployment-$${LEVEL}.yaml
- sed "s/__NAMESPACE__/$${NAMESPACE}/g" kube/beer-deployment-$${LEVEL}.yaml > kube/beer-deployment-$${NAMESPACE}-$${LEVEL}.yaml
- sed "s/__IMAGE_TAG__/$${IMAGE_TAG}/g" kube/beer-deployment-$${NAMESPACE}-$${LEVEL}.yaml > kube/beer-deployment-$${NAMESPACE}-$${LEVEL}2.yaml
- echo "applying"
- kubectl apply -f kube/beer-deployment-$${NAMESPACE}-$${LEVEL}2.yaml --namespace=beer
- echo "== post deploy ($${LEVEL}) status:"
- kubectl get deployments --namespace=beer
- kubectl get pods --namespace=beer
when: when:
branch: branch:
include: include: