Skip to content
Open
Show file tree
Hide file tree
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
60 changes: 60 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

.DS_Store

# Binaries
.artifacts

# docs
docs

examples

# Go
/vendor

# nodejs
node_modules

# web
web/node_modules
web/dist
web/.env
web/.cache
web/coverage
pkg/app/web/.env

# IDE config files
.ijwb
.idea

.dev

# Terraform workspace
.terraform
.terraform-credentials

.rendered-manifests

# manifests
manifests/*

# gomock generated reflect files
gomock_reflect_*/

# Cache
.cache

# hack
hack/*
2 changes: 2 additions & 0 deletions .github/workflows/publish_image_chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ jobs:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
build-args: |
BUILD_VERSION=${{ env.PIPECD_VERSION }}
Comment on lines +95 to +96
Copy link
Contributor Author

@linhdangduy linhdangduy Sep 28, 2025

Choose a reason for hiding this comment

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

confirmed the bug that happened on github action for the previous v0.54.0 build. For example

build image
piped image
launcher image

Expected that all of them will be fixed by this arg passing

tags: ${{ matrix.container_registry }}/${{ matrix.image }}:${{ env.PIPECD_VERSION }}
# parameter to use inline cache. ref; https://docs.docker.com/build/ci/github-actions/cache/#inline-cache
cache-from: type=registry,ref=${{ matrix.container_registry }}/${{ matrix.image }}:latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish_pipedv1_exp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Determine version
run: echo "BUILD_VERSION=$(git describe --tags --always --abbrev=7 --match 'v[0-9]*.*')" >> $GITHUB_ENV

# Setup QEMU and Buildx.
- name: Set up QEMU
Expand Down Expand Up @@ -92,6 +94,8 @@ jobs:
push: true
context: .
file: cmd/pipedv1/Dockerfile
build-args: |
BUILD_VERSION=${{ env.BUILD_VERSION }}
tags: ${{ matrix.container_registry }}/pipedv1-exp:${{ inputs.version }}
platforms: linux/amd64,linux/arm64
# parameter to use inline cache. ref; https://docs.docker.com/build/ci/github-actions/cache/#inline-cache
Expand Down
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ else
endif

.PHONY: build/web
build/web: BUILD_VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]*.*')
build/web:
yarn --cwd web build
BUILD_VERSION=$(BUILD_VERSION) yarn --cwd web build

.PHONY: build/chart
build/chart: VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]*.*')
Expand Down Expand Up @@ -160,14 +161,8 @@ run/pipecd: BUILD_LDFLAGS_PREFIX := -X github.com/pipe-cd/pipecd/pkg/version
run/pipecd: BUILD_OPTS ?= -ldflags "$(BUILD_LDFLAGS_PREFIX).version=$(BUILD_VERSION) $(BUILD_LDFLAGS_PREFIX).gitCommit=$(BUILD_COMMIT) $(BUILD_LDFLAGS_PREFIX).buildDate=$(BUILD_DATE) -w"
run/pipecd: CONTROL_PLANE_VALUES ?= ./quickstart/control-plane-values.yaml
run/pipecd:
@echo "Building go binary of Control Plane..."
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(BUILD_ENV) go build $(BUILD_OPTS) -o ./.artifacts/pipecd ./cmd/pipecd

@echo "Building web static files..."
yarn --cwd web build

@echo "Building docker image and pushing it to local registry..."
docker build -f cmd/pipecd/Dockerfile -t localhost:5001/pipecd:$(BUILD_VERSION) .
docker build -f cmd/pipecd/Dockerfile -t localhost:5001/pipecd:$(BUILD_VERSION) --build-arg BUILD_VERSION=$(BUILD_VERSION) .
docker push localhost:5001/pipecd:$(BUILD_VERSION)

@echo "Installing Control Plane in kind..."
Expand Down Expand Up @@ -198,8 +193,9 @@ else
endif

.PHONY: run/web
run/web: BUILD_VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]*.*')
run/web:
yarn --cwd web dev
BUILD_VERSION=$(BUILD_VERSION) yarn --cwd web dev

.PHONY: run/site
run/site:
Expand Down
3 changes: 2 additions & 1 deletion cmd/helloworld/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder

ARG TARGETOS
ARG TARGETARCH
ARG BUILD_VERSION

WORKDIR /app

Expand All @@ -11,7 +12,7 @@ RUN go mod download

COPY . ./

RUN make build/go MOD=helloworld BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
RUN make build/go MOD=helloworld BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}

FROM alpine:3.21.3

Expand Down
3 changes: 2 additions & 1 deletion cmd/launcher/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder

ARG TARGETOS
ARG TARGETARCH
ARG BUILD_VERSION

WORKDIR /app

Expand All @@ -11,7 +12,7 @@ RUN go mod download

COPY . ./

RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}

# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/459025001?tag=v0.52.0-97-g3e3df6d
FROM ghcr.io/pipe-cd/piped-base@sha256:fc2bde38211a80ee0df6d90ed168c817f30a7d0dbe8a0aff872a93ffb7d40a66
Expand Down
3 changes: 2 additions & 1 deletion cmd/launcher/Dockerfile-okd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder

ARG TARGETOS
ARG TARGETARCH
ARG BUILD_VERSION

WORKDIR /app

Expand All @@ -11,7 +12,7 @@ RUN go mod download

COPY . ./

RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}

# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/460487531?tag=v0.52.0-102-g2f29597
FROM ghcr.io/pipe-cd/piped-base-okd@sha256:fc69a9d270e27e086381e8334885ea3d630db2e10fdd00d41759dc40d87fbafc
Expand Down
22 changes: 15 additions & 7 deletions cmd/pipecd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,37 @@
# because this stage builds only web assets, we can use any platform
FROM --platform=$BUILDPLATFORM node:20.19.0-alpine3.21 AS web

WORKDIR /app
ARG BUILD_VERSION

COPY . .
WORKDIR /app

RUN apk add --no-cache make git

RUN make update/web-deps
RUN make build/web
COPY web/package.json web/yarn.lock ./web/
RUN yarn --cwd web install --prefer-offline

COPY .git ./.git
COPY web ./web
COPY Makefile .
RUN make build/web PIPECD_VERSION=${BUILD_VERSION}

# pipecd builder
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder

ARG TARGETOS
ARG TARGETARCH
ARG BUILD_VERSION

WORKDIR /app

COPY go.* ./
RUN go mod download

COPY . ./

RUN make build/go MOD=pipecd BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
COPY .git ./.git
COPY pkg/ ./pkg/
COPY cmd/ ./cmd/
COPY Makefile .
RUN make build/go MOD=pipecd BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}

FROM alpine:3.21.3

Expand Down
3 changes: 2 additions & 1 deletion cmd/pipectl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder

ARG TARGETOS
ARG TARGETARCH
ARG BUILD_VERSION

WORKDIR /app

Expand All @@ -11,7 +12,7 @@ RUN go mod download

COPY . ./

RUN make build/go MOD=pipectl BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
RUN make build/go MOD=pipectl BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}

FROM alpine:3.21.3

Expand Down
3 changes: 2 additions & 1 deletion cmd/piped/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder

ARG TARGETOS
ARG TARGETARCH
ARG BUILD_VERSION

WORKDIR /app

Expand All @@ -11,7 +12,7 @@ RUN go mod download

COPY . ./

RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}

# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/459025001?tag=v0.52.0-97-g3e3df6d
FROM ghcr.io/pipe-cd/piped-base@sha256:fc2bde38211a80ee0df6d90ed168c817f30a7d0dbe8a0aff872a93ffb7d40a66
Expand Down
3 changes: 2 additions & 1 deletion cmd/piped/Dockerfile-okd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder

ARG TARGETOS
ARG TARGETARCH
ARG BUILD_VERSION

WORKDIR /app

Expand All @@ -11,7 +12,7 @@ RUN go mod download

COPY . ./

RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}

# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/460487531?tag=v0.52.0-102-g2f29597
FROM ghcr.io/pipe-cd/piped-base-okd@sha256:fc69a9d270e27e086381e8334885ea3d630db2e10fdd00d41759dc40d87fbafc
Expand Down
3 changes: 2 additions & 1 deletion cmd/pipedv1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder

ARG TARGETOS
ARG TARGETARCH
ARG BUILD_VERSION

WORKDIR /app

Expand All @@ -11,7 +12,7 @@ RUN go mod download

COPY . ./

RUN make build/go MOD=pipedv1 BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}
RUN make build/go MOD=pipedv1 BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} BUILD_VERSION=${BUILD_VERSION}

# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/459025001?tag=v0.52.0-97-g3e3df6d
FROM ghcr.io/pipe-cd/piped-base@sha256:fc2bde38211a80ee0df6d90ed168c817f30a7d0dbe8a0aff872a93ffb7d40a66
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"private": true,
"license": "Apache-2.0",
"scripts": {
"build": "PIPECD_VERSION=`git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]*.*'` webpack build --mode production --env htmlTemplate=./base.html --config ./webpack.config.js",
"dev": "PIPECD_VERSION=`git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]*.*'` webpack serve --env htmlTemplate=./base.html --config ./webpack.config.dev.js",
"build": "PIPECD_VERSION=${BUILD_VERSION:-`git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]*.*'`} webpack build --mode production --env htmlTemplate=./base.html --config ./webpack.config.js",
"dev": "PIPECD_VERSION=${BUILD_VERSION:-`git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]*.*'`} webpack serve --env htmlTemplate=./base.html --config ./webpack.config.dev.js",
"test": "TZ=Asia/Tokyo jest --config jest.config.local.js",
"test:coverage": "yarn test --coverage",
"lint": "eslint --ext .ts,.tsx ./src",
Expand Down