scripts/.drone.yml

168 lines
3.3 KiB
YAML
Raw Normal View History

---
kind: pipeline
type: docker
name: build
platform:
os: linux
arch: amd64
steps:
- name: build
image: node:16-bullseye
commands:
- yarn && yarn build
trigger:
event:
- push
- pull_request
branch:
- master
2023-01-26 07:23:07 +00:00
---
kind: pipeline
type: docker
name: 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/scripts
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: Dockerfile
2023-07-01 12:14:58 +00:00
- 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
2023-01-26 07:23:07 +00:00
trigger:
event:
- tag
2023-01-26 07:23:07 +00:00
---
kind: pipeline
type: docker
name: manifest
steps:
- name: manifest
image: plugins/manifest
settings:
auto_tag: "true"
ignore_missing: "true"
spec: 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: manifest.tmpl
username:
from_secret: docker_username
password:
from_secret: docker_password
2023-07-01 12:14:58 +00:00
- 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
2023-01-26 07:23:07 +00:00
trigger:
event:
- tag
depends_on:
- linux-amd64
---
kind: pipeline
type: docker
name: deploy
steps:
- name: deploy-k8s
2023-06-09 04:59:27 +00:00
image: alpine/k8s:1.26.5
2023-01-26 07:23:07 +00:00
environment:
KUBECONFIG:
from_secret: kubeconfig
commands:
- "mkdir ~/.kube && echo \"$KUBECONFIG\" > ~/.kube/twhelp"
- "cd ./k8s/overlays/prod && kustomize edit set image scripts=gitea.dwysokinski.me/twhelp-packages/scripts:${DRONE_TAG##v} && cd ../../.."
- kustomize build ./k8s/overlays/prod | kubectl --kubeconfig ~/.kube/twhelp apply -n twhelp -f -
2023-07-01 12:14:58 +00:00
- 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
subject: "[deploy - {{ build.status }}] {{ repo.owner }}/{{ repo.name }} ({{ build.branch }} - {{ truncate build.commit 8 }})"
when:
status:
- success
- failure
2023-01-26 07:23:07 +00:00
trigger:
event:
- tag
depends_on:
- manifest
2023-01-26 07:23:07 +00:00
---
kind: signature
2023-07-01 12:14:58 +00:00
hmac: 7d871aa28a97b39f7c567f55700bffcb2919a8b7caf9e232bf99b6a045b15369
2023-01-26 07:23:07 +00:00
...