From bb7e0f9221728668138648c68d7138844b37865b Mon Sep 17 00:00:00 2001 From: Patrick Schratz Date: Fri, 20 Oct 2023 11:27:30 +0200 Subject: [PATCH] Only publish PR images when label is set (#2608) --- .woodpecker/docker.yml | 62 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/.woodpecker/docker.yml b/.woodpecker/docker.yml index 6a5c6531c..15fb27414 100644 --- a/.woodpecker/docker.yml +++ b/.woodpecker/docker.yml @@ -80,7 +80,7 @@ steps: platforms: *platforms_preview tag: pull_${CI_COMMIT_PULL_REQUEST} when: - event: pull_request + evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"' publish-server-alpine-preview: image: woodpeckerci/plugin-docker-buildx:2.1.0 @@ -92,7 +92,33 @@ steps: platforms: *platforms_preview tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine when: - event: pull_request + evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"' + + publish-server-preview-dry: + image: woodpeckerci/plugin-docker-buildx:2.1.0 + secrets: [ docker_username, docker_password ] + group: docker + settings: + dry_run: true + repo: woodpeckerci/woodpecker-server + dockerfile: docker/Dockerfile.server.multiarch + platforms: *platforms_preview + tag: pull_${CI_COMMIT_PULL_REQUEST} + when: + evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")' + + publish-server-alpine-preview-dry: + image: woodpeckerci/plugin-docker-buildx:2.1.0 + secrets: [ docker_username, docker_password ] + group: docker + settings: + dry_run: true + repo: woodpeckerci/woodpecker-server + dockerfile: docker/Dockerfile.server.alpine.multiarch + platforms: *platforms_preview + tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine + when: + evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")' cross-compile-server: image: *xgo_image @@ -204,7 +230,21 @@ steps: tag: pull_${CI_COMMIT_PULL_REQUEST} build_args: *build_args when: - event: pull_request + evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"' + + publish-agent-preview-dry: + group: docker + image: woodpeckerci/plugin-docker-buildx:2.1.0 + secrets: [ docker_username, docker_password ] + settings: + dry_run: true + repo: woodpeckerci/woodpecker-agent + dockerfile: docker/Dockerfile.agent.multiarch + platforms: *platforms_preview + tag: pull_${CI_COMMIT_PULL_REQUEST} + build_args: *build_args + when: + evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")' publish-next-agent: group: docker @@ -305,7 +345,21 @@ steps: tag: pull_${CI_COMMIT_PULL_REQUEST} build_args: *build_args when: - event: pull_request + evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"' + + publish-cli-preview-dry: + group: docker + image: woodpeckerci/plugin-docker-buildx:2.1.0 + secrets: [ docker_username, docker_password ] + settings: + dry_run: true + repo: woodpeckerci/woodpecker-cli + dockerfile: docker/Dockerfile.cli.multiarch + platforms: *platforms_preview + tag: pull_${CI_COMMIT_PULL_REQUEST} + build_args: *build_args + when: + evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")' publish-next-cli: group: docker