Unverified Commit 20c37e96 authored by STRRL's avatar STRRL Committed by GitHub
Browse files

chore(makefile): build e2e thing on local host (#1648)


* chore(makefile): build e2e thing on local host
Signed-off-by: default avatarSTRRL <str_ruiling@outlook.com>

* chore(makefile): let make install could multiple execute
Signed-off-by: default avatarSTRRL <str_ruiling@outlook.com>

* chore(makefile): split prepare-e2e into another preprae-install
Signed-off-by: default avatarSTRRL <str_ruiling@outlook.com>

* chore(makefile): set up helm .Value.registry with env DOCKER_REGISTRY
Signed-off-by: default avatarSTRRL <str_ruiling@outlook.com>

* chore(makefile): use IMAGE_TAG replace hardcoded latest
Signed-off-by: default avatarSTRRL <str_ruiling@outlook.com>

* chore(makefile): enable dashboard and dns server with make install
Signed-off-by: default avatarSTRRL <str_ruiling@outlook.com>

* chore: fix the dependency of image chaos-mesh-e2e
Signed-off-by: default avatarSTRRL <str_ruiling@outlook.com>

* chore(makefile): prepare-install should push the image of dns server for DNSChaos
Signed-off-by: default avatarSTRRL <str_ruiling@outlook.com>
Co-authored-by: default avatarTi Chi Robot <71242396+ti-chi-bot@users.noreply.github.com>
parent 936d7646
Showing with 29 additions and 14 deletions
+29 -14
......@@ -131,10 +131,11 @@ chaosctl:
run: generate fmt vet manifests
$(GO) run ./cmd/controller-manager/main.go
NAMESPACE ?= chaos-testing
# Install CRDs into a cluster
install: manifests
$(KUBECTL_BIN) apply -f manifests/crd.yaml
bash -c '[[ `$(HELM_BIN) version --client --short` == "Client: v2"* ]] && $(HELM_BIN) install helm/chaos-mesh --name=chaos-mesh --namespace=chaos-testing || $(HELM_BIN) install chaos-mesh helm/chaos-mesh --namespace=chaos-testing;'
$(HELM_BIN) upgrade --install chaos-mesh helm/chaos-mesh --namespace=${NAMESPACE} --set registry=${DOCKER_REGISTRY} --set dnsServer.create=true --set dashboard.create=true;
# Generate manifests e.g. CRD, RBAC etc.
config: $(GOBIN)/controller-gen
......@@ -183,6 +184,8 @@ boilerplate:
image: image-chaos-daemon image-chaos-mesh image-chaos-dashboard
e2e-image: image-e2e-helper
GO_TARGET_PHONY :=
BINARIES :=
......@@ -255,25 +258,27 @@ $(eval $(call COMPILE_GO_TEMPLATE,images/chaos-dashboard/bin/chaos-dashboard,./c
$(eval $(call BUILD_IN_DOCKER_TEMPLATE,chaos-mesh,images/chaos-mesh/bin/chaos-controller-manager))
$(eval $(call COMPILE_GO_TEMPLATE,images/chaos-mesh/bin/chaos-controller-manager,./cmd/chaos-controller-manager/main.go,0))
$(eval $(call BUILD_IN_DOCKER_TEMPLATE,chaos-mesh-e2e,test/image/e2e/bin/ginkgo))
$(eval $(call COMPILE_GO_TEMPLATE,test/image/e2e/bin/ginkgo,github.com/onsi/ginkgo/ginkgo,0))
$(eval $(call BUILD_IN_DOCKER_TEMPLATE,chaos-mesh-e2e,test/image/e2e/bin/e2e.test))
ifeq ($(IN_DOCKER),1)
test/image/e2e/bin/e2e.test:
$(GO) test -c -o ./test/image/e2e/bin/e2e.test ./test/e2e
$(eval $(call BUILD_IN_DOCKER_TEMPLATE,chaos-mesh-e2e,test/image/e2e/bin/e2e.test))
GO_TARGET_PHONY += test/image/e2e/bin/e2e.test
endif
prepare-install: all docker-push docker-push-dns-server
image-chaos-mesh-e2e-dependencies += test/image/e2e/manifests test/image/e2e/chaos-mesh
prepare-e2e: e2e-image docker-push-e2e
GINKGO_FLAGS ?=
e2e: e2e-build
./test/image/e2e/bin/ginkgo ./test/image/e2e/bin/e2e.test
./test/image/e2e/bin/ginkgo ${GINKGO_FLAGS} ./test/image/e2e/bin/e2e.test -- --e2e-image ${DOCKER_REGISTRY_PREFIX}pingcap/e2e-helper:${IMAGE_TAG}
image-chaos-mesh-e2e-dependencies += test/image/e2e/manifests test/image/e2e/chaos-mesh e2e-build
CLEAN_TARGETS += test/image/e2e/manifests test/image/e2e/chaos-mesh
e2e-build: test/image/e2e/bin/ginkgo test/image/e2e/bin/e2e.test
CLEAN_TARGETS+=test/image/e2e/bin/ginkgo
test/image/e2e/bin/ginkgo:
$(GO) build -ldflags "$(LDFLAGS)" -tags "${BUILD_TAGS}" -o test/image/e2e/bin/ginkgo github.com/onsi/ginkgo/ginkgo
CLEAN_TARGETS+=test/image/e2e/bin/e2e.test
test/image/e2e/bin/e2e.test:
$(GO) test -c -o ./test/image/e2e/bin/e2e.test ./test/e2e
test/image/e2e/manifests: manifests
rm -rf test/image/e2e/manifests
cp -r manifests test/image/e2e
......@@ -321,6 +326,16 @@ docker-push:
docker push "${DOCKER_REGISTRY_PREFIX}pingcap/chaos-dashboard:${IMAGE_TAG}"
docker push "${DOCKER_REGISTRY_PREFIX}pingcap/chaos-daemon:${IMAGE_TAG}"
docker-push-e2e:
docker push "${DOCKER_REGISTRY_PREFIX}pingcap/e2e-helper:${IMAGE_TAG}"
# the version of dns server should keep consistent with helm
DNS_SERVER_VERSION ?= v0.2.0
docker-push-dns-server:
docker pull pingcap/coredns:${DNS_SERVER_VERSION}
docker tag pingcap/coredns:${DNS_SERVER_VERSION} "${DOCKER_REGISTRY_PREFIX}pingcap/coredns:${DNS_SERVER_VERSION}"
docker push "${DOCKER_REGISTRY_PREFIX}pingcap/coredns:${DNS_SERVER_VERSION}"
docker-push-chaos-kernel:
docker push "${DOCKER_REGISTRY_PREFIX}pingcap/chaos-kernel:${IMAGE_TAG}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment