File tree Expand file tree Collapse file tree 10 files changed +23
-14
lines changed Expand file tree Collapse file tree 10 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 9292 context : .
9393 file : ${{ matrix.dockerfile }}
9494 platforms : linux/amd64,linux/arm64
95+ build-args : |
96+ BUILD_VERSION=${{ env.PIPECD_VERSION }}
9597 tags : ${{ matrix.container_registry }}/${{ matrix.image }}:${{ env.PIPECD_VERSION }}
9698 # parameter to use inline cache. ref; https://docs.docker.com/build/ci/github-actions/cache/#inline-cache
9799 cache-from : type=registry,ref=${{ matrix.container_registry }}/${{ matrix.image }}:latest
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ run/pipecd: CONTROL_PLANE_VALUES ?= ./quickstart/control-plane-values.yaml
159159run/pipecd : PIPECD_VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]* .* ')
160160run/pipecd :
161161 @echo " Building docker image and pushing it to local registry..."
162- docker build -f cmd/pipecd/Dockerfile -t localhost:5001/pipecd:$(BUILD_VERSION ) --build-arg PIPECD_VERSION =$(PIPECD_VERSION ) .
162+ docker build -f cmd/pipecd/Dockerfile -t localhost:5001/pipecd:$(BUILD_VERSION ) --build-arg BUILD_VERSION =$(PIPECD_VERSION ) .
163163 docker push localhost:5001/pipecd:$(BUILD_VERSION )
164164
165165 @echo "Installing Control Plane in kind..."
190190endif
191191
192192.PHONY : run/web
193- run/web : PIPECD_VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]* .* ')
193+ run/web : BUILD_VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]* .* ')
194194run/web :
195- PIPECD_VERSION =$(PIPECD_VERSION ) yarn --cwd web dev
195+ BUILD_VERSION =$(BUILD_VERSION ) yarn --cwd web dev
196196
197197.PHONY : run/site
198198run/site :
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
33
44ARG TARGETOS
55ARG TARGETARCH
6+ ARG BUILD_VERSION
67
78WORKDIR /app
89
@@ -11,7 +12,7 @@ RUN go mod download
1112
1213COPY . ./
1314
14- RUN make build/go MOD=helloworld BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
15+ RUN make build/go MOD=helloworld BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}
1516
1617FROM alpine:3.21.3
1718
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
33
44ARG TARGETOS
55ARG TARGETARCH
6+ ARG BUILD_VERSION
67
78WORKDIR /app
89
@@ -11,7 +12,7 @@ RUN go mod download
1112
1213COPY . ./
1314
14- RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
15+ RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}
1516
1617# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/459025001?tag=v0.52.0-97-g3e3df6d
1718FROM ghcr.io/pipe-cd/piped-base@sha256:fc2bde38211a80ee0df6d90ed168c817f30a7d0dbe8a0aff872a93ffb7d40a66
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
33
44ARG TARGETOS
55ARG TARGETARCH
6+ ARG BUILD_VERSION
67
78WORKDIR /app
89
@@ -11,7 +12,7 @@ RUN go mod download
1112
1213COPY . ./
1314
14- RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
15+ RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}
1516
1617# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/460487531?tag=v0.52.0-102-g2f29597
1718FROM ghcr.io/pipe-cd/piped-base-okd@sha256:fc69a9d270e27e086381e8334885ea3d630db2e10fdd00d41759dc40d87fbafc
Original file line number Diff line number Diff line change 33# because this stage builds only web assets, we can use any platform
44FROM --platform=$BUILDPLATFORM node:20.19.0-alpine3.21 AS web
55
6- ARG PIPECD_VERSION
6+ ARG BUILD_VERSION
77
88WORKDIR /app
99
@@ -15,14 +15,14 @@ RUN yarn --cwd web install --prefer-offline
1515COPY .git ./.git
1616COPY web ./web
1717COPY Makefile .
18- RUN make build/web PIPECD_VERSION=${PIPECD_VERSION }
18+ RUN make build/web PIPECD_VERSION=${BUILD_VERSION} }
1919
2020# pipecd builder
2121FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
2222
2323ARG TARGETOS
2424ARG TARGETARCH
25- ARG PIPECD_VERSION
25+ ARG BUILD_VERSION
2626
2727WORKDIR /app
2828
@@ -33,7 +33,7 @@ COPY .git ./.git
3333COPY pkg/ ./pkg/
3434COPY cmd/ ./cmd/
3535COPY Makefile .
36- RUN make build/go MOD=pipecd BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${PIPECD_VERSION }
36+ RUN make build/go MOD=pipecd BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION }
3737
3838FROM alpine:3.21.3
3939
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
33
44ARG TARGETOS
55ARG TARGETARCH
6+ ARG BUILD_VERSION
67
78WORKDIR /app
89
@@ -11,7 +12,7 @@ RUN go mod download
1112
1213COPY . ./
1314
14- RUN make build/go MOD=pipectl BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
15+ RUN make build/go MOD=pipectl BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}
1516
1617FROM alpine:3.21.3
1718
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
33
44ARG TARGETOS
55ARG TARGETARCH
6+ ARG BUILD_VERSION
67
78WORKDIR /app
89
@@ -11,7 +12,7 @@ RUN go mod download
1112
1213COPY . ./
1314
14- RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
15+ RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}
1516
1617# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/459025001?tag=v0.52.0-97-g3e3df6d
1718FROM ghcr.io/pipe-cd/piped-base@sha256:fc2bde38211a80ee0df6d90ed168c817f30a7d0dbe8a0aff872a93ffb7d40a66
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
33
44ARG TARGETOS
55ARG TARGETARCH
6+ ARG BUILD_VERSION
67
78WORKDIR /app
89
@@ -11,7 +12,7 @@ RUN go mod download
1112
1213COPY . ./
1314
14- RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
15+ RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}
1516
1617# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/460487531?tag=v0.52.0-102-g2f29597
1718FROM ghcr.io/pipe-cd/piped-base-okd@sha256:fc69a9d270e27e086381e8334885ea3d630db2e10fdd00d41759dc40d87fbafc
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
33
44ARG TARGETOS
55ARG TARGETARCH
6+ ARG BUILD_VERSION
67
78WORKDIR /app
89
@@ -11,7 +12,7 @@ RUN go mod download
1112
1213COPY . ./
1314
14- RUN make build/go MOD=pipedv1 BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
15+ RUN make build/go MOD=pipedv1 BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}
1516
1617# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/459025001?tag=v0.52.0-97-g3e3df6d
1718FROM ghcr.io/pipe-cd/piped-base@sha256:fc2bde38211a80ee0df6d90ed168c817f30a7d0dbe8a0aff872a93ffb7d40a66
You can’t perform that action at this time.
0 commit comments