This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
generated from 18F/open-source-policy
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
40 lines (28 loc) · 1.67 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.DEFAULT_GOAL := help
CSB_EXEC=docker-compose exec -T broker /bin/cloud-service-broker
clean: .env.secrets ## Bring down the broker service if it's up, clean out the database, and remove created images
docker-compose down -v --remove-orphans --rmi local
# Origin of the subdirectory dependency solution:
# https://stackoverflow.com/questions/14289513/makefile-rule-that-depends-on-all-files-under-a-directory-including-within-subd#comment19860124_14289872
build: manifest.yml $(shell find services) ## Build the brokerpak(s)
@docker run --rm --mount type=bind,src=$(PWD),dst=/source --workdir="/source" cfplatformeng/csb pak build .
up: .env.secrets ## Run the broker service with the brokerpak configured. The broker listens on `0.0.0.0:8080`. curl http://127.0.0.1:8080 or visit it in your browser.
docker-compose up -d
wait:
@echo "Waiting 20 seconds for the DB and broker to stabilize..."
@sleep 20
@docker-compose ps
test: .env.secrets ## Execute the brokerpak examples against the running broker
@echo "Running examples..."
$(CSB_EXEC) client run-examples
down: .env.secrets ## Bring the cloud-service-broker service down
docker-compose down
all: clean build up wait test down ## Clean and rebuild, then bring up the server, run the examples, and bring the system down
.PHONY: all clean build up wait test down
.env.secrets:
$(error Copy .env.secrets-template to .env.secrets, then edit in your own values)
# Output documentation for top-level targets
# Thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help
help: ## This help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)