2021-04-04 05:48:36 +00:00
|
|
|
PACKAGE=github.com/argoproj/argo-cd/v2/common
|
2018-02-15 00:53:07 +00:00
|
|
|
CURRENT_DIR=$(shell pwd)
|
|
|
|
|
DIST_DIR=${CURRENT_DIR}/dist
|
2018-04-23 07:18:59 +00:00
|
|
|
CLI_NAME=argocd
|
2021-01-08 07:05:38 +00:00
|
|
|
UTIL_CLI_NAME=argocd-util
|
2021-01-20 19:28:06 +00:00
|
|
|
BIN_NAME=argocd
|
2018-02-15 00:53:07 +00:00
|
|
|
|
2020-07-04 10:58:57 +00:00
|
|
|
HOST_OS:=$(shell go env GOOS)
|
|
|
|
|
HOST_ARCH:=$(shell go env GOARCH)
|
|
|
|
|
|
2018-02-15 00:53:07 +00:00
|
|
|
VERSION=$(shell cat ${CURRENT_DIR}/VERSION)
|
|
|
|
|
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
|
|
|
|
|
GIT_COMMIT=$(shell git rev-parse HEAD)
|
|
|
|
|
GIT_TAG=$(shell if [ -z "`git status --porcelain`" ]; then git describe --exact-match --tags HEAD 2>/dev/null; fi)
|
|
|
|
|
GIT_TREE_STATE=$(shell if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)
|
2020-05-27 06:04:09 +00:00
|
|
|
PACKR_CMD=$(shell if [ "`which packr`" ]; then echo "packr"; else echo "go run github.com/gobuffalo/packr/packr"; fi)
|
2020-06-10 01:52:56 +00:00
|
|
|
VOLUME_MOUNT=$(shell if test "$(go env GOOS)" = "darwin"; then echo ":delegated"; elif test selinuxenabled; then echo ":delegated"; else echo ""; fi)
|
2021-02-03 00:07:02 +00:00
|
|
|
KUBECTL_VERSION=$(shell go list -m all | grep k8s.io/client-go | cut -d ' ' -f5)
|
2018-02-15 00:53:07 +00:00
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
GOPATH?=$(shell if test -x `which go`; then go env GOPATH; else echo "$(HOME)/go"; fi)
|
|
|
|
|
GOCACHE?=$(HOME)/.cache/go-build
|
|
|
|
|
|
|
|
|
|
DOCKER_SRCDIR?=$(GOPATH)/src
|
|
|
|
|
DOCKER_WORKDIR?=/go/src/github.com/argoproj/argo-cd
|
|
|
|
|
|
|
|
|
|
ARGOCD_PROCFILE?=Procfile
|
|
|
|
|
|
2021-02-09 17:27:22 +00:00
|
|
|
# Strict mode has been disabled in latest versions of mkdocs-material.
|
|
|
|
|
# Thus pointing to the older image of mkdocs-material matching the version used by argo-cd.
|
|
|
|
|
MKDOCS_DOCKER_IMAGE?=squidfunk/mkdocs-material:4.1.1
|
|
|
|
|
MKDOCS_RUN_ARGS?=
|
|
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# Configuration for building argocd-test-tools image
|
2020-07-23 06:05:06 +00:00
|
|
|
TEST_TOOLS_NAMESPACE?=
|
2020-03-27 18:36:20 +00:00
|
|
|
TEST_TOOLS_IMAGE=argocd-test-tools
|
2020-07-23 06:05:06 +00:00
|
|
|
TEST_TOOLS_TAG?=latest
|
2020-03-27 18:36:20 +00:00
|
|
|
ifdef TEST_TOOLS_NAMESPACE
|
|
|
|
|
TEST_TOOLS_PREFIX=${TEST_TOOLS_NAMESPACE}/
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# You can change the ports where ArgoCD components will be listening on by
|
|
|
|
|
# setting the appropriate environment variables before running make.
|
|
|
|
|
ARGOCD_E2E_APISERVER_PORT?=8080
|
|
|
|
|
ARGOCD_E2E_REPOSERVER_PORT?=8081
|
|
|
|
|
ARGOCD_E2E_REDIS_PORT?=6379
|
|
|
|
|
ARGOCD_E2E_DEX_PORT?=5556
|
|
|
|
|
ARGOCD_E2E_YARN_HOST?=localhost
|
2021-03-02 18:24:36 +00:00
|
|
|
ARGOCD_E2E_DISABLE_AUTH?=
|
2020-03-27 18:36:20 +00:00
|
|
|
|
2021-04-07 12:49:17 +00:00
|
|
|
ARGOCD_E2E_TEST_TIMEOUT?=20m
|
|
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
ARGOCD_IN_CI?=false
|
|
|
|
|
ARGOCD_TEST_E2E?=true
|
|
|
|
|
|
2020-04-19 07:05:26 +00:00
|
|
|
ARGOCD_LINT_GOGC?=20
|
2020-04-16 15:55:13 +00:00
|
|
|
|
2020-11-04 22:01:01 +00:00
|
|
|
# Depending on where we are (legacy or non-legacy pwd), we need to use
|
|
|
|
|
# different Docker volume mounts for our source tree
|
|
|
|
|
LEGACY_PATH=$(GOPATH)/src/github.com/argoproj/argo-cd
|
|
|
|
|
ifeq ("$(PWD)","$(LEGACY_PATH)")
|
|
|
|
|
DOCKER_SRC_MOUNT="$(DOCKER_SRCDIR):/go/src$(VOLUME_MOUNT)"
|
|
|
|
|
else
|
|
|
|
|
DOCKER_SRC_MOUNT="$(PWD):/go/src/github.com/argoproj/argo-cd$(VOLUME_MOUNT)"
|
|
|
|
|
endif
|
|
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# Runs any command in the argocd-test-utils container in server mode
|
|
|
|
|
# Server mode container will start with uid 0 and drop privileges during runtime
|
|
|
|
|
define run-in-test-server
|
|
|
|
|
docker run --rm -it \
|
|
|
|
|
--name argocd-test-server \
|
2020-09-15 09:32:16 +00:00
|
|
|
-u $(shell id -u):$(shell id -g) \
|
2020-03-27 18:36:20 +00:00
|
|
|
-e USER_ID=$(shell id -u) \
|
|
|
|
|
-e HOME=/home/user \
|
|
|
|
|
-e GOPATH=/go \
|
|
|
|
|
-e GOCACHE=/tmp/go-build-cache \
|
|
|
|
|
-e ARGOCD_IN_CI=$(ARGOCD_IN_CI) \
|
|
|
|
|
-e ARGOCD_E2E_TEST=$(ARGOCD_E2E_TEST) \
|
|
|
|
|
-e ARGOCD_E2E_YARN_HOST=$(ARGOCD_E2E_YARN_HOST) \
|
2021-03-02 18:24:36 +00:00
|
|
|
-e ARGOCD_E2E_DISABLE_AUTH=$(ARGOCD_E2E_DISABLE_AUTH) \
|
2021-04-15 13:49:12 +00:00
|
|
|
-e ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} \
|
|
|
|
|
-e ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} \
|
|
|
|
|
-e ARGOCD_GPG_DATA_PATH=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source} \
|
2020-11-04 22:01:01 +00:00
|
|
|
-v ${DOCKER_SRC_MOUNT} \
|
2020-05-26 16:15:38 +00:00
|
|
|
-v ${GOPATH}/pkg/mod:/go/pkg/mod${VOLUME_MOUNT} \
|
2020-03-27 18:36:20 +00:00
|
|
|
-v ${GOCACHE}:/tmp/go-build-cache${VOLUME_MOUNT} \
|
|
|
|
|
-v ${HOME}/.kube:/home/user/.kube${VOLUME_MOUNT} \
|
|
|
|
|
-v /tmp:/tmp${VOLUME_MOUNT} \
|
|
|
|
|
-w ${DOCKER_WORKDIR} \
|
|
|
|
|
-p ${ARGOCD_E2E_APISERVER_PORT}:8080 \
|
|
|
|
|
-p 4000:4000 \
|
2021-04-12 16:15:43 +00:00
|
|
|
-p 5000:5000 \
|
2020-03-27 18:36:20 +00:00
|
|
|
$(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE):$(TEST_TOOLS_TAG) \
|
|
|
|
|
bash -c "$(1)"
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
# Runs any command in the argocd-test-utils container in client mode
|
|
|
|
|
define run-in-test-client
|
|
|
|
|
docker run --rm -it \
|
|
|
|
|
--name argocd-test-client \
|
2020-09-15 09:32:16 +00:00
|
|
|
-u $(shell id -u):$(shell id -g) \
|
2020-03-27 18:36:20 +00:00
|
|
|
-e HOME=/home/user \
|
|
|
|
|
-e GOPATH=/go \
|
|
|
|
|
-e ARGOCD_E2E_K3S=$(ARGOCD_E2E_K3S) \
|
|
|
|
|
-e GOCACHE=/tmp/go-build-cache \
|
2020-04-16 15:55:13 +00:00
|
|
|
-e ARGOCD_LINT_GOGC=$(ARGOCD_LINT_GOGC) \
|
2020-11-04 22:01:01 +00:00
|
|
|
-v ${DOCKER_SRC_MOUNT} \
|
2020-05-26 16:15:38 +00:00
|
|
|
-v ${GOPATH}/pkg/mod:/go/pkg/mod${VOLUME_MOUNT} \
|
2020-03-27 18:36:20 +00:00
|
|
|
-v ${GOCACHE}:/tmp/go-build-cache${VOLUME_MOUNT} \
|
|
|
|
|
-v ${HOME}/.kube:/home/user/.kube${VOLUME_MOUNT} \
|
|
|
|
|
-v /tmp:/tmp${VOLUME_MOUNT} \
|
|
|
|
|
-w ${DOCKER_WORKDIR} \
|
2020-07-23 06:05:06 +00:00
|
|
|
$(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE):$(TEST_TOOLS_TAG) \
|
2020-03-27 18:36:20 +00:00
|
|
|
bash -c "$(1)"
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
define exec-in-test-server
|
2020-09-15 09:32:16 +00:00
|
|
|
docker exec -it -u $(shell id -u):$(shell id -g) -e ARGOCD_E2E_K3S=$(ARGOCD_E2E_K3S) argocd-test-server $(1)
|
2019-08-06 07:24:03 +00:00
|
|
|
endef
|
|
|
|
|
|
2019-05-23 00:21:56 +00:00
|
|
|
PATH:=$(PATH):$(PWD)/hack
|
|
|
|
|
|
2019-02-01 21:12:52 +00:00
|
|
|
# docker image publishing options
|
2019-05-22 22:59:30 +00:00
|
|
|
DOCKER_PUSH?=false
|
2019-10-11 20:42:02 +00:00
|
|
|
IMAGE_NAMESPACE?=
|
2019-02-01 21:12:52 +00:00
|
|
|
# perform static compilation
|
2019-05-22 22:59:30 +00:00
|
|
|
STATIC_BUILD?=true
|
2019-02-01 21:12:52 +00:00
|
|
|
# build development images
|
2019-05-22 22:59:30 +00:00
|
|
|
DEV_IMAGE?=false
|
2020-06-22 16:21:53 +00:00
|
|
|
ARGOCD_GPG_ENABLED?=true
|
|
|
|
|
ARGOCD_E2E_APISERVER_PORT?=8080
|
2019-02-01 21:12:52 +00:00
|
|
|
|
2018-02-15 00:53:07 +00:00
|
|
|
override LDFLAGS += \
|
|
|
|
|
-X ${PACKAGE}.version=${VERSION} \
|
|
|
|
|
-X ${PACKAGE}.buildDate=${BUILD_DATE} \
|
|
|
|
|
-X ${PACKAGE}.gitCommit=${GIT_COMMIT} \
|
2021-01-21 17:49:51 +00:00
|
|
|
-X ${PACKAGE}.gitTreeState=${GIT_TREE_STATE}\
|
|
|
|
|
-X ${PACKAGE}.gitTreeState=${GIT_TREE_STATE}\
|
|
|
|
|
-X ${PACKAGE}.kubectlVersion=${KUBECTL_VERSION}
|
2018-02-15 00:53:07 +00:00
|
|
|
|
2019-02-01 21:12:52 +00:00
|
|
|
ifeq (${STATIC_BUILD}, true)
|
|
|
|
|
override LDFLAGS += -extldflags "-static"
|
|
|
|
|
endif
|
|
|
|
|
|
2018-02-15 00:53:07 +00:00
|
|
|
ifneq (${GIT_TAG},)
|
|
|
|
|
IMAGE_TAG=${GIT_TAG}
|
|
|
|
|
LDFLAGS += -X ${PACKAGE}.gitTag=${GIT_TAG}
|
2020-02-02 04:47:25 +00:00
|
|
|
else
|
|
|
|
|
IMAGE_TAG?=latest
|
2018-02-15 00:53:07 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq (${DOCKER_PUSH},true)
|
|
|
|
|
ifndef IMAGE_NAMESPACE
|
|
|
|
|
$(error IMAGE_NAMESPACE must be set to push images (e.g. IMAGE_NAMESPACE=argoproj))
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifdef IMAGE_NAMESPACE
|
|
|
|
|
IMAGE_PREFIX=${IMAGE_NAMESPACE}/
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
2018-11-17 02:14:52 +00:00
|
|
|
all: cli image argocd-util
|
2018-02-15 00:53:07 +00:00
|
|
|
|
2020-11-04 22:01:01 +00:00
|
|
|
# We have some legacy requirements for being checked out within $GOPATH.
|
|
|
|
|
# The ensure-gopath target can be used as dependency to ensure we are running
|
|
|
|
|
# within these boundaries.
|
|
|
|
|
.PHONY: ensure-gopath
|
|
|
|
|
ensure-gopath:
|
|
|
|
|
ifneq ("$(PWD)","$(LEGACY_PATH)")
|
|
|
|
|
@echo "Due to legacy requirements for codegen, repository needs to be checked out within \$$GOPATH"
|
|
|
|
|
@echo "Location of this repo should be '$(LEGACY_PATH)' but is '$(PWD)'"
|
|
|
|
|
@exit 1
|
|
|
|
|
endif
|
|
|
|
|
|
2020-04-06 19:13:50 +00:00
|
|
|
.PHONY: gogen
|
2020-11-04 22:01:01 +00:00
|
|
|
gogen: ensure-gopath
|
2020-05-26 16:15:38 +00:00
|
|
|
export GO111MODULE=off
|
2020-04-06 19:13:50 +00:00
|
|
|
go generate ./util/argo/...
|
|
|
|
|
|
2018-02-15 00:53:07 +00:00
|
|
|
.PHONY: protogen
|
2020-11-04 22:01:01 +00:00
|
|
|
protogen: ensure-gopath
|
2020-05-26 16:15:38 +00:00
|
|
|
export GO111MODULE=off
|
2018-02-15 00:53:07 +00:00
|
|
|
./hack/generate-proto.sh
|
|
|
|
|
|
2019-04-07 00:18:00 +00:00
|
|
|
.PHONY: openapigen
|
2020-11-04 22:01:01 +00:00
|
|
|
openapigen: ensure-gopath
|
2020-05-26 16:15:38 +00:00
|
|
|
export GO111MODULE=off
|
2019-04-07 00:18:00 +00:00
|
|
|
./hack/update-openapi.sh
|
|
|
|
|
|
2018-02-17 01:34:13 +00:00
|
|
|
.PHONY: clientgen
|
2020-11-04 22:01:01 +00:00
|
|
|
clientgen: ensure-gopath
|
2020-05-26 16:15:38 +00:00
|
|
|
export GO111MODULE=off
|
2018-02-16 23:18:37 +00:00
|
|
|
./hack/update-codegen.sh
|
|
|
|
|
|
2020-10-20 00:30:32 +00:00
|
|
|
.PHONY: clidocsgen
|
2020-11-04 22:01:01 +00:00
|
|
|
clidocsgen: ensure-gopath
|
2020-10-20 00:30:32 +00:00
|
|
|
go run tools/cmd-docs/main.go
|
|
|
|
|
|
2019-07-23 18:24:59 +00:00
|
|
|
.PHONY: codegen-local
|
2020-11-04 22:01:01 +00:00
|
|
|
codegen-local: ensure-gopath mod-vendor-local gogen protogen clientgen openapigen clidocsgen manifests-local
|
2020-05-31 21:11:28 +00:00
|
|
|
rm -rf vendor/
|
2019-07-23 18:24:59 +00:00
|
|
|
|
2018-02-17 01:34:13 +00:00
|
|
|
.PHONY: codegen
|
2020-07-23 06:05:06 +00:00
|
|
|
codegen: test-tools-image
|
2020-03-27 18:36:20 +00:00
|
|
|
$(call run-in-test-client,make codegen-local)
|
2019-06-27 21:44:49 +00:00
|
|
|
|
2018-02-18 21:16:24 +00:00
|
|
|
.PHONY: cli
|
2020-07-23 06:05:06 +00:00
|
|
|
cli: test-tools-image
|
2020-07-04 10:58:57 +00:00
|
|
|
$(call run-in-test-client, GOOS=${HOST_OS} GOARCH=${HOST_ARCH} make cli-local)
|
|
|
|
|
|
|
|
|
|
.PHONY: cli-local
|
|
|
|
|
cli-local: clean-debug
|
2021-01-20 19:28:06 +00:00
|
|
|
CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${CLI_NAME} ./cmd
|
2018-04-23 07:18:59 +00:00
|
|
|
|
2020-10-13 21:05:23 +00:00
|
|
|
.PHONY: cli-argocd
|
|
|
|
|
cli-argocd:
|
2021-01-20 19:28:06 +00:00
|
|
|
go build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${CLI_NAME} ./cmd
|
2020-03-27 18:36:20 +00:00
|
|
|
|
2018-11-27 21:39:06 +00:00
|
|
|
.PHONY: release-cli
|
|
|
|
|
release-cli: clean-debug image
|
|
|
|
|
docker create --name tmp-argocd-linux $(IMAGE_PREFIX)argocd:$(IMAGE_TAG)
|
|
|
|
|
docker cp tmp-argocd-linux:/usr/local/bin/argocd ${DIST_DIR}/argocd-linux-amd64
|
|
|
|
|
docker cp tmp-argocd-linux:/usr/local/bin/argocd-darwin-amd64 ${DIST_DIR}/argocd-darwin-amd64
|
2020-01-24 07:18:00 +00:00
|
|
|
docker cp tmp-argocd-linux:/usr/local/bin/argocd-windows-amd64.exe ${DIST_DIR}/argocd-windows-amd64.exe
|
2018-04-23 07:18:59 +00:00
|
|
|
docker rm tmp-argocd-linux
|
|
|
|
|
|
SSO Support (#152)
This change implements SSO support.
dex is run as a sidecar to the ArgoCD API server, which fronts dex using a reverse proxy. The end result is that the ArgoCD acts as an OIDC provider serving under /api/dex. The login flow begins at /auth/login, which redirects to the Dex's OAuth2 consent page and ultimately directed to the IdP provider's login page, where they enter their credentials. After logging in, the OAuth2 redirect flows back to the client app, ultimately reaching /auth/callback, where the OIDC token claims are signed, and persisted in the users's cookie.
The dex configuration YAML is formulated during startup (through the argocd-util utility), with the configuration values taken from the argocd-cm configmap and the argocd-secret.
The build process was refactored to build argocd-util statically, so that it could be run inside off-the-shelf dex, which is built from alpine. Also, build speed was improved by expanding the default make targets in the Dockerfile, to avoid rebuilding each binary from scratch
Session management was refactored to use more bare-bones jwt library constructs, so we could reuse code from the user/password flow vs. OAuth2 flow.
* Initial SSO support. Run dex as sidecar. Generate dex config from ArgoCD cm and secret
* Sign and write SSO claims to JWT cookie during SSO login. Refactor session manager
* Build argo-util statically so it can run in dex sidecar. Redirect after SSO login
* Simplify app creation process to not require communication to dex gRPC server
2018-05-03 05:02:26 +00:00
|
|
|
.PHONY: argocd-util
|
2018-06-15 21:29:20 +00:00
|
|
|
argocd-util: clean-debug
|
2018-11-29 20:57:31 +00:00
|
|
|
# Build argocd-util as a statically linked binary, so it could run within the alpine-based dex container (argoproj/argo-cd#844)
|
2021-01-20 19:28:06 +00:00
|
|
|
CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${UTIL_CLI_NAME} ./cmd
|
SSO Support (#152)
This change implements SSO support.
dex is run as a sidecar to the ArgoCD API server, which fronts dex using a reverse proxy. The end result is that the ArgoCD acts as an OIDC provider serving under /api/dex. The login flow begins at /auth/login, which redirects to the Dex's OAuth2 consent page and ultimately directed to the IdP provider's login page, where they enter their credentials. After logging in, the OAuth2 redirect flows back to the client app, ultimately reaching /auth/callback, where the OIDC token claims are signed, and persisted in the users's cookie.
The dex configuration YAML is formulated during startup (through the argocd-util utility), with the configuration values taken from the argocd-cm configmap and the argocd-secret.
The build process was refactored to build argocd-util statically, so that it could be run inside off-the-shelf dex, which is built from alpine. Also, build speed was improved by expanding the default make targets in the Dockerfile, to avoid rebuilding each binary from scratch
Session management was refactored to use more bare-bones jwt library constructs, so we could reuse code from the user/password flow vs. OAuth2 flow.
* Initial SSO support. Run dex as sidecar. Generate dex config from ArgoCD cm and secret
* Sign and write SSO claims to JWT cookie during SSO login. Refactor session manager
* Build argo-util statically so it can run in dex sidecar. Redirect after SSO login
* Simplify app creation process to not require communication to dex gRPC server
2018-05-03 05:02:26 +00:00
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# .PHONY: dev-tools-image
|
|
|
|
|
# dev-tools-image:
|
|
|
|
|
# docker build -t $(DEV_TOOLS_PREFIX)$(DEV_TOOLS_IMAGE) . -f hack/Dockerfile.dev-tools
|
|
|
|
|
# docker tag $(DEV_TOOLS_PREFIX)$(DEV_TOOLS_IMAGE) $(DEV_TOOLS_PREFIX)$(DEV_TOOLS_IMAGE):$(DEV_TOOLS_VERSION)
|
|
|
|
|
|
|
|
|
|
.PHONY: test-tools-image
|
|
|
|
|
test-tools-image:
|
2020-09-15 09:32:16 +00:00
|
|
|
docker build --build-arg UID=$(shell id -u) -t $(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE) -f test/container/Dockerfile .
|
2020-03-27 18:36:20 +00:00
|
|
|
docker tag $(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE) $(TEST_TOOLS_PREFIX)$(TEST_TOOLS_IMAGE):$(TEST_TOOLS_TAG)
|
2019-07-23 18:24:59 +00:00
|
|
|
|
2019-08-06 07:24:03 +00:00
|
|
|
.PHONY: manifests-local
|
|
|
|
|
manifests-local:
|
2018-07-30 23:13:54 +00:00
|
|
|
./hack/update-manifests.sh
|
2018-07-17 01:37:41 +00:00
|
|
|
|
2019-08-06 07:24:03 +00:00
|
|
|
.PHONY: manifests
|
2020-03-27 18:36:20 +00:00
|
|
|
manifests: test-tools-image
|
2020-07-14 14:52:30 +00:00
|
|
|
$(call run-in-test-client,make manifests-local IMAGE_NAMESPACE='${IMAGE_NAMESPACE}' IMAGE_TAG='${IMAGE_TAG}')
|
2019-08-06 07:24:03 +00:00
|
|
|
|
2021-01-20 19:28:06 +00:00
|
|
|
# consolidated binary for cli, util, server, repo-server, controller
|
|
|
|
|
.PHONY: argocd-all
|
|
|
|
|
argocd-all: clean-debug
|
|
|
|
|
CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${BIN_NAME} ./cmd
|
2019-08-06 07:24:03 +00:00
|
|
|
|
2018-11-27 21:39:06 +00:00
|
|
|
# NOTE: we use packr to do the build instead of go, since we embed swagger files and policy.csv
|
|
|
|
|
# files into the go binary
|
2018-02-16 01:13:47 +00:00
|
|
|
.PHONY: server
|
2018-06-15 21:29:20 +00:00
|
|
|
server: clean-debug
|
2021-01-20 19:28:06 +00:00
|
|
|
CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-server ./cmd
|
2019-05-16 18:05:35 +00:00
|
|
|
|
2018-03-07 06:05:07 +00:00
|
|
|
.PHONY: repo-server
|
|
|
|
|
repo-server:
|
2021-01-20 19:28:06 +00:00
|
|
|
CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-repo-server ./cmd
|
2018-03-07 06:05:07 +00:00
|
|
|
|
2018-02-22 18:56:14 +00:00
|
|
|
.PHONY: controller
|
|
|
|
|
controller:
|
2021-01-20 19:28:06 +00:00
|
|
|
CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-application-controller ./cmd
|
2018-02-23 23:12:11 +00:00
|
|
|
|
2019-02-01 21:12:52 +00:00
|
|
|
.PHONY: packr
|
|
|
|
|
packr:
|
2020-05-27 06:04:09 +00:00
|
|
|
go build -o ${DIST_DIR}/packr github.com/gobuffalo/packr/packr/
|
2019-02-01 21:12:52 +00:00
|
|
|
|
2018-11-15 11:46:10 +00:00
|
|
|
.PHONY: image
|
2019-02-01 21:12:52 +00:00
|
|
|
ifeq ($(DEV_IMAGE), true)
|
|
|
|
|
# The "dev" image builds the binaries from the users desktop environment (instead of in Docker)
|
|
|
|
|
# which speeds up builds. Dockerfile.dev needs to be copied into dist to perform the build, since
|
|
|
|
|
# the dist directory is under .dockerignore.
|
2019-09-17 07:48:35 +00:00
|
|
|
IMAGE_TAG="dev-$(shell git describe --always --dirty)"
|
2019-02-01 21:12:52 +00:00
|
|
|
image: packr
|
|
|
|
|
docker build -t argocd-base --target argocd-base .
|
2019-09-17 07:48:35 +00:00
|
|
|
docker build -t argocd-ui --target argocd-ui .
|
2021-01-20 19:28:06 +00:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 dist/packr build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd ./cmd
|
|
|
|
|
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 dist/packr build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-darwin-amd64 ./cmd
|
|
|
|
|
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 dist/packr build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-windows-amd64.exe ./cmd
|
2021-01-21 17:28:34 +00:00
|
|
|
ln -sfn ${DIST_DIR}/argocd ${DIST_DIR}/argocd-server
|
|
|
|
|
ln -sfn ${DIST_DIR}/argocd ${DIST_DIR}/argocd-application-controller
|
|
|
|
|
ln -sfn ${DIST_DIR}/argocd ${DIST_DIR}/argocd-repo-server
|
|
|
|
|
ln -sfn ${DIST_DIR}/argocd ${DIST_DIR}/argocd-dex
|
|
|
|
|
ln -sfn ${DIST_DIR}/argocd ${DIST_DIR}/argocd-util
|
|
|
|
|
ln -sfn ${DIST_DIR}/argocd-darwin-amd64 ${DIST_DIR}/argocd-util-darwin-amd64
|
|
|
|
|
ln -sfn ${DIST_DIR}/argocd-windows-amd64.exe ${DIST_DIR}/argocd-util-windows-amd64.exe
|
2019-02-01 21:12:52 +00:00
|
|
|
cp Dockerfile.dev dist
|
|
|
|
|
docker build -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) -f dist/Dockerfile.dev dist
|
|
|
|
|
else
|
2018-11-15 11:46:10 +00:00
|
|
|
image:
|
2018-11-27 21:39:06 +00:00
|
|
|
docker build -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) .
|
2019-02-01 21:12:52 +00:00
|
|
|
endif
|
2018-11-15 11:46:10 +00:00
|
|
|
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) ; fi
|
2018-04-25 21:18:30 +00:00
|
|
|
|
2020-05-31 17:31:29 +00:00
|
|
|
.PHONY: armimage
|
|
|
|
|
# The "BUILD_ALL_CLIS" argument is to skip building the CLIs for darwin and windows
|
|
|
|
|
# which would take a really long time.
|
|
|
|
|
armimage:
|
|
|
|
|
docker build -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG)-arm . --build-arg BUILD_ALL_CLIS="false"
|
|
|
|
|
|
2018-02-26 21:47:42 +00:00
|
|
|
.PHONY: builder-image
|
|
|
|
|
builder-image:
|
2018-08-28 23:00:14 +00:00
|
|
|
docker build -t $(IMAGE_PREFIX)argo-cd-ci-builder:$(IMAGE_TAG) --target builder .
|
2019-07-13 00:17:23 +00:00
|
|
|
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argo-cd-ci-builder:$(IMAGE_TAG) ; fi
|
2018-02-26 21:47:42 +00:00
|
|
|
|
2020-05-26 16:15:38 +00:00
|
|
|
.PHONY: mod-download
|
2020-07-23 06:05:06 +00:00
|
|
|
mod-download: test-tools-image
|
2020-05-26 16:15:38 +00:00
|
|
|
$(call run-in-test-client,go mod download)
|
2020-03-27 18:36:20 +00:00
|
|
|
|
2020-05-26 16:15:38 +00:00
|
|
|
.PHONY: mod-download-local
|
|
|
|
|
mod-download-local:
|
2021-03-25 17:28:34 +00:00
|
|
|
go mod download && go mod tidy # go mod download changes go.sum https://github.com/golang/go/issues/42970
|
2019-09-11 17:33:00 +00:00
|
|
|
|
2020-05-26 16:15:38 +00:00
|
|
|
.PHONY: mod-vendor
|
2020-07-23 06:05:06 +00:00
|
|
|
mod-vendor: test-tools-image
|
2020-05-26 16:15:38 +00:00
|
|
|
$(call run-in-test-client,go mod vendor)
|
2020-03-27 18:36:20 +00:00
|
|
|
|
2020-05-26 16:15:38 +00:00
|
|
|
.PHONY: mod-vendor-local
|
|
|
|
|
mod-vendor-local: mod-download-local
|
|
|
|
|
go mod vendor
|
2020-03-29 09:10:02 +00:00
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# Deprecated - replace by install-local-tools
|
2019-10-11 18:55:48 +00:00
|
|
|
.PHONY: install-lint-tools
|
|
|
|
|
install-lint-tools:
|
|
|
|
|
./hack/install.sh lint-tools
|
2018-02-15 00:53:07 +00:00
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# Run linter on the code
|
2019-09-19 17:14:51 +00:00
|
|
|
.PHONY: lint
|
2020-07-23 06:05:06 +00:00
|
|
|
lint: test-tools-image
|
2020-03-27 18:36:20 +00:00
|
|
|
$(call run-in-test-client,make lint-local)
|
|
|
|
|
|
|
|
|
|
# Run linter on the code (local version)
|
|
|
|
|
.PHONY: lint-local
|
|
|
|
|
lint-local:
|
2019-10-11 18:55:48 +00:00
|
|
|
golangci-lint --version
|
2020-01-29 16:26:05 +00:00
|
|
|
# NOTE: If you get a "Killed" OOM message, try reducing the value of GOGC
|
|
|
|
|
# See https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
|
2020-04-16 15:55:13 +00:00
|
|
|
GOGC=$(ARGOCD_LINT_GOGC) GOMAXPROCS=2 golangci-lint run --fix --verbose --timeout 300s
|
2019-09-19 17:14:51 +00:00
|
|
|
|
2020-03-30 20:21:27 +00:00
|
|
|
.PHONY: lint-ui
|
2020-07-23 06:05:06 +00:00
|
|
|
lint-ui: test-tools-image
|
2020-03-30 20:21:27 +00:00
|
|
|
$(call run-in-test-client,make lint-ui-local)
|
|
|
|
|
|
|
|
|
|
.PHONY: lint-ui-local
|
|
|
|
|
lint-ui-local:
|
|
|
|
|
cd ui && yarn lint
|
|
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# Build all Go code
|
2019-03-28 18:20:51 +00:00
|
|
|
.PHONY: build
|
2020-07-23 06:05:06 +00:00
|
|
|
build: test-tools-image
|
2020-03-27 18:36:20 +00:00
|
|
|
mkdir -p $(GOCACHE)
|
|
|
|
|
$(call run-in-test-client, make build-local)
|
|
|
|
|
|
|
|
|
|
# Build all Go code (local version)
|
|
|
|
|
.PHONY: build-local
|
2020-09-09 22:31:33 +00:00
|
|
|
build-local:
|
2020-05-31 21:11:28 +00:00
|
|
|
go build -v `go list ./... | grep -v 'resource_customizations\|test/e2e'`
|
2020-03-27 18:36:20 +00:00
|
|
|
|
|
|
|
|
# Run all unit tests
|
|
|
|
|
#
|
|
|
|
|
# If TEST_MODULE is set (to fully qualified module name), only this specific
|
|
|
|
|
# module will be tested.
|
2018-02-15 00:53:07 +00:00
|
|
|
.PHONY: test
|
2020-07-23 06:05:06 +00:00
|
|
|
test: test-tools-image
|
2020-03-27 18:36:20 +00:00
|
|
|
mkdir -p $(GOCACHE)
|
|
|
|
|
$(call run-in-test-client,make TEST_MODULE=$(TEST_MODULE) test-local)
|
|
|
|
|
|
|
|
|
|
# Run all unit tests (local version)
|
|
|
|
|
.PHONY: test-local
|
2020-05-31 21:11:28 +00:00
|
|
|
test-local:
|
2020-03-27 18:36:20 +00:00
|
|
|
if test "$(TEST_MODULE)" = ""; then \
|
|
|
|
|
./hack/test.sh -coverprofile=coverage.out `go list ./... | grep -v 'test/e2e'`; \
|
|
|
|
|
else \
|
|
|
|
|
./hack/test.sh -coverprofile=coverage.out "$(TEST_MODULE)"; \
|
|
|
|
|
fi
|
|
|
|
|
|
2020-11-07 11:57:18 +00:00
|
|
|
.PHONY: test-race
|
|
|
|
|
test-race: test-tools-image
|
|
|
|
|
mkdir -p $(GOCACHE)
|
|
|
|
|
$(call run-in-test-client,make TEST_MODULE=$(TEST_MODULE) test-race-local)
|
|
|
|
|
|
|
|
|
|
# Run all unit tests, with data race detection, skipping known failures (local version)
|
|
|
|
|
.PHONY: test-race-local
|
|
|
|
|
test-race-local:
|
|
|
|
|
if test "$(TEST_MODULE)" = ""; then \
|
|
|
|
|
./hack/test.sh -race -coverprofile=coverage.out `go list ./... | grep -v 'test/e2e'`; \
|
|
|
|
|
else \
|
|
|
|
|
./hack/test.sh -race -coverprofile=coverage.out "$(TEST_MODULE)"; \
|
|
|
|
|
fi
|
|
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# Run the E2E test suite. E2E test servers (see start-e2e target) must be
|
|
|
|
|
# started before.
|
2018-04-18 20:53:37 +00:00
|
|
|
.PHONY: test-e2e
|
2020-11-04 22:01:01 +00:00
|
|
|
test-e2e:
|
2020-03-27 18:36:20 +00:00
|
|
|
$(call exec-in-test-server,make test-e2e-local)
|
|
|
|
|
|
|
|
|
|
# Run the E2E test suite (local version)
|
|
|
|
|
.PHONY: test-e2e-local
|
2020-07-04 10:58:57 +00:00
|
|
|
test-e2e-local: cli-local
|
2020-01-29 16:26:05 +00:00
|
|
|
# NO_PROXY ensures all tests don't go out through a proxy if one is configured on the test system
|
2020-05-26 16:15:38 +00:00
|
|
|
export GO111MODULE=off
|
2021-04-07 12:49:17 +00:00
|
|
|
ARGOCD_GPG_ENABLED=true NO_PROXY=* ./hack/test.sh -timeout $(ARGOCD_E2E_TEST_TIMEOUT) -v ./test/e2e
|
2018-02-15 00:53:07 +00:00
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# Spawns a shell in the test server container for debugging purposes
|
2020-07-23 06:05:06 +00:00
|
|
|
debug-test-server: test-tools-image
|
2020-03-27 18:36:20 +00:00
|
|
|
$(call run-in-test-server,/bin/bash)
|
|
|
|
|
|
|
|
|
|
# Spawns a shell in the test client container for debugging purposes
|
2020-07-23 06:05:06 +00:00
|
|
|
debug-test-client: test-tools-image
|
2020-03-27 18:36:20 +00:00
|
|
|
$(call run-in-test-client,/bin/bash)
|
|
|
|
|
|
|
|
|
|
# Starts e2e server in a container
|
2019-04-17 17:53:37 +00:00
|
|
|
.PHONY: start-e2e
|
2020-07-23 06:05:06 +00:00
|
|
|
start-e2e: test-tools-image
|
2019-07-24 22:50:31 +00:00
|
|
|
docker version
|
2020-03-27 18:36:20 +00:00
|
|
|
mkdir -p ${GOCACHE}
|
|
|
|
|
$(call run-in-test-server,make ARGOCD_PROCFILE=test/container/Procfile start-e2e-local)
|
|
|
|
|
|
|
|
|
|
# Starts e2e server locally (or within a container)
|
|
|
|
|
.PHONY: start-e2e-local
|
2020-11-04 22:01:01 +00:00
|
|
|
start-e2e-local:
|
2019-04-17 17:53:37 +00:00
|
|
|
kubectl create ns argocd-e2e || true
|
2019-07-13 00:17:23 +00:00
|
|
|
kubectl config set-context --current --namespace=argocd-e2e
|
2019-04-17 17:53:37 +00:00
|
|
|
kustomize build test/manifests/base | kubectl apply -f -
|
2020-06-22 16:21:53 +00:00
|
|
|
# Create GPG keys and source directories
|
|
|
|
|
if test -d /tmp/argo-e2e/app/config/gpg; then rm -rf /tmp/argo-e2e/app/config/gpg/*; fi
|
|
|
|
|
mkdir -p /tmp/argo-e2e/app/config/gpg/keys && chmod 0700 /tmp/argo-e2e/app/config/gpg/keys
|
|
|
|
|
mkdir -p /tmp/argo-e2e/app/config/gpg/source && chmod 0700 /tmp/argo-e2e/app/config/gpg/source
|
2019-07-25 00:25:27 +00:00
|
|
|
# set paths for locally managed ssh known hosts and tls certs data
|
2019-08-04 18:35:00 +00:00
|
|
|
ARGOCD_SSH_DATA_PATH=/tmp/argo-e2e/app/config/ssh \
|
|
|
|
|
ARGOCD_TLS_DATA_PATH=/tmp/argo-e2e/app/config/tls \
|
2020-06-22 16:21:53 +00:00
|
|
|
ARGOCD_GPG_DATA_PATH=/tmp/argo-e2e/app/config/gpg/source \
|
|
|
|
|
ARGOCD_GNUPGHOME=/tmp/argo-e2e/app/config/gpg/keys \
|
|
|
|
|
ARGOCD_GPG_ENABLED=true \
|
2019-09-05 20:31:04 +00:00
|
|
|
ARGOCD_E2E_DISABLE_AUTH=false \
|
|
|
|
|
ARGOCD_ZJWT_FEATURE_FLAG=always \
|
2020-03-27 18:36:20 +00:00
|
|
|
ARGOCD_IN_CI=$(ARGOCD_IN_CI) \
|
|
|
|
|
ARGOCD_E2E_TEST=true \
|
2020-11-02 20:17:43 +00:00
|
|
|
goreman -f $(ARGOCD_PROCFILE) start ${ARGOCD_START}
|
2019-04-17 17:53:37 +00:00
|
|
|
|
2018-06-15 21:29:20 +00:00
|
|
|
# Cleans VSCode debug.test files from sub-dirs to prevent them from being included in packr boxes
|
|
|
|
|
.PHONY: clean-debug
|
|
|
|
|
clean-debug:
|
|
|
|
|
-find ${CURRENT_DIR} -name debug.test | xargs rm -f
|
|
|
|
|
|
2018-02-15 00:53:07 +00:00
|
|
|
.PHONY: clean
|
2018-06-15 21:29:20 +00:00
|
|
|
clean: clean-debug
|
2018-02-15 00:53:07 +00:00
|
|
|
-rm -rf ${CURRENT_DIR}/dist
|
|
|
|
|
|
2019-04-03 22:11:48 +00:00
|
|
|
.PHONY: start
|
2020-07-23 06:05:06 +00:00
|
|
|
start: test-tools-image
|
2019-07-12 16:30:02 +00:00
|
|
|
docker version
|
2020-04-09 13:01:45 +00:00
|
|
|
$(call run-in-test-server,make ARGOCD_PROCFILE=test/container/Procfile start-local ARGOCD_START=${ARGOCD_START})
|
2020-03-27 18:36:20 +00:00
|
|
|
|
|
|
|
|
# Starts a local instance of ArgoCD
|
|
|
|
|
.PHONY: start-local
|
2020-12-07 15:24:08 +00:00
|
|
|
start-local: mod-vendor-local dep-ui-local
|
2020-03-27 18:36:20 +00:00
|
|
|
# check we can connect to Docker to start Redis
|
|
|
|
|
killall goreman || true
|
2019-08-16 16:44:17 +00:00
|
|
|
kubectl create ns argocd || true
|
2020-06-22 16:21:53 +00:00
|
|
|
rm -rf /tmp/argocd-local
|
|
|
|
|
mkdir -p /tmp/argocd-local
|
|
|
|
|
mkdir -p /tmp/argocd-local/gpg/keys && chmod 0700 /tmp/argocd-local/gpg/keys
|
|
|
|
|
mkdir -p /tmp/argocd-local/gpg/source
|
2019-09-05 20:31:04 +00:00
|
|
|
ARGOCD_ZJWT_FEATURE_FLAG=always \
|
2020-03-27 18:36:20 +00:00
|
|
|
ARGOCD_IN_CI=false \
|
2020-06-22 16:21:53 +00:00
|
|
|
ARGOCD_GPG_ENABLED=true \
|
2020-03-27 18:36:20 +00:00
|
|
|
ARGOCD_E2E_TEST=false \
|
|
|
|
|
goreman -f $(ARGOCD_PROCFILE) start ${ARGOCD_START}
|
2019-04-03 22:11:48 +00:00
|
|
|
|
2020-05-27 17:22:13 +00:00
|
|
|
# Runs pre-commit validation with the virtualized toolchain
|
2019-02-21 16:30:13 +00:00
|
|
|
.PHONY: pre-commit
|
2020-06-20 23:01:50 +00:00
|
|
|
pre-commit: codegen build lint test
|
2018-02-15 00:53:07 +00:00
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# Runs pre-commit validation with the local toolchain
|
|
|
|
|
.PHONY: pre-commit-local
|
2020-06-20 23:01:50 +00:00
|
|
|
pre-commit-local: codegen-local build-local lint-local test-local
|
2020-03-27 18:36:20 +00:00
|
|
|
|
2018-04-23 07:18:59 +00:00
|
|
|
.PHONY: release-precheck
|
2018-09-24 19:58:17 +00:00
|
|
|
release-precheck: manifests
|
2018-04-23 07:18:59 +00:00
|
|
|
@if [ "$(GIT_TREE_STATE)" != "clean" ]; then echo 'git tree state is $(GIT_TREE_STATE)' ; exit 1; fi
|
|
|
|
|
@if [ -z "$(GIT_TAG)" ]; then echo 'commit must be tagged to perform release' ; exit 1; fi
|
2018-09-26 14:40:42 +00:00
|
|
|
@if [ "$(GIT_TAG)" != "v`cat VERSION`" ]; then echo 'VERSION does not match git tag'; exit 1; fi
|
2018-04-23 07:18:59 +00:00
|
|
|
|
|
|
|
|
.PHONY: release
|
2019-06-17 17:45:32 +00:00
|
|
|
release: pre-commit release-precheck image release-cli
|
2019-10-21 23:54:23 +00:00
|
|
|
|
2021-02-09 17:27:22 +00:00
|
|
|
.PHONY: build-docs-local
|
|
|
|
|
build-docs-local:
|
|
|
|
|
mkdocs build
|
|
|
|
|
|
2019-10-21 23:54:23 +00:00
|
|
|
.PHONY: build-docs
|
|
|
|
|
build-docs:
|
2021-02-09 17:27:22 +00:00
|
|
|
docker run ${MKDOCS_RUN_ARGS} --rm -it -p 8000:8000 -v ${CURRENT_DIR}:/docs ${MKDOCS_DOCKER_IMAGE} build
|
|
|
|
|
|
|
|
|
|
.PHONY: serve-docs-local
|
|
|
|
|
serve-docs-local:
|
|
|
|
|
mkdocs serve
|
2019-10-21 23:54:23 +00:00
|
|
|
|
|
|
|
|
.PHONY: serve-docs
|
|
|
|
|
serve-docs:
|
2021-02-09 17:27:22 +00:00
|
|
|
docker run ${MKDOCS_RUN_ARGS} --rm -it -p 8000:8000 -v ${CURRENT_DIR}:/docs ${MKDOCS_DOCKER_IMAGE} serve -a 0.0.0.0:8000
|
2019-10-21 23:54:23 +00:00
|
|
|
|
|
|
|
|
.PHONY: lint-docs
|
|
|
|
|
lint-docs:
|
|
|
|
|
# https://github.com/dkhamsing/awesome_bot
|
|
|
|
|
find docs -name '*.md' -exec grep -l http {} + | xargs docker run --rm -v $(PWD):/mnt:ro dkhamsing/awesome_bot -t 3 --allow-dupe --allow-redirect --white-list `cat white-list | grep -v "#" | tr "\n" ','` --skip-save-results --
|
|
|
|
|
|
2020-03-27 18:36:20 +00:00
|
|
|
# Verify that kubectl can connect to your K8s cluster from Docker
|
|
|
|
|
.PHONY: verify-kube-connect
|
2020-07-23 06:05:06 +00:00
|
|
|
verify-kube-connect: test-tools-image
|
2020-03-27 18:36:20 +00:00
|
|
|
$(call run-in-test-client,kubectl version)
|
|
|
|
|
|
|
|
|
|
# Show the Go version of local and virtualized environments
|
|
|
|
|
.PHONY: show-go-version
|
2020-07-23 06:05:06 +00:00
|
|
|
show-go-version: test-tools-image
|
2020-03-27 18:36:20 +00:00
|
|
|
@echo -n "Local Go version: "
|
|
|
|
|
@go version
|
|
|
|
|
@echo -n "Docker Go version: "
|
|
|
|
|
$(call run-in-test-client,go version)
|
|
|
|
|
|
|
|
|
|
# Installs all tools required to build and test ArgoCD locally
|
|
|
|
|
.PHONY: install-tools-local
|
2020-05-31 21:11:28 +00:00
|
|
|
install-tools-local: install-test-tools-local install-codegen-tools-local install-go-tools-local
|
|
|
|
|
|
|
|
|
|
# Installs all tools required for running unit & end-to-end tests (Linux packages)
|
|
|
|
|
.PHONY: install-test-tools-local
|
|
|
|
|
install-test-tools-local:
|
|
|
|
|
sudo ./hack/install.sh packr-linux
|
|
|
|
|
sudo ./hack/install.sh kustomize-linux
|
|
|
|
|
sudo ./hack/install.sh ksonnet-linux
|
|
|
|
|
sudo ./hack/install.sh helm2-linux
|
|
|
|
|
sudo ./hack/install.sh helm-linux
|
|
|
|
|
|
|
|
|
|
# Installs all tools required for running codegen (Linux packages)
|
|
|
|
|
.PHONY: install-codegen-tools-local
|
|
|
|
|
install-codegen-tools-local:
|
|
|
|
|
sudo ./hack/install.sh codegen-tools
|
|
|
|
|
|
|
|
|
|
# Installs all tools required for running codegen (Go packages)
|
|
|
|
|
.PHONY: install-go-tools-local
|
|
|
|
|
install-go-tools-local:
|
2020-03-27 18:36:20 +00:00
|
|
|
./hack/install.sh codegen-go-tools
|
|
|
|
|
|
|
|
|
|
.PHONY: dep-ui
|
2020-07-23 06:05:06 +00:00
|
|
|
dep-ui: test-tools-image
|
2020-03-27 18:36:20 +00:00
|
|
|
$(call run-in-test-client,make dep-ui-local)
|
|
|
|
|
|
|
|
|
|
dep-ui-local:
|
|
|
|
|
cd ui && yarn install
|
2021-04-06 15:55:15 +00:00
|
|
|
|
|
|
|
|
start-test-k8s:
|
|
|
|
|
go run ./hack/k8s
|