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.
This commit is contained in:
Alexey Bezhan
2019-04-17 17:21:35 +01:00
parent d8ea30f414
commit dc904f8742

View File

@@ -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)