mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-05 07:08:41 +00:00
parent
f337d31455
commit
db34d3f39a
5 changed files with 19 additions and 4 deletions
|
@ -18,6 +18,7 @@ variables:
|
||||||
- &platforms_server 'linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le,linux/riscv64'
|
- &platforms_server 'linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le,linux/riscv64'
|
||||||
- &platforms_preview 'linux/amd64'
|
- &platforms_preview 'linux/amd64'
|
||||||
- &platforms_alpine 'linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le'
|
- &platforms_alpine 'linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le'
|
||||||
|
- &build_args 'CI_COMMIT_SHA=${CI_COMMIT_SHA},CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH},CI_COMMIT_TAG=${CI_COMMIT_TAG}'
|
||||||
|
|
||||||
# vars used on push / tag events only
|
# vars used on push / tag events only
|
||||||
- publish_logins: &publish_logins
|
- publish_logins: &publish_logins
|
||||||
|
@ -201,6 +202,7 @@ steps:
|
||||||
dockerfile: docker/Dockerfile.agent.multiarch
|
dockerfile: docker/Dockerfile.agent.multiarch
|
||||||
platforms: *platforms_preview
|
platforms: *platforms_preview
|
||||||
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
event: pull_request
|
event: pull_request
|
||||||
|
|
||||||
|
@ -213,6 +215,7 @@ steps:
|
||||||
platforms: *platforms_release
|
platforms: *platforms_release
|
||||||
tag: [next, "next-${CI_COMMIT_SHA:0:10}"]
|
tag: [next, "next-${CI_COMMIT_SHA:0:10}"]
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
event: push
|
event: push
|
||||||
|
@ -226,6 +229,7 @@ steps:
|
||||||
platforms: *platforms_alpine
|
platforms: *platforms_alpine
|
||||||
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"]
|
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"]
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
event: push
|
event: push
|
||||||
|
@ -239,6 +243,7 @@ steps:
|
||||||
platforms: *platforms_release
|
platforms: *platforms_release
|
||||||
tag: ${CI_COMMIT_BRANCH##release/}
|
tag: ${CI_COMMIT_BRANCH##release/}
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
branch: release/*
|
branch: release/*
|
||||||
event: push
|
event: push
|
||||||
|
@ -252,6 +257,7 @@ steps:
|
||||||
platforms: *platforms_alpine
|
platforms: *platforms_alpine
|
||||||
tag: ${CI_COMMIT_BRANCH##release/}
|
tag: ${CI_COMMIT_BRANCH##release/}
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
branch: release/*
|
branch: release/*
|
||||||
event: push
|
event: push
|
||||||
|
@ -266,6 +272,7 @@ steps:
|
||||||
# remove 'latest' on older version branches to avoid accidental downgrade
|
# remove 'latest' on older version branches to avoid accidental downgrade
|
||||||
tag: [latest, "${CI_COMMIT_TAG}"]
|
tag: [latest, "${CI_COMMIT_TAG}"]
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
|
||||||
|
@ -279,6 +286,7 @@ steps:
|
||||||
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
|
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
|
||||||
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
|
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
|
||||||
|
@ -295,6 +303,7 @@ steps:
|
||||||
dockerfile: docker/Dockerfile.cli.multiarch
|
dockerfile: docker/Dockerfile.cli.multiarch
|
||||||
platforms: *platforms_preview
|
platforms: *platforms_preview
|
||||||
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
event: pull_request
|
event: pull_request
|
||||||
|
|
||||||
|
@ -307,6 +316,7 @@ steps:
|
||||||
platforms: *platforms_release
|
platforms: *platforms_release
|
||||||
tag: [next, "next-${CI_COMMIT_SHA:0:10}"]
|
tag: [next, "next-${CI_COMMIT_SHA:0:10}"]
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
event: push
|
event: push
|
||||||
|
@ -320,6 +330,7 @@ steps:
|
||||||
platforms: *platforms_alpine
|
platforms: *platforms_alpine
|
||||||
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"]
|
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"]
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
event: push
|
event: push
|
||||||
|
@ -333,6 +344,7 @@ steps:
|
||||||
platforms: *platforms_release
|
platforms: *platforms_release
|
||||||
tag: ${CI_COMMIT_BRANCH##release/}
|
tag: ${CI_COMMIT_BRANCH##release/}
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
branch: release/*
|
branch: release/*
|
||||||
event: push
|
event: push
|
||||||
|
@ -346,6 +358,7 @@ steps:
|
||||||
platforms: *platforms_alpine
|
platforms: *platforms_alpine
|
||||||
tag: ${CI_COMMIT_BRANCH##release/}
|
tag: ${CI_COMMIT_BRANCH##release/}
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
branch: release/*
|
branch: release/*
|
||||||
event: push
|
event: push
|
||||||
|
@ -360,6 +373,7 @@ steps:
|
||||||
# remove 'latest' on older version branches to avoid accidental downgrade
|
# remove 'latest' on older version branches to avoid accidental downgrade
|
||||||
tag: [latest, "${CI_COMMIT_TAG}"]
|
tag: [latest, "${CI_COMMIT_TAG}"]
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
|
||||||
|
@ -373,5 +387,6 @@ steps:
|
||||||
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
|
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
|
||||||
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
|
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
|
build_args: *build_args
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
|
|
@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20 AS build
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
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 \
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
--mount=type=cache,target=/go/pkg \
|
--mount=type=cache,target=/go/pkg \
|
||||||
make build-agent
|
make build-agent
|
||||||
|
|
|
@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20 AS build
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
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 \
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
--mount=type=cache,target=/go/pkg \
|
--mount=type=cache,target=/go/pkg \
|
||||||
make build-agent
|
make build-agent
|
||||||
|
|
|
@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20 AS build
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
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 \
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
--mount=type=cache,target=/go/pkg \
|
--mount=type=cache,target=/go/pkg \
|
||||||
make build-cli
|
make build-cli
|
||||||
|
|
|
@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20 AS build
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
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 \
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
--mount=type=cache,target=/go/pkg \
|
--mount=type=cache,target=/go/pkg \
|
||||||
make build-cli
|
make build-cli
|
||||||
|
|
Loading…
Reference in a new issue