0
0
mirror of https://github.com/thegeeklab/retry.git synced 2024-11-27 01:10:36 +00:00

ci: migrate from drone to woodpecker (#23)

This commit is contained in:
Robert Kaussow 2023-07-25 22:32:49 +02:00 committed by GitHub
parent 8fccfdda3b
commit 89ac52364a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 156 additions and 228 deletions

View File

@ -1,225 +0,0 @@
---
kind: pipeline
name: test
platform:
os: linux
arch: amd64
steps:
- name: lint
image: koalaman/shellcheck-alpine:stable
commands:
- shellcheck ./retry
- name: test
image: bats/bats
commands:
- bats ./retry.bats
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
---
kind: pipeline
name: build-package
platform:
os: linux
arch: amd64
steps:
- name: checksum
image: alpine
commands:
- sha256sum retry > sha256sum.txt
- name: changelog-generate
image: thegeeklab/git-chglog
commands:
- git fetch -tq
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
- name: changelog-format
image: thegeeklab/alpine-tools
commands:
- prettier CHANGELOG.md
- prettier -w CHANGELOG.md
- name: publish-github
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- retry
- sha256sum.txt
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: build-container
platform:
os: linux
arch: amd64
steps:
- name: dryrun
image: thegeeklab/drone-docker-buildx:23
settings:
dockerfile: Dockerfile.multiarch
dry_run: true
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
repo: thegeeklab/${DRONE_REPO_NAME}
when:
ref:
- refs/pull/**
- name: publish-dockerhub
image: thegeeklab/drone-docker-buildx:23
settings:
auto_tag: true
dockerfile: Dockerfile.multiarch
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: publish-quay
image: thegeeklab/drone-docker-buildx:23
settings:
auto_tag: true
dockerfile: Dockerfile.multiarch
password:
from_secret: quay_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
steps:
- name: pushrm-dockerhub
pull: always
image: chko/docker-pushrm:1
environment:
DOCKER_PASS:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
PUSHRM_FILE: README.md
PUSHRM_SHORT: Poor-mans docker service synchronizer
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: pushrm-quay
pull: always
image: chko/docker-pushrm:1
environment:
APIKEY__QUAY_IO:
from_secret: quay_token
PUSHRM_FILE: README.md
PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: matrix
image: thegeeklab/drone-matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
template: "Status: **{{ .Build.Status }}**<br/> Build: [{{ .Repo.Owner }}/{{ .Repo.Name }}]({{ .Build.Link }}){{ if .Build.Branch }} ({{ .Build.Branch }}){{ end }} by {{ .Commit.Author }}<br/> Message: {{ .Commit.Message.Title }}"
username:
from_secret: matrix_username
when:
status:
- success
- failure
trigger:
ref:
- refs/heads/main
- refs/tags/**
status:
- success
- failure
depends_on:
- build-container
---
kind: signature
hmac: 50ff052940d66ca2f64357dfa44c2bebde42c4a9991076991f292258c26fa154
...

View File

@ -50,7 +50,9 @@ branches:
required_status_checks:
strict: false
contexts:
- continuous-integration/drone/pr
- ci/woodpecker/pr/test
- ci/woodpecker/pr/binary
- ci/woodpecker/pr/container
enforce_admins: true
required_linear_history: true
restrictions: null

View File

@ -1,3 +1,2 @@
.drone.yml
*.tpl.md
LICENSE

67
.woodpecker/container.yml Normal file
View File

@ -0,0 +1,67 @@
---
when:
- ref: refs/heads/${CI_REPO_DEFAULT_BRANCH}
- ref: refs/tags/**
- ref: refs/pull/**
steps:
dryrun:
image: quay.io/thegeeklab/drone-docker-buildx:23
settings:
dockerfile: Dockerfile.multiarch
dry_run: true
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
repo: thegeeklab/${CI_REPO_NAME}
when:
- ref: refs/pull/**
publish-dockerhub:
group: build
image: quay.io/thegeeklab/drone-docker-buildx:23
settings:
auto_tag: true
dockerfile: Dockerfile.multiarch
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
repo: thegeeklab/${CI_REPO_NAME}
username:
from_secret: docker_username
when:
- ref: refs/heads/main
- ref: refs/tags/**
publish-quay:
group: build
image: quay.io/thegeeklab/drone-docker-buildx:23
settings:
auto_tag: true
dockerfile: Dockerfile.multiarch
password:
from_secret: quay_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
provenance: false
registry: quay.io
repo: quay.io/thegeeklab/${CI_REPO_NAME}
username:
from_secret: quay_username
when:
- ref: refs/heads/main
- ref: refs/tags/**
depends_on:
- test

27
.woodpecker/notify.yml Normal file
View File

@ -0,0 +1,27 @@
---
when:
- ref: refs/heads/${CI_REPO_DEFAULT_BRANCH}
- ref: refs/tags/**
steps:
matrix:
image: quay.io/thegeeklab/drone-matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
template: "Status: **{{ .Build.Status }}**<br/> Build: [{{ .Repo.Owner }}/{{ .Repo.Name }}]({{ .Build.Link }}){{ if .Build.Branch }} ({{ .Build.Branch }}){{ end }} by {{ .Commit.Author }}<br/> Message: {{ .Commit.Message.Title }}"
username:
from_secret: matrix_username
when:
- status:
- success
- failure
depends_on:
- test
- container
- release

40
.woodpecker/release.yml Normal file
View File

@ -0,0 +1,40 @@
---
when:
- ref: refs/heads/${CI_REPO_DEFAULT_BRANCH}
- ref: refs/tags/**
- ref: refs/pull/**
steps:
checksum:
image: docker.io/alpine
commands:
- sha256sum retry > sha256sum.txt
changelog-generate:
image: quay.io/thegeeklab/git-chglog
commands:
- git fetch -tq
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${CI_COMMIT_TAG:---next-tag unreleased unreleased}
changelog-format:
image: quay.io/thegeeklab/alpine-tools
commands:
- prettier CHANGELOG.md
- prettier -w CHANGELOG.md
publish-github:
image: docker.io/plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- retry
- sha256sum.txt
note: CHANGELOG.md
overwrite: true
title: ${CI_COMMIT_TAG}
when:
- ref: refs/tags/**
depends_on:
- test

18
.woodpecker/test.yml Normal file
View File

@ -0,0 +1,18 @@
---
when:
- ref: refs/heads/${CI_REPO_DEFAULT_BRANCH}
- ref: refs/tags/**
- ref: refs/pull/**
steps:
lint:
group: test
image: docker.io/koalaman/shellcheck-alpine:stable
commands:
- shellcheck ./retry
test:
group: test
image: docker.io/bats/bats
commands:
- bats ./retry.bats

View File

@ -2,7 +2,7 @@
Poor-mans servie synchronizer
[![Build Status](https://img.shields.io/drone/build/thegeeklab/retry?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/retry)
[![Build Status](https://ci.thegeeklab.de/api/badges/4/status.svg)](https://ci.thegeeklab.de/4)
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/retry)
[![Quay.io](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white)](https://quay.io/repository/thegeeklab/retry)
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/retry)](https://github.com/thegeeklab/retry/graphs/contributors)