-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
52 lines (42 loc) · 1.34 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
48
49
50
51
52
VERSION = latest
IMAGE_NAME ?= flemay/3musketeers:$(VERSION)
ENVFILE = .env
DOCKER_RUN_ENVVARS = docker run --rm -v $(PWD):/opt/app -w /opt/app flemay/envvars:0.0.3
COMPOSE_RUN_ENVVARS = docker-compose run --rm envvars
COMPOSE_RUN_3MKTS = docker-compose run --rm 3musketeers
.env:
$(DOCKER_RUN_ENVVARS) envfile
envfileExample:
$(DOCKER_RUN_ENVVARS) envfile --example --overwrite
.PHONY: envfileExample
pull:
docker pull $(IMAGE_NAME)
.PHONY: pull
build:
docker build --no-cache -t $(IMAGE_NAME) .
.PHONY: build
test: $(ENVFILE)
$(COMPOSE_RUN_ENVVARS) validate
docker run --rm $(IMAGE_NAME) make --version
docker run --rm $(IMAGE_NAME) zip --version
docker run --rm $(IMAGE_NAME) git --version
docker run --rm $(IMAGE_NAME) curl --version
docker run --rm $(IMAGE_NAME) cookiecutter --version
.PHONY: test
shell:
docker run --rm -it -v $(PWD):/opt/app $(IMAGE_NAME) sh -l
.PHONY: shell
remove:
docker rmi -f $(IMAGE_NAME)
.PHONY: remove
triggerDockerHubBuild: $(ENVFILE)
$(COMPOSE_RUN_ENVVARS) ensure
$(COMPOSE_RUN_3MKTS) make _triggerDockerHubBuild
.PHONY: triggerDockerHubBuild
clean: $(ENVFILE)
docker-compose down --remove-orphans
$(DOCKER_RUN_ENVVARS) envfile --rm
.PHONY: clean
_triggerDockerHubBuild:
curl -H "Content-Type: application/json" --data '{"docker_tag": "latest"}' -X POST $(DOCKERHUB_TRIGGER_URL)
.PHONY: _triggerDockerHubBuild