Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: ci-local requires passing admin argument #3431

Merged
merged 1 commit into from
Jan 17, 2025
Merged
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
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,22 @@ license-check:
ci: clean deps fmt harvest lint test govulncheck license-check

ci-local: ## Run CI locally
ifeq ($(origin ci),undefined)
@echo ci-local requires a path to the CI harvest.yml like so:
@echo make ci=/path/to/harvest.yml ci-local
ifeq ($(origin ci), undefined)
@echo ci-local requires that both the ci and admin variables are defined at the CLI, ci is missing. e.g.:
@echo make ci=/path/to/harvest.yml admin=/path/to/harvest_admin.yml ci-local
@exit 1
endif
ifeq ($(origin admin), undefined)
@echo ci-local requires that both the ci and admin variables are defined at the CLI, admin is missing. e.g.
@echo make ci=/path/to/harvest.yml admin=/path/to/harvest_admin.yml ci-local
@exit 1
else
# Both variables are defined
-@docker stop $$(docker ps -a --format '{{.ID}} {{.Names}}' | grep -E 'grafana|prometheus|poller') 2>/dev/null || true
-@docker rm $$(docker ps -a --format '{{.ID}} {{.Names}}' | grep -E 'grafana|prometheus|poller') 2>/dev/null || true
-@docker volume rm harvest_grafana_data harvest_prometheus_data 2>/dev/null || true
@if [ "$(ci)" != "harvest.yml" ]; then cp $(ci) harvest.yml; else echo "Source and destination files are the same, skipping copy"; fi
@if [ "$(ci)" != "harvest.yml" ]; then cp $(ci) harvest.yml; else echo "Source and destination harvest.yml are the same, skipping copy"; fi
@if [ "$(admin)" != "harvest_admin.yml" ]; then cp $(admin) integration/test/harvest_admin.yml; else echo "Source and destination harvest_admin.yml are the same, skipping copy"; fi
@./bin/harvest generate docker full --port --output harvest-compose.yml
@docker build -f container/onePollerPerContainer/Dockerfile -t ghcr.io/netapp/harvest:latest . --no-cache --build-arg GO_VERSION=${GO_VERSION} --build-arg VERSION=${VERSION}
@docker compose -f prom-stack.yml -f harvest-compose.yml up -d --remove-orphans
Expand All @@ -178,5 +185,4 @@ endif
VERSION=${VERSION} REGRESSION=1 ./integration/test/test.sh
VERSION=${VERSION} ANALYZE_DOCKER_LOGS=1 ./integration/test/test.sh
VERSION=${VERSION} CHECK_METRICS=1 ./integration/test/test.sh


endif
Loading