Skip to content

Commit

Permalink
chore: make make cli use virtualized toolchain (argoproj#3884)
Browse files Browse the repository at this point in the history
* chore: make make cli use virtualized toolchain

Signed-off-by: darshanime <[email protected]>

* chore: use cli-local in Dockerfile

Signed-off-by: darshanime <[email protected]>

* chore: use cli-local in Dockerfile

Signed-off-by: darshanime <[email protected]>
  • Loading branch information
darshanime authored Jul 4, 2020
1 parent b3c118d commit 508e2c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ RUN go mod download

# Perform the build
COPY . .
RUN make cli server controller repo-server argocd-util
RUN make cli-local server controller repo-server argocd-util

ARG BUILD_ALL_CLIS=true
RUN if [ "$BUILD_ALL_CLIS" = "true" ] ; then \
make CLI_NAME=argocd-darwin-amd64 GOOS=darwin cli && \
make CLI_NAME=argocd-windows-amd64.exe GOOS=windows cli \
make CLI_NAME=argocd-darwin-amd64 GOOS=darwin cli-local && \
make CLI_NAME=argocd-windows-amd64.exe GOOS=windows cli-local \
; fi

####################################################################################################
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ CURRENT_DIR=$(shell pwd)
DIST_DIR=${CURRENT_DIR}/dist
CLI_NAME=argocd

HOST_OS:=$(shell go env GOOS)
HOST_ARCH:=$(shell go env GOARCH)

VERSION=$(shell cat ${CURRENT_DIR}/VERSION)
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
GIT_COMMIT=$(shell git rev-parse HEAD)
Expand Down Expand Up @@ -160,7 +163,11 @@ codegen:
$(call run-in-test-client,make codegen-local)

.PHONY: cli
cli: clean-debug
cli:
$(call run-in-test-client, GOOS=${HOST_OS} GOARCH=${HOST_ARCH} make cli-local)

.PHONY: cli-local
cli-local: clean-debug
rm -f ${DIST_DIR}/${CLI_NAME}
mkdir -p ${DIST_DIR}
CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${CLI_NAME} ./cmd/argocd
Expand Down Expand Up @@ -332,7 +339,7 @@ test-e2e:

# Run the E2E test suite (local version)
.PHONY: test-e2e-local
test-e2e-local: cli
test-e2e-local: cli-local
# NO_PROXY ensures all tests don't go out through a proxy if one is configured on the test system
export GO111MODULE=off
ARGOCD_GPG_ENABLED=true NO_PROXY=* ./hack/test.sh -timeout 15m -v ./test/e2e
Expand Down

0 comments on commit 508e2c5

Please sign in to comment.