switch to drone-matrix

This commit is contained in:
Robert Kaussow 2021-09-19 21:32:11 +02:00
parent ed2bca16d9
commit e829496461
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 318 additions and 278 deletions

View File

@ -214,11 +214,11 @@ local PipelineNotifications = {
}, },
{ {
name: 'matrix', name: 'matrix',
image: 'plugins/matrix', image: 'thegeeklab/drone-matrix',
settings: { settings: {
homeserver: { from_secret: 'matrix_homeserver' }, homeserver: { from_secret: 'matrix_homeserver' },
roomid: { from_secret: 'matrix_roomid' }, roomid: { from_secret: 'matrix_roomid' },
template: 'Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}', template: 'Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}) ({{ build.Branch }}) by {{ commit.Author }}<br/> Message: {{ commit.Message }}',
username: { from_secret: 'matrix_username' }, username: { from_secret: 'matrix_username' },
password: { from_secret: 'matrix_password' }, password: { from_secret: 'matrix_password' },
}, },

View File

@ -1,329 +1,369 @@
--- ---
kind: pipeline kind: pipeline
name: test name: test
platform: platform:
arch: amd64
os: linux os: linux
arch: amd64
steps: steps:
- commands: - name: lint
- shellcheck ./wait-for image: koalaman/shellcheck-alpine:stable
image: koalaman/shellcheck-alpine:stable commands:
name: lint - shellcheck ./wait-for
- commands:
- bats ./wait-for.bats - name: test
image: bats/bats image: bats/bats
name: test commands:
- bats ./wait-for.bats
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/tags/** - refs/tags/**
- refs/pull/** - refs/pull/**
--- ---
depends_on:
- test
kind: pipeline kind: pipeline
name: build-package name: build-package
platform: platform:
arch: amd64
os: linux os: linux
arch: amd64
steps: steps:
- commands: - name: checksum
- sha256sum wait-for > sha256sum.txt image: alpine
image: alpine commands:
name: checksum - sha256sum wait-for > sha256sum.txt
- commands:
- git fetch -tq - name: changelog-generate
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased image: thegeeklab/git-chglog
unreleased} commands:
image: thegeeklab/git-chglog - git fetch -tq
name: changelog-generate - git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
- commands:
- prettier CHANGELOG.md - name: changelog-format
- prettier -w CHANGELOG.md image: thegeeklab/alpine-tools
image: thegeeklab/alpine-tools commands:
name: changelog-format - prettier CHANGELOG.md
- image: plugins/github-release - prettier -w CHANGELOG.md
name: publish-github
settings: - name: publish-github
api_key: image: plugins/github-release
from_secret: github_token settings:
files: api_key:
- wait-for from_secret: github_token
- sha256sum.txt files:
note: CHANGELOG.md - wait-for
overwrite: true - sha256sum.txt
title: ${DRONE_TAG} note: CHANGELOG.md
when: overwrite: true
ref: title: ${DRONE_TAG}
- refs/tags/** when:
ref:
- refs/tags/**
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/tags/** - refs/tags/**
- refs/pull/** - refs/pull/**
---
depends_on: depends_on:
- test - test
---
kind: pipeline kind: pipeline
name: build-container-amd64 name: build-container-amd64
platform: platform:
arch: amd64
os: linux os: linux
arch: amd64
steps: steps:
- image: thegeeklab/drone-docker:19 - name: dryrun
name: dryrun image: thegeeklab/drone-docker:19
settings: settings:
dockerfile: docker/Dockerfile.amd64 dockerfile: docker/Dockerfile.amd64
dry_run: true dry_run: true
password: password:
from_secret: docker_password from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME} repo: thegeeklab/${DRONE_REPO_NAME}
username: username:
from_secret: docker_username from_secret: docker_username
when: when:
ref: ref:
- refs/pull/** - refs/pull/**
- image: thegeeklab/drone-docker:19
name: publish-dockerhub - name: publish-dockerhub
settings: image: thegeeklab/drone-docker:19
auto_tag: true settings:
auto_tag_suffix: amd64 auto_tag: true
dockerfile: docker/Dockerfile.amd64 auto_tag_suffix: amd64
password: dockerfile: docker/Dockerfile.amd64
from_secret: docker_password password:
repo: thegeeklab/${DRONE_REPO_NAME} from_secret: docker_password
username: repo: thegeeklab/${DRONE_REPO_NAME}
from_secret: docker_username username:
when: from_secret: docker_username
ref: when:
- refs/heads/main ref:
- refs/tags/** - refs/heads/main
- image: thegeeklab/drone-docker:19 - refs/tags/**
name: publish-quay
settings: - name: publish-quay
auto_tag: true image: thegeeklab/drone-docker:19
auto_tag_suffix: amd64 settings:
dockerfile: docker/Dockerfile.amd64 auto_tag: true
password: auto_tag_suffix: amd64
from_secret: quay_password dockerfile: docker/Dockerfile.amd64
registry: quay.io password:
repo: quay.io/thegeeklab/${DRONE_REPO_NAME} from_secret: quay_password
username: registry: quay.io
from_secret: quay_username repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
when: username:
ref: from_secret: quay_username
- refs/heads/main when:
- refs/tags/** ref:
- refs/heads/main
- refs/tags/**
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/tags/** - refs/tags/**
- refs/pull/** - refs/pull/**
---
depends_on: depends_on:
- test - test
---
kind: pipeline kind: pipeline
name: build-container-arm64 name: build-container-arm64
platform: platform:
arch: arm64
os: linux os: linux
arch: arm64
steps: steps:
- image: thegeeklab/drone-docker:19 - name: dryrun
name: dryrun image: thegeeklab/drone-docker:19
settings: settings:
dockerfile: docker/Dockerfile.arm64 dockerfile: docker/Dockerfile.arm64
dry_run: true dry_run: true
password: password:
from_secret: docker_password from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME} repo: thegeeklab/${DRONE_REPO_NAME}
username: username:
from_secret: docker_username from_secret: docker_username
when: when:
ref: ref:
- refs/pull/** - refs/pull/**
- image: thegeeklab/drone-docker:19
name: publish-dockerhub - name: publish-dockerhub
settings: image: thegeeklab/drone-docker:19
auto_tag: true settings:
auto_tag_suffix: arm64 auto_tag: true
dockerfile: docker/Dockerfile.arm64 auto_tag_suffix: arm64
password: dockerfile: docker/Dockerfile.arm64
from_secret: docker_password password:
repo: thegeeklab/${DRONE_REPO_NAME} from_secret: docker_password
username: repo: thegeeklab/${DRONE_REPO_NAME}
from_secret: docker_username username:
when: from_secret: docker_username
ref: when:
- refs/heads/main ref:
- refs/tags/** - refs/heads/main
- image: thegeeklab/drone-docker:19 - refs/tags/**
name: publish-quay
settings: - name: publish-quay
auto_tag: true image: thegeeklab/drone-docker:19
auto_tag_suffix: arm64 settings:
dockerfile: docker/Dockerfile.arm64 auto_tag: true
password: auto_tag_suffix: arm64
from_secret: quay_password dockerfile: docker/Dockerfile.arm64
registry: quay.io password:
repo: quay.io/thegeeklab/${DRONE_REPO_NAME} from_secret: quay_password
username: registry: quay.io
from_secret: quay_username repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
when: username:
ref: from_secret: quay_username
- refs/heads/main when:
- refs/tags/** ref:
- refs/heads/main
- refs/tags/**
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/tags/** - refs/tags/**
- refs/pull/** - refs/pull/**
---
depends_on: depends_on:
- test - test
---
kind: pipeline kind: pipeline
name: build-container-arm name: build-container-arm
platform: platform:
arch: arm
os: linux os: linux
arch: arm
steps: steps:
- image: thegeeklab/drone-docker:19 - name: dryrun
name: dryrun image: thegeeklab/drone-docker:19
settings: settings:
dockerfile: docker/Dockerfile.arm dockerfile: docker/Dockerfile.arm
dry_run: true dry_run: true
password: password:
from_secret: docker_password from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME} repo: thegeeklab/${DRONE_REPO_NAME}
username: username:
from_secret: docker_username from_secret: docker_username
when: when:
ref: ref:
- refs/pull/** - refs/pull/**
- image: thegeeklab/drone-docker:19
name: publish-dockerhub - name: publish-dockerhub
settings: image: thegeeklab/drone-docker:19
auto_tag: true settings:
auto_tag_suffix: arm auto_tag: true
dockerfile: docker/Dockerfile.arm auto_tag_suffix: arm
password: dockerfile: docker/Dockerfile.arm
from_secret: docker_password password:
repo: thegeeklab/${DRONE_REPO_NAME} from_secret: docker_password
username: repo: thegeeklab/${DRONE_REPO_NAME}
from_secret: docker_username username:
when: from_secret: docker_username
ref: when:
- refs/heads/main ref:
- refs/tags/** - refs/heads/main
- image: thegeeklab/drone-docker:19 - refs/tags/**
name: publish-quay
settings: - name: publish-quay
auto_tag: true image: thegeeklab/drone-docker:19
auto_tag_suffix: arm settings:
dockerfile: docker/Dockerfile.arm auto_tag: true
password: auto_tag_suffix: arm
from_secret: quay_password dockerfile: docker/Dockerfile.arm
registry: quay.io password:
repo: quay.io/thegeeklab/${DRONE_REPO_NAME} from_secret: quay_password
username: registry: quay.io
from_secret: quay_username repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
when: username:
ref: from_secret: quay_username
- refs/heads/main when:
- refs/tags/** ref:
- refs/heads/main
- refs/tags/**
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/tags/** - refs/tags/**
- refs/pull/** - refs/pull/**
---
depends_on: depends_on:
- build-container-amd64 - test
- build-container-arm
- build-container-arm64 ---
kind: pipeline kind: pipeline
name: notifications name: notifications
platform: platform:
arch: amd64
os: linux os: linux
arch: amd64
steps: steps:
- image: plugins/manifest - name: manifest-dockerhub
name: manifest-dockerhub image: plugins/manifest
settings: settings:
auto_tag: true auto_tag: true
ignore_missing: true ignore_missing: true
password: password:
from_secret: docker_password from_secret: docker_password
spec: docker/manifest.tmpl spec: docker/manifest.tmpl
username: username:
from_secret: docker_username from_secret: docker_username
when: when:
status: status:
- success - success
- image: plugins/manifest
name: manifest-quay - name: manifest-quay
settings: image: plugins/manifest
auto_tag: true settings:
ignore_missing: true auto_tag: true
password: ignore_missing: true
from_secret: quay_password password:
spec: docker/manifest-quay.tmpl from_secret: quay_password
username: spec: docker/manifest-quay.tmpl
from_secret: quay_username username:
when: from_secret: quay_username
status: when:
- success status:
- environment: - success
DOCKER_PASS:
from_secret: docker_password - name: pushrm-dockerhub
DOCKER_USER: pull: always
from_secret: docker_username image: chko/docker-pushrm:1
PUSHRM_FILE: README.md environment:
PUSHRM_SHORT: Poor-mans docker service synchronizer DOCKER_PASS:
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME} from_secret: docker_password
image: chko/docker-pushrm:1 DOCKER_USER:
name: pushrm-dockerhub from_secret: docker_username
pull: always PUSHRM_FILE: README.md
when: PUSHRM_SHORT: Poor-mans docker service synchronizer
status: PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
- success when:
- environment: status:
APIKEY__QUAY_IO: - success
from_secret: quay_token
PUSHRM_FILE: README.md - name: pushrm-quay
PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME} pull: always
image: chko/docker-pushrm:1 image: chko/docker-pushrm:1
name: pushrm-quay environment:
pull: always APIKEY__QUAY_IO:
when: from_secret: quay_token
status: PUSHRM_FILE: README.md
- success PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME}
- image: plugins/matrix when:
name: matrix status:
settings: - success
homeserver:
from_secret: matrix_homeserver - name: matrix
password: image: thegeeklab/drone-matrix
from_secret: matrix_password settings:
roomid: homeserver:
from_secret: matrix_roomid from_secret: matrix_homeserver
template: 'Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name password:
}}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: from_secret: matrix_password
{{ build.message }}' roomid:
username: from_secret: matrix_roomid
from_secret: matrix_username template: "Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}) ({{ build.Branch }}) by {{ commit.Author }}<br/> Message: {{ commit.Message }}"
when: username:
status: from_secret: matrix_username
- success when:
- failure status:
- success
- failure
trigger: trigger:
ref: ref:
- refs/heads/main - refs/heads/main
- refs/tags/** - refs/tags/**
status: status:
- success - success
- failure - failure
depends_on:
- build-container-amd64
- build-container-arm
- build-container-arm64
--- ---
kind: signature kind: signature
hmac: 6fbd749273f067a96f12909fd22d46b28fa32bf61a13000ecd04a760f628140d hmac: 143f9d09d77fa20b876a15ac9c120f81c80c7b27aefe9cab7e8e0f92760638a6
... ...