proper-website-2/.drone.yml

119 lines
2.6 KiB
YAML
Raw Normal View History

2022-03-12 16:22:41 +01:00
kind: pipeline
type: kubernetes
2022-05-14 21:09:48 +02:00
name: staging
2022-03-12 16:22:41 +01:00
2022-03-12 20:43:21 +01:00
trigger:
event:
- push
2022-05-14 21:09:48 +02:00
# STAGING!!!!
2022-03-12 16:22:41 +01:00
steps:
2022-05-14 21:09:48 +02:00
- name: build-wasm
image: golang:1.17.8-alpine
volumes:
- name: build
path: /drone/src/build
environment:
APIURL: https://api.quenten.nl/api/testing
commands:
- mkdir ./build/web
- GOARCH=wasm GOOS=js go build -o ./build/web/app.wasm -ldflags="-X 'main.ApiURL=$APIURL'" ./src
- name: build-server
image: golang:1.17.8-alpine
volumes:
- name: build
path: /drone/src/build
environment:
APIURL: https://api.quenten.nl/api/testing
commands:
- go build -o ./build/app -ldflags="-X 'main.ApiURL=$APIURL'" ./src
- name: build-publish-image
2022-03-12 21:41:02 +01:00
image: plugins/docker
2022-05-14 21:09:48 +02:00
privileged: true
volumes:
- name: build
path: /drone/src/build
2022-03-12 21:41:02 +01:00
settings:
2022-05-14 21:09:48 +02:00
cache_from:
- "dutchellie/proper-website-2:dev"
username:
2022-03-12 21:41:02 +01:00
from_secret: docker_username
password:
from_secret: docker_password
2022-05-14 21:09:48 +02:00
dockerfile: Dockerfile
2022-03-12 21:41:02 +01:00
repo: dutchellie/proper-website-2
2022-05-14 21:09:48 +02:00
tags:
2022-03-13 19:34:20 +01:00
- dev
2022-03-12 21:41:02 +01:00
- ${DRONE_COMMIT_SHA:0:8}
2022-05-14 21:09:48 +02:00
depends_on:
- build-wasm
- build-server
2022-03-12 17:47:01 +01:00
- name: deploy-staging
image: pelotech/drone-helm3
settings:
mode: upgrade
chart: .drone/helm/chart
2022-03-12 19:11:21 +01:00
namespace: drone-staging
2022-03-12 17:47:01 +01:00
release: newsite-staging
2022-03-12 19:10:13 +01:00
skip_tls_verify: true
2022-03-12 17:47:01 +01:00
values_files:
2022-03-12 19:26:04 +01:00
- .drone/helm/staging-val.yaml
2022-03-12 21:32:02 +01:00
values:
- "image=dutchellie/proper-website-2:${DRONE_COMMIT_SHA:0:8}"
2022-03-12 17:47:01 +01:00
kube_api_server:
from_secret: staging_api_server
kube_token:
from_secret: staging_kube_token
2022-03-12 18:00:12 +01:00
kube_certificate:
from_secret: staging_kube_certificate
kube_service_account: drone-deploy
2022-03-12 20:28:47 +01:00
dry_run: false
2022-05-14 21:10:44 +02:00
depends_on:
- build-publish-image
2022-03-12 20:43:21 +01:00
---
kind: pipeline
type: kubernetes
name: deploy-prod
trigger:
event:
- promote
target:
- production
steps:
2022-03-13 19:34:20 +01:00
- name: docker
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: dutchellie/proper-website-2
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
2022-03-12 20:43:21 +01:00
- name: deploy-production
image: pelotech/drone-helm3
settings:
mode: upgrade
chart: .drone/helm/chart
namespace: drone-production
release: newsite-production
skip_tls_verify: true
values_files:
# - .drone/helm/values.yaml
- .drone/helm/prod-val.yaml
2022-03-12 21:32:02 +01:00
values:
- "image=dutchellie/proper-website-2:${DRONE_COMMIT_SHA:0:8}"
2022-03-12 20:43:21 +01:00
kube_api_server:
from_secret: prod_api_server
kube_token:
from_secret: prod_kube_token
kube_certificate:
from_secret: prod_kube_certificate
kube_service_account: drone-deploy
dry_run: false