-
Notifications
You must be signed in to change notification settings - Fork 208
/
Makefile
110 lines (94 loc) · 4.15 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
include make-compose.mk
pg:
docker compose up -d db-local
clean:
rm -rf services/app/_build
rm -rf services/app/deps
rm -rf services/app/.elixir_ls
rm -rf services/app/priv/static
rm -rf node_modules
rm -rf tmp/battle_asserts
test:
make -C ./services/app/ test
test-code-checkers:
make -C ./services/app/ test-code-checkers
terraform-vars-generate:
docker run --rm -it -v $(CURDIR):/app -w /app williamyeh/ansible:alpine3 ansible-playbook ansible/terraform.yml -i ansible/production -vv --vault-password-file=tmp/ansible-vault-password
setup: setup-env compose-setup
setup-env:
docker run --rm -v $(CURDIR):/app -w /app williamyeh/ansible:alpine3 ansible-playbook ansible/development.yml -i ansible/development -vv
setup-env-local:
ansible-playbook ansible/development.yml -i ansible/development -vv
ansible-edit-secrets:
ansible-vault edit --vault-password-file tmp/ansible-vault-password ansible/production/group_vars/all/vault.yml
ansible-vault-edit-production:
docker run --rm -it -v $(CURDIR):/app -w /app williamyeh/ansible:alpine3 ansible-vault edit --vault-password-file tmp/ansible-vault-password ansible/production/group_vars/all/vault.yml
release:
make -C services/app release
docker-build-local:
docker build --target assets-image \
--file services/app/Dockerfile.codebattle \
--build-arg GIT_HASH=$(GIT_HASH) \
--tag codebattle/codebattle:assets-image services/app
docker build --target compile-image \
--file services/app/Dockerfile.codebattle \
--build-arg GIT_HASH=$(GIT_HASH) \
--tag codebattle/codebattle:compile-image services/app
docker build --target nginx-assets \
--file services/app/Dockerfile.codebattle \
--tag codebattle/nginx-assets:latest services/app
docker build --target runtime-image \
--file services/app/Dockerfile.codebattle \
--build-arg GIT_HASH=$(GIT_HASH) \
--tag codebattle/codebattle:latest services/app
docker build --target compile-image \
--file services/app/Dockerfile.runner \
--tag codebattle/runner:compile-image services/app
docker build --target runtime-image \
--file services/app/Dockerfile.runner \
--tag codebattle/runner:latest services/app
docker-build-codebattle:
docker pull codebattle/codebattle:assets-image || true
docker pull codebattle/codebattle:compile-image || true
docker pull codebattle/codebattle:latest || true
docker build --target assets-image \
--cache-from=codebattle/codebattle:assets-image \
--file services/app/Dockerfile.codebattle \
--build-arg GIT_HASH=$(GIT_HASH) \
--tag codebattle/codebattle:assets-image services/app
docker build --target compile-image \
--cache-from=codebattle/codebattle:assets-image \
--cache-from=codebattle/codebattle:compile-image \
--file services/app/Dockerfile.codebattle \
--build-arg GIT_HASH=$(GIT_HASH) \
--tag codebattle/codebattle:compile-image services/app
docker build --target nginx-assets \
--file services/app/Dockerfile.codebattle \
--tag codebattle/nginx-assets:latest services/app
docker build --target runtime-image \
--cache-from=codebattle/codebattle:assets-image \
--cache-from=codebattle/codebattle:compile-image \
--cache-from=codebattle/codebattle:latest \
--file services/app/Dockerfile.codebattle \
--build-arg GIT_HASH=$(GIT_HASH) \
--tag codebattle/codebattle:latest services/app
docker-push-codebattle:
docker push codebattle/codebattle:assets-image
docker push codebattle/codebattle:compile-image
docker push codebattle/codebattle:latest
docker push codebattle/nginx-assets:latest
docker-build-runner:
docker pull codebattle/runner:compile-image || true
docker pull codebattle/runner:latest || true
docker build --target compile-image \
--cache-from=codebattle/runner:compile-image \
--file services/app/Dockerfile.runner \
--tag codebattle/runner:compile-image services/app
docker build --target runtime-image \
--cache-from=codebattle/runner:compile-image \
--cache-from=codebattle/runner:latest \
--file services/app/Dockerfile.runner \
--tag codebattle/runner:latest services/app
docker-push-runner:
docker push codebattle/runner:compile-image
docker push codebattle/runner:latest