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

Docker build dont ignore ci env vars #2238

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
14 changes: 14 additions & 0 deletions .woodpecker/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ steps:
dockerfile: docker/Dockerfile.agent.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
build_args: CI_COMMIT_SHA
6543 marked this conversation as resolved.
Show resolved Hide resolved
when:
event: pull_request

Expand All @@ -213,6 +214,7 @@ steps:
platforms: *platforms_release
tag: [next, "next-${CI_COMMIT_SHA:0:10}"]
logins: *publish_logins
build_args: CI_COMMIT_SHA
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
Expand All @@ -226,6 +228,7 @@ steps:
platforms: *platforms_alpine
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"]
logins: *publish_logins
build_args: CI_COMMIT_SHA
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
Expand All @@ -239,6 +242,7 @@ steps:
platforms: *platforms_release
tag: ${CI_COMMIT_BRANCH##release/}
logins: *publish_logins
build_args: CI_COMMIT_SHA,CI_COMMIT_BRANCH
when:
branch: release/*
event: push
Expand All @@ -252,6 +256,7 @@ steps:
platforms: *platforms_alpine
tag: ${CI_COMMIT_BRANCH##release/}
logins: *publish_logins
build_args: CI_COMMIT_SHA,CI_COMMIT_BRANCH
when:
branch: release/*
event: push
Expand All @@ -266,6 +271,7 @@ steps:
# remove 'latest' on older version branches to avoid accidental downgrade
tag: [latest, "${CI_COMMIT_TAG}"]
logins: *publish_logins
build_args: CI_COMMIT_SHA,CI_COMMIT_TAG
when:
event: tag

Expand All @@ -279,6 +285,7 @@ steps:
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
logins: *publish_logins
build_args: CI_COMMIT_SHA,CI_COMMIT_TAG
when:
event: tag

Expand All @@ -295,6 +302,7 @@ steps:
dockerfile: docker/Dockerfile.cli.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
build_args: CI_COMMIT_SHA
when:
event: pull_request

Expand All @@ -307,6 +315,7 @@ steps:
platforms: *platforms_release
tag: [next, "next-${CI_COMMIT_SHA:0:10}"]
logins: *publish_logins
build_args: CI_COMMIT_SHA
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
Expand All @@ -320,6 +329,7 @@ steps:
platforms: *platforms_alpine
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"]
logins: *publish_logins
build_args: CI_COMMIT_SHA
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
Expand All @@ -333,6 +343,7 @@ steps:
platforms: *platforms_release
tag: ${CI_COMMIT_BRANCH##release/}
logins: *publish_logins
build_args: CI_COMMIT_SHA,CI_COMMIT_BRANCH
when:
branch: release/*
event: push
Expand All @@ -346,6 +357,7 @@ steps:
platforms: *platforms_alpine
tag: ${CI_COMMIT_BRANCH##release/}
logins: *publish_logins
build_args: CI_COMMIT_SHA,CI_COMMIT_BRANCH
when:
branch: release/*
event: push
Expand All @@ -360,6 +372,7 @@ steps:
# remove 'latest' on older version branches to avoid accidental downgrade
tag: [latest, "${CI_COMMIT_TAG}"]
logins: *publish_logins
build_args: CI_COMMIT_SHA,CI_COMMIT_TAG
when:
event: tag

Expand All @@ -373,5 +386,6 @@ steps:
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
logins: *publish_logins
build_args: CI_COMMIT_SHA,CI_COMMIT_TAG
when:
event: tag
2 changes: 1 addition & 1 deletion docker/Dockerfile.agent.alpine.multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20 AS build

WORKDIR /src
COPY . .
ARG TARGETOS TARGETARCH
ARG TARGETOS TARGETARCH CI_COMMIT_SHA CI_COMMIT_TAG CI_COMMIT_BRANCH
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
make build-agent
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.agent.multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20 AS build

WORKDIR /src
COPY . .
ARG TARGETOS TARGETARCH
ARG TARGETOS TARGETARCH CI_COMMIT_SHA CI_COMMIT_TAG CI_COMMIT_BRANCH
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
make build-agent
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.cli.alpine.multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20 AS build

WORKDIR /src
COPY . .
ARG TARGETOS TARGETARCH
ARG TARGETOS TARGETARCH CI_COMMIT_SHA CI_COMMIT_TAG CI_COMMIT_BRANCH
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
make build-cli
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.cli.multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20 AS build

WORKDIR /src
COPY . .
ARG TARGETOS TARGETARCH
ARG TARGETOS TARGETARCH CI_COMMIT_SHA CI_COMMIT_TAG CI_COMMIT_BRANCH
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
make build-cli
Expand Down