From dc904f874202a81ecdf5257817183bb51243f7ea Mon Sep 17 00:00:00 2001 From: Alexey Bezhan Date: Wed, 17 Apr 2019 17:21:35 +0100 Subject: [PATCH] Add a make target to download statsd_exporter binary Downloads a linux binary from Github and puts it in the scripts folder. This should add it to the package CI uploads to CF during deploy. Unfortunately, since out .cfignore is a symlink to .gitignore we can't add the file to be ignored by git, so it shows up in untracked if `cf-deploy` is run locally. --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c8a182706..56b601408 100644 --- a/Makefile +++ b/Makefile @@ -199,7 +199,10 @@ clean-docker-containers: ## Clean up any remaining docker containers .PHONY: clean clean: - rm -rf node_modules cache target venv .coverage build tests/.cache + rm -rf node_modules cache target venv .coverage build tests/.cache scripts/statsd_exporter + +scripts/statsd_exporter: + curl -sSL https://github.com/prometheus/statsd_exporter/releases/download/v0.9.0/statsd_exporter-0.9.0.linux-amd64.tar.gz | tar zx --strip-components=1 -C scripts/ statsd_exporter-0.9.0.linux-amd64/statsd_exporter .PHONY: cf-login cf-login: ## Log in to Cloud Foundry @@ -223,7 +226,7 @@ generate-manifest: <(${DECRYPT_CMD} ${NOTIFY_CREDENTIALS}/credentials/${CF_SPACE}/paas/environment-variables.gpg) 2>&1 .PHONY: cf-deploy -cf-deploy: ## Deploys the app to Cloud Foundry +cf-deploy: scripts/statsd_exporter ## Deploys the app to Cloud Foundry $(if ${CF_SPACE},,$(error Must specify CF_SPACE)) $(if ${CF_APP},,$(error Must specify CF_APP)) @cf app --guid ${CF_APP} || exit 1 @@ -261,7 +264,7 @@ cf-rollback: ## Rollbacks the app to the previous release cf rename ${CF_APP}-rollback ${CF_APP} .PHONY: cf-push -cf-push: +cf-push: scripts/statsd_exporter $(if ${CF_APP},,$(error Must specify CF_APP)) cf target -o ${CF_ORG} -s ${CF_SPACE} cf push ${CF_APP} -f <(make -s generate-manifest)