From 8436b05164195b36ae9828ec4e18358eee53e9b3 Mon Sep 17 00:00:00 2001 From: Yoshiki Fujikane <40124947+ffjlabo@users.noreply.github.com> Date: Wed, 17 Sep 2025 16:35:37 +0900 Subject: [PATCH] Revert "Improve `make run/pipecd` execution speed (#6184)" This reverts commit 86d8b66819ae53da0e655c845275d394f984f5b5. Signed-off-by: Yoshiki Fujikane <40124947+ffjlabo@users.noreply.github.com> --- .dockerignore | 60 ------------------------------------------- Makefile | 6 +++++ cmd/pipecd/Dockerfile | 13 +++------- 3 files changed, 10 insertions(+), 69 deletions(-) delete mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 435345cf6c..0000000000 --- a/.dockerignore +++ /dev/null @@ -1,60 +0,0 @@ -# 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/* diff --git a/Makefile b/Makefile index ab892a21c1..ee2664b708 100644 --- a/Makefile +++ b/Makefile @@ -156,6 +156,12 @@ 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 push localhost:5001/pipecd:$(BUILD_VERSION) diff --git a/cmd/pipecd/Dockerfile b/cmd/pipecd/Dockerfile index 8496d88fe4..c0c926bdec 100644 --- a/cmd/pipecd/Dockerfile +++ b/cmd/pipecd/Dockerfile @@ -5,14 +5,11 @@ FROM --platform=$BUILDPLATFORM node:20.19.0-alpine3.21 AS web WORKDIR /app -RUN apk add --no-cache make git +COPY . . -COPY web/package.json web/yarn.lock ./web/ -RUN yarn --cwd web install --prefer-offline +RUN apk add --no-cache make git -COPY .git ./.git -COPY web ./web -COPY Makefile . +RUN make update/web-deps RUN make build/web # pipecd builder @@ -26,9 +23,7 @@ WORKDIR /app COPY go.* ./ RUN go mod download -COPY pkg/ ./pkg/ -COPY cmd/ ./cmd/ -COPY Makefile . +COPY . ./ RUN make build/go MOD=pipecd BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH}