Woodpecker CI: Unify Docker image workflows
This commit is contained in:
parent
dd29b9c11b
commit
89a78d765c
5 changed files with 100 additions and 133 deletions
65
.woodpecker/docker-combine.yaml
Normal file
65
.woodpecker/docker-combine.yaml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
path: [ "*.ex", "*.eex", "*.exs", "mix.lock", ".woodpecker/**" ]
|
||||||
|
- event: push
|
||||||
|
branch: stable
|
||||||
|
path: [ "*.ex", "*.eex", "*.exs", "mix.lock", ".woodpecker/**" ]
|
||||||
|
- event: tag
|
||||||
|
branch: stable
|
||||||
|
- event: manual
|
||||||
|
branch: stable
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
skip_clone: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
docker-develop-combine:
|
||||||
|
image: git.fluffytail.org/phnt/wpc-docker-tagger:latest
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
settings:
|
||||||
|
registry: "git.pleroma.social"
|
||||||
|
image: "pleroma/pleroma"
|
||||||
|
architectures: [amd64, arm64]
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- develop
|
||||||
|
- ${CI_COMMIT_SHA}
|
||||||
|
username:
|
||||||
|
from_secret: pleroma-ci-user
|
||||||
|
password:
|
||||||
|
from_secret: pleroma-ci-password
|
||||||
|
|
||||||
|
docker-stable-combine:
|
||||||
|
image: git.fluffytail.org/phnt/wpc-docker-tagger:latest
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: stable
|
||||||
|
- evaluate: 'CI_PIPELINE_EVENT == "manual" && CI_COMMIT_BRANCH == "stable" && CI_COMMIT_TAG == ""'
|
||||||
|
settings: &docker_settings
|
||||||
|
registry: "git.pleroma.social"
|
||||||
|
image: "pleroma/pleroma"
|
||||||
|
architectures: [amd64, arm64]
|
||||||
|
tags: &docker_tags
|
||||||
|
- latest
|
||||||
|
- stable
|
||||||
|
- ${CI_COMMIT_SHA}
|
||||||
|
username:
|
||||||
|
from_secret: pleroma-ci-user
|
||||||
|
password:
|
||||||
|
from_secret: pleroma-ci-password
|
||||||
|
|
||||||
|
docker-stable-tag-combine:
|
||||||
|
image: git.fluffytail.org/phnt/wpc-docker-tagger:latest
|
||||||
|
when:
|
||||||
|
- event: tag
|
||||||
|
- evaluate: 'CI_PIPELINE_EVENT == "manual" && CI_COMMIT_BRANCH == "stable" && CI_COMMIT_TAG != ""'
|
||||||
|
settings:
|
||||||
|
<<: *docker_settings
|
||||||
|
tags:
|
||||||
|
- <<: *docker_tags
|
||||||
|
- ${CI_COMMIT_TAG}
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
path: [ "*.ex", "*.eex", "*.exs", "mix.lock", ".woodpecker/**" ]
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- docker-develop
|
|
||||||
|
|
||||||
skip_clone: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
docker-develop-combine:
|
|
||||||
image: git.fluffytail.org/phnt/wpc-docker-tagger:latest
|
|
||||||
settings:
|
|
||||||
registry: "git.fluffytail.org"
|
|
||||||
image: "pleroma-test/pleroma"
|
|
||||||
architectures: [amd64, arm64]
|
|
||||||
tags:
|
|
||||||
- latest
|
|
||||||
- develop
|
|
||||||
- ${CI_COMMIT_SHA}
|
|
||||||
username:
|
|
||||||
from_secret: pleroma-ci-user
|
|
||||||
password:
|
|
||||||
from_secret: pleroma-ci-password
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
path: [ "*.ex", "*.eex", "*.exs", "mix.lock", ".woodpecker/**" ]
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
platform:
|
|
||||||
- linux/amd64
|
|
||||||
- linux/arm64
|
|
||||||
|
|
||||||
# This is needed for the when clauses below.
|
|
||||||
# When the platform clause is fixed, this might not be needed anymore
|
|
||||||
labels:
|
|
||||||
platform: ${platform}
|
|
||||||
|
|
||||||
variables:
|
|
||||||
docker_variables: &docker_variables
|
|
||||||
repo: pleroma/pleroma
|
|
||||||
registry: git.pleroma.social
|
|
||||||
username:
|
|
||||||
from_secret: pleroma-ci-user
|
|
||||||
password:
|
|
||||||
from_secret: pleroma-ci-password
|
|
||||||
|
|
||||||
steps:
|
|
||||||
docker-develop-amd64:
|
|
||||||
image: woodpeckerci/plugin-kaniko:2.3.1
|
|
||||||
# when:
|
|
||||||
# - platform: linux/amd64
|
|
||||||
# does not work even though it should according to docs
|
|
||||||
# https://github.com/woodpecker-ci/woodpecker/discussions/5367#discussioncomment-13901342
|
|
||||||
when:
|
|
||||||
- evaluate: platform == "linux/amd64"
|
|
||||||
settings:
|
|
||||||
<<: *docker_variables
|
|
||||||
tags:
|
|
||||||
- latest-amd64
|
|
||||||
- develop-amd64
|
|
||||||
- ${CI_COMMIT_SHA}-amd64
|
|
||||||
|
|
||||||
docker-develop-arm64:
|
|
||||||
image: woodpeckerci/plugin-kaniko:2.3.1
|
|
||||||
when:
|
|
||||||
- evaluate: platform == "linux/arm64"
|
|
||||||
settings:
|
|
||||||
<<: *docker_variables
|
|
||||||
tags:
|
|
||||||
- latest-arm64
|
|
||||||
- develop-arm64
|
|
||||||
- ${CI_COMMIT_SHA}-arm64
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: stable
|
|
||||||
path: [ "*.ex", "*.eex", "*.exs", "mix.lock", ".woodpecker/**" ]
|
|
||||||
- event: tag
|
|
||||||
branch: stable
|
|
||||||
- event: manual
|
|
||||||
branch: stable
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- docker-stable
|
|
||||||
|
|
||||||
skip_clone: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
docker-stable-combine:
|
|
||||||
image: git.fluffytail.org/phnt/wpc-docker-tagger:latest
|
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
- evaluate: 'CI_PIPELINE_EVENT == "manual" && CI_COMMIT_TAG == ""'
|
|
||||||
settings: &docker_settings
|
|
||||||
registry: "git.fluffytail.org"
|
|
||||||
image: "pleroma-test/pleroma"
|
|
||||||
architectures: [amd64, arm64]
|
|
||||||
tags: &docker_tags
|
|
||||||
- latest
|
|
||||||
- stable
|
|
||||||
- ${CI_COMMIT_SHA}
|
|
||||||
username:
|
|
||||||
from_secret: pleroma-ci-user
|
|
||||||
password:
|
|
||||||
from_secret: pleroma-ci-password
|
|
||||||
|
|
||||||
docker-stable-tag-combine:
|
|
||||||
image: git.fluffytail.org/phnt/wpc-docker-tagger:latest
|
|
||||||
when:
|
|
||||||
- event: tag
|
|
||||||
- evaluate: 'CI_PIPELINE_EVENT == "manual" && CI_COMMIT_TAG != ""'
|
|
||||||
settings:
|
|
||||||
<<: *docker_settings
|
|
||||||
tags:
|
|
||||||
- <<: *docker_tags
|
|
||||||
- ${CI_COMMIT_TAG}
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
when:
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
path: [ "*.ex", "*.eex", "*.exs", "mix.lock", ".woodpecker/**" ]
|
||||||
- event: push
|
- event: push
|
||||||
branch: stable
|
branch: stable
|
||||||
path: [ "*.ex", "*.eex", "*.exs", "mix.lock", ".woodpecker/**" ]
|
path: [ "*.ex", "*.eex", "*.exs", "mix.lock", ".woodpecker/**" ]
|
||||||
|
|
@ -13,14 +16,13 @@ matrix:
|
||||||
- linux/arm64
|
- linux/arm64
|
||||||
|
|
||||||
# This is needed for the when clauses below.
|
# This is needed for the when clauses below.
|
||||||
# When the platform clause is fixed, this might not be needed anymore
|
|
||||||
labels:
|
labels:
|
||||||
platform: ${platform}
|
platform: ${platform}
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
docker_variables: &docker_variables
|
docker_variables: &docker_variables
|
||||||
repo: pleroma-test/pleroma
|
repo: pleroma/pleroma
|
||||||
registry: git.fluffytail.org
|
registry: git.pleroma.social
|
||||||
username:
|
username:
|
||||||
from_secret: pleroma-ci-user
|
from_secret: pleroma-ci-user
|
||||||
password:
|
password:
|
||||||
|
|
@ -28,15 +30,33 @@ variables:
|
||||||
kaniko_image: &kaniko_image woodpeckerci/plugin-kaniko:2.3.1
|
kaniko_image: &kaniko_image woodpeckerci/plugin-kaniko:2.3.1
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
docker-develop-amd64:
|
||||||
|
image: woodpeckerci/plugin-kaniko:2.3.1
|
||||||
|
when:
|
||||||
|
- evaluate: 'platform == "linux/amd64" && CI_COMMIT_BRANCH == "${CI_REPO_DEFAULT_BRANCH}"'
|
||||||
|
settings:
|
||||||
|
<<: *docker_variables
|
||||||
|
tags:
|
||||||
|
- latest-amd64
|
||||||
|
- develop-amd64
|
||||||
|
- ${CI_COMMIT_SHA}-amd64
|
||||||
|
|
||||||
|
docker-develop-arm64:
|
||||||
|
image: woodpeckerci/plugin-kaniko:2.3.1
|
||||||
|
when:
|
||||||
|
- evaluate: 'platform == "linux/arm64" && CI_COMMIT_BRANCH == "${CI_REPO_DEFAULT_BRANCH}"'
|
||||||
|
settings:
|
||||||
|
<<: *docker_variables
|
||||||
|
tags:
|
||||||
|
- latest-arm64
|
||||||
|
- develop-arm64
|
||||||
|
- ${CI_COMMIT_SHA}-arm64
|
||||||
|
|
||||||
docker-stable-amd64:
|
docker-stable-amd64:
|
||||||
image: *kaniko_image
|
image: *kaniko_image
|
||||||
# when:
|
|
||||||
# - platform: linux/amd64
|
|
||||||
# does not work even though it should according to docs
|
|
||||||
# https://github.com/woodpecker-ci/woodpecker/discussions/5367#discussioncomment-13901342
|
|
||||||
when:
|
when:
|
||||||
- evaluate: 'platform == "linux/amd64" && CI_PIPELINE_EVENT == "push"'
|
- evaluate: 'platform == "linux/amd64" && CI_PIPELINE_EVENT == "push" && CI_COMMIT_BRANCH == "stable"'
|
||||||
- evaluate: 'platform == "linux/amd64" && CI_PIPELINE_EVENT == "manual" && CI_COMMIT_TAG == ""'
|
- evaluate: 'platform == "linux/amd64" && CI_PIPELINE_EVENT == "manual" && CI_COMMIT_BRANCH == "stable" && CI_COMMIT_TAG == ""'
|
||||||
settings:
|
settings:
|
||||||
<<: *docker_variables
|
<<: *docker_variables
|
||||||
tags: &amd64_tags
|
tags: &amd64_tags
|
||||||
|
|
@ -47,8 +67,8 @@ steps:
|
||||||
docker-stable-tag-amd64:
|
docker-stable-tag-amd64:
|
||||||
image: *kaniko_image
|
image: *kaniko_image
|
||||||
when:
|
when:
|
||||||
- evaluate: 'platform == "linux/amd64" && CI_PIPELINE_EVENT == "tag"'
|
- evaluate: 'platform == "linux/amd64" && CI_PIPELINE_EVENT == "tag" && CI_COMMIT_BRANCH == "stable"'
|
||||||
- evaluate: 'platform == "linux/amd64" && CI_PIPELINE_EVENT == "manual" && CI_COMMIT_TAG != ""'
|
- evaluate: 'platform == "linux/amd64" && CI_PIPELINE_EVENT == "manual" && CI_COMMIT_BRANCH == "stable" && CI_COMMIT_TAG != ""'
|
||||||
settings:
|
settings:
|
||||||
<<: *docker_variables
|
<<: *docker_variables
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -58,8 +78,8 @@ steps:
|
||||||
docker-stable-arm64:
|
docker-stable-arm64:
|
||||||
image: *kaniko_image
|
image: *kaniko_image
|
||||||
when:
|
when:
|
||||||
- evaluate: 'platform == "linux/arm64" && CI_PIPELINE_EVENT == "push"'
|
- evaluate: 'platform == "linux/arm64" && CI_PIPELINE_EVENT == "push" && CI_COMMIT_BRANCH == "stable"'
|
||||||
- evaluate: 'platform == "linux/arm64" && CI_PIPELINE_EVENT == "manual" && CI_COMMIT_TAG == ""'
|
- evaluate: 'platform == "linux/arm64" && CI_PIPELINE_EVENT == "manual" && CI_COMMIT_BRANCH == "stable" && CI_COMMIT_TAG == ""'
|
||||||
settings:
|
settings:
|
||||||
<<: *docker_variables
|
<<: *docker_variables
|
||||||
tags: &arm64_tags
|
tags: &arm64_tags
|
||||||
|
|
@ -70,8 +90,8 @@ steps:
|
||||||
docker-stable-tag-arm64:
|
docker-stable-tag-arm64:
|
||||||
image: *kaniko_image
|
image: *kaniko_image
|
||||||
when:
|
when:
|
||||||
- evaluate: 'platform == "linux/arm64" && CI_PIPELINE_EVENT == "tag"'
|
- evaluate: 'platform == "linux/arm64" && CI_PIPELINE_EVENT == "tag" && CI_COMMIT_BRANCH == "stable"'
|
||||||
- evaluate: 'platform == "linux/arm64" && CI_PIPELINE_EVENT == "manual" && CI_COMMIT_TAG != ""'
|
- evaluate: 'platform == "linux/arm64" && CI_PIPELINE_EVENT == "manual" && CI_COMMIT_BRANCH == "stable" && CI_COMMIT_TAG != ""'
|
||||||
settings:
|
settings:
|
||||||
<<: *docker_variables
|
<<: *docker_variables
|
||||||
tags:
|
tags:
|
||||||
Loading…
Add table
Add a link
Reference in a new issue