q3_server_status/.drone.yml

108 lines
2.6 KiB
YAML
Raw Normal View History

---
kind: pipeline
name: lint
steps:
- name: yaml lint
image: cytopia/yamllint
commands:
- yamllint .
- name: docker lint
image: hadolint/hadolint
commands:
- hadolint Dockerfile # ignore pinning version in pip
- name: markdown lint
image: pipelinecomponents/markdownlint:latest
commands:
- mdl --style all --warnings .
2020-03-25 01:37:41 +01:00
---
kind: pipeline
name: build
steps:
- name: build image
image: plugins/docker
settings:
repo: kleph/quake3-status
tags: ${DRONE_COMMIT_SHA:0:8}
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password
when:
event:
exclude:
- pull_request
depends_on:
- lint
2020-03-25 01:37:41 +01:00
---
deploy_commands_alias:
- &deploy_commands
commands:
- sed "s/__LEVEL__/$${LEVEL}/g" kube/q3-status-deployment.yaml > kube/q3-status-deployment-$${LEVEL}.yaml
- sed "s/__NAMESPACE__/$${NAMESPACE}/g" kube/q3-status-deployment-$${LEVEL}.yaml > kube/q3-status-deployment-$${NAMESPACE}-$${LEVEL}.yaml
- sed "s/__IMAGE_TAG__/$${IMAGE_TAG}/g" kube/q3-status-deployment-$${NAMESPACE}-$${LEVEL}.yaml > kube/q3-status-deployment-$${NAMESPACE}-$${LEVEL}2.yaml
- sed "s/__Q3_SERVER__/$${Q3_SERVER}/g" kube/q3-status-deployment-$${NAMESPACE}-$${LEVEL}2.yaml > kube/q3-status-deployment-$${NAMESPACE}-$${LEVEL}3.yaml
- sed "s/__RCONN_PASSWORD__/$${RCONN_PASSWORD}/g" kube/q3-status-deployment-$${NAMESPACE}-$${LEVEL}3.yaml > kube/q3-status-deployment-$${NAMESPACE}-$${LEVEL}4.yaml
2020-03-25 01:37:41 +01:00
- echo "applying"
- kubectl apply -f kube/q3-status-deployment-$${NAMESPACE}-$${LEVEL}4.yaml --namespace=q3
2020-03-25 01:37:41 +01:00
- echo "== post deploy ($${LEVEL}) status:"
- kubectl get deployments --namespace=q3
- kubectl get pods --namespace=q3
kind: pipeline
name: deploy
steps:
- name: deploy staging
image: sinlead/drone-kubectl
settings:
kubernetes_server:
from_secret: kubectl_uri
kubernetes_cert:
from_secret: kubectl_cert
kubernetes_token:
from_secret: kubectl_token
environment:
IMAGE_TAG: ${DRONE_COMMIT_SHA:0:8}
NAMESPACE: q3
LEVEL: staging
Q3_SERVER: "vm-docker:27960"
RCONN_PASSWORD:
from_secret: rconn_password
2020-03-25 01:37:41 +01:00
<<: *deploy_commands
when:
branch:
exclude:
- master
- name: deploy live
image: sinlead/drone-kubectl
settings:
kubernetes_server:
from_secret: kubectl_uri
kubernetes_cert:
from_secret: kubectl_cert
kubernetes_token:
from_secret: kubectl_token
environment:
IMAGE_TAG: ${DRONE_COMMIT_SHA:0:8}
NAMESPACE: q3
LEVEL: live
Q3_SERVER: "vm-docker:27960"
RCONN_PASSWORD:
from_secret: rconn_password
2020-03-25 01:37:41 +01:00
<<: *deploy_commands
when:
branch:
include:
- master
depends_on:
- build