chore: update deploy & build pipeline [skip ci]
continuous-integration/drone/tag Build was killed Details

This commit is contained in:
Dawid Wysokiński 2023-06-09 08:47:31 +02:00
parent 119c8028a1
commit 9e0e3365e4
Signed by: Kichiyaki
GPG Key ID: B5445E357FB8B892
3 changed files with 117 additions and 3 deletions

View File

@ -229,6 +229,103 @@ trigger:
depends_on:
- linux-amd64
---
kind: pipeline
type: docker
name: migrations-linux-amd64
platform:
os: linux
arch: amd64
steps:
- name: publish
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
registry: gitea.dwysokinski.me
repo: gitea.dwysokinski.me/twhelp-packages/dcbot-migrations
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: ./build/docker/dcbot-migrations/Dockerfile
- name: notify
image: drillster/drone-email
settings:
from.address:
from_secret: email_from
from.name: Drone
host:
from_secret: email_host
username:
from_secret: email_username
password:
from_secret: email_password
recipients:
- notifications@dwysokinski.me
recipients_only: true
when:
status:
- failure
trigger:
event:
- tag
---
kind: pipeline
type: docker
name: migrations-manifest
steps:
- name: manifest
image: plugins/manifest
settings:
auto_tag: "true"
ignore_missing: "true"
spec: ./build/docker/dcbot-migrations/manifest.tmpl
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: manifest-latest
image: plugins/manifest
settings:
tags: latest
ignore_missing: "true"
spec: ./build/docker/dcbot-migrations/manifest.tmpl
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: notify
image: drillster/drone-email
settings:
from.address:
from_secret: email_from
from.name: Drone
host:
from_secret: email_host
username:
from_secret: email_username
password:
from_secret: email_password
recipients:
- notifications@dwysokinski.me
recipients_only: true
when:
status:
- failure
trigger:
event:
- tag
depends_on:
- linux-amd64
---
kind: pipeline
type: docker
@ -242,7 +339,7 @@ steps:
from_secret: kubeconfig
commands:
- "mkdir ~/.kube && echo \"$KUBECONFIG\" > ~/.kube/twhelp"
- "cd ./k8s/overlays/prod && kustomize edit set image dcbot=gitea.dwysokinski.me/twhelp-packages/dcbot:${DRONE_TAG##v} && cd ../../.."
- "cd ./k8s/overlays/prod && kustomize edit set image dcbot=gitea.dwysokinski.me/twhelp-packages/dcbot:${DRONE_TAG##v} dcbot-migrations=gitea.dwysokinski.me/twhelp-packages/dcbot-migrations:${DRONE_TAG##v} && cd ../../.."
- "kubectl --kubeconfig ~/.kube/twhelp -n twhelp delete jobs.batch twhelp-dcbot-migrations-job || true"
- kustomize build ./k8s/overlays/prod | kubectl --kubeconfig ~/.kube/twhelp apply -n twhelp -f -
- name: notify
@ -272,8 +369,9 @@ trigger:
depends_on:
- manifest
- migrations-manifest
---
kind: signature
hmac: 1a53421501649cc55b5b1e7e36550541548cc85a43b0c68eb1638b3355e0f3b2
hmac: e6802665ceabcab8b519156f14f050b5a3714f0dd402f2c88c81e6723bf8d590
...

View File

@ -0,0 +1,13 @@
image: gitea.dwysokinski.me/twhelp-packages/dcbot-migrations:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: gitea.dwysokinski.me/twhelp-packages/dcbot-migrations:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux

View File

@ -6,4 +6,7 @@ resources:
images:
- name: dcbot
newName: dcbot
newTag: latest
newTag: latest
- name: dcbot-migrations
newName: dcbot-migrations
newTag: latest