forked from Azure/go-shuttle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (36 loc) · 1.25 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
40
41
42
43
44
45
46
47
include .env
IMAGE?=${REGISTRY}/pubsubtest
export
SCRIPTPATH="$(shell cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
.PHONY: test-setup
test-setup:
scripts/test-setup.sh $(SCRIPTPATH)/.env
.PHONY: cleanup-test-setup
cleanup-test-setup:
az group delete --name ${TEST_RESOURCE_GROUP}
build-test-image:
docker build -t ${IMAGE} .
push-test-image:
docker login -u ${REGISTRY_USER} -p ${REGISTRY_PASSWORD} ${REGISTRY}
docker push ${IMAGE}
test-aci: clean-aci scripts/containergroup.yaml
containerId=$$(az container create --file scripts/containergroup.yaml \
--resource-group ${TEST_RESOURCE_GROUP} \
--verbose \
--query id -o tsv) ;\
az container logs --ids $${containerId} --follow
shell-aci: clean-aci
az container create --file scripts/containergroup.yaml \
--resource-group ${TEST_RESOURCE_GROUP} \
--command-line "/bin/bash"; \
az container attach --name "pubsubtester" --resource-group "${TEST_RESOURCE_GROUP}"
scripts/containergroup.yaml:
envsubst < scripts/containergroup.template.yaml > scripts/containergroup.yaml
clean-aci:
az container delete \
--resource-group ${TEST_RESOURCE_GROUP} \
--name pubsubtester \
--yes
integration: build-test-image push-test-image test-aci
integration-local: build-test-image
@docker-compose --env-file .env up