Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker credentials #2598

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions .woodpecker/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ when:
- ${CI_REPO_DEFAULT_BRANCH}
- release/*

depends_on:
- test
- web
# depends_on:
# - test
# - web

variables:
- &golang_image 'golang:1.21.3'
Expand All @@ -24,14 +24,12 @@ variables:
- publish_logins: &publish_logins
# Default DockerHub login
- registry: https://index.docker.io/v1/
username:
from_secret: docker_username
username: woodpeckerbot
password:
from_secret: docker_password
# Additional Quay.IO login
- registry: https://quay.io
username:
from_secret: QUAY_IO_USER
username: 'woodpeckerci+wp_ci'
password:
from_secret: QUAY_IO_TOKEN
- &publish_repos_server 'woodpeckerci/woodpecker-server,quay.io/woodpeckerci/woodpecker-server'
Expand Down Expand Up @@ -79,6 +77,8 @@ steps:
dockerfile: docker/Dockerfile.server.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
logins: *publish_logins
dry_run: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this still run to publish test images of prs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure if we should even publish them. It sometimes is a nice way to test it, but on the other hand its also a lot of spam and therefore rarely used. IMO developers with a IDE can also build the image on their own if really needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second that. It's convenient though for some non-expert people which don't want to clone and push a PR image.

Maybe it could be somehow conditioned on a PR label? There is CI_COMMIT_PULL_REQUEST_LABELS and we could add a "when" condition to the step.

when:
event: pull_request

Expand All @@ -91,6 +91,8 @@ steps:
dockerfile: docker/Dockerfile.server.alpine.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine
logins: *publish_logins
dry_run: true
when:
event: pull_request

Expand Down Expand Up @@ -196,13 +198,14 @@ steps:
publish-agent-preview:
group: docker
image: woodpeckerci/plugin-docker-buildx:2.1.0
secrets: [ docker_username, docker_password ]
settings:
repo: woodpeckerci/woodpecker-agent
dockerfile: docker/Dockerfile.agent.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
build_args: *build_args
logins: *publish_logins
dry_run: true
when:
event: pull_request

Expand Down Expand Up @@ -297,13 +300,14 @@ steps:
publish-cli-preview:
group: docker
image: woodpeckerci/plugin-docker-buildx:2.1.0
secrets: [ docker_username, docker_password ]
settings:
repo: woodpeckerci/woodpecker-cli
dockerfile: docker/Dockerfile.cli.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
build_args: *build_args
logins: *publish_logins
dry_run: true
when:
event: pull_request

Expand Down