Aaron Riedel
c68ad2c483
All checks were successful
continuous-integration/drone/push Build is passing
115 lines
2.4 KiB
YAML
115 lines
2.4 KiB
YAML
kind: pipeline
|
|
name: build
|
|
|
|
steps:
|
|
- name: gofmt
|
|
image: golang:1.22.3
|
|
commands:
|
|
- gofmt -l -s .
|
|
when:
|
|
event:
|
|
- push
|
|
- name: vuln-check
|
|
image: golang:1.22.3
|
|
commands:
|
|
- go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
- govulncheck ./...
|
|
when:
|
|
event:
|
|
- push
|
|
- name: docker
|
|
image: thegeeklab/drone-docker-buildx
|
|
privileged: true
|
|
settings:
|
|
registry: git.ar21.de
|
|
username:
|
|
from_secret: REGISTRY_USER
|
|
password:
|
|
from_secret: REGISTRY_PASS
|
|
repo: git.ar21.de/yolokube/grafana-backuper
|
|
tags:
|
|
- latest
|
|
- ${DRONE_BUILD_NUMBER}
|
|
platforms:
|
|
- linux/arm64
|
|
- linux/amd64
|
|
when:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
depends_on:
|
|
- gofmt
|
|
- vuln-check
|
|
- name: docker-build
|
|
image: thegeeklab/drone-docker-buildx
|
|
privileged: true
|
|
settings:
|
|
registry: git.ar21.de
|
|
username:
|
|
from_secret: REGISTRY_USER
|
|
password:
|
|
from_secret: REGISTRY_PASS
|
|
repo: git.ar21.de/yolokube/grafana-backuper
|
|
tags:
|
|
- latest
|
|
- ${DRONE_BUILD_NUMBER}
|
|
platforms:
|
|
- linux/arm64
|
|
- linux/amd64
|
|
dry_run: true
|
|
when:
|
|
branch:
|
|
exclude:
|
|
- main
|
|
event:
|
|
- push
|
|
depends_on:
|
|
- gofmt
|
|
- vuln-check
|
|
- name: bump tag in deployment-repo
|
|
image: git.ar21.de/aaron/kustomize-ci
|
|
commands:
|
|
- cd /deployment-repo
|
|
- git clone https://git.ar21.de/yolokube/grafana-backuper-deployment.git .
|
|
- cd /deployment-repo/overlay
|
|
- kustomize edit set image git.ar21.de/yolokube/grafana-backuper=git.ar21.de/yolokube/grafana-backuper:${DRONE_BUILD_NUMBER}
|
|
volumes:
|
|
- name: deployment-repo
|
|
path: /deployment-repo
|
|
when:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
depends_on:
|
|
- docker
|
|
- name: push new tag to deployment-repo
|
|
image: appleboy/drone-git-push
|
|
settings:
|
|
branch: main
|
|
remote: ssh://git@git.ar21.de:2222/yolokube/grafana-backuper-deployment.git
|
|
path: /deployment-repo
|
|
force: false
|
|
commit: true
|
|
commit_message: "GRAFANA-BACKUPER: update image tag to ${DRONE_BUILD_NUMBER} (done automagically via Drone pipeline)"
|
|
ssh_key:
|
|
from_secret: GITEA_SSH_KEY
|
|
volumes:
|
|
- name: deployment-repo
|
|
path: /deployment-repo
|
|
when:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
depends_on:
|
|
- bump tag in deployment-repo
|
|
volumes:
|
|
- name: deployment-repo
|
|
temp: {}
|
|
when:
|
|
event:
|
|
exclude:
|
|
- pull_request
|
|
|