forked from hexlet-codebattle/codebattle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
128 lines (110 loc) · 4.72 KB
/
Makefile
File metadata and controls
128 lines (110 loc) · 4.72 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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 \
--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-arm:
docker build --platform linux/arm64 \
--target assets-image \
--file services/app/Dockerfile.codebattle \
--build-arg GIT_HASH=$(GIT_HASH) \
--tag codebattle/codebattle:assets-image-arm services/app
docker build --platform linux/arm64 \
--target compile-image \
--file services/app/Dockerfile.codebattle \
--build-arg GIT_HASH=$(GIT_HASH) \
--tag codebattle/codebattle:compile-image-arm services/app
docker build --platform linux/arm64 \
--target nginx-assets \
--file services/app/Dockerfile.codebattle \
--tag codebattle/nginx-assets:arm services/app
docker build --platform linux/arm64 \
--target runtime-image \
--file services/app/Dockerfile.codebattle \
--build-arg GIT_HASH=$(GIT_HASH) \
--tag codebattle/codebattle:arm services/app
docker-push-codeabttle-arm:
docker push codebattle/codebattle:assets-image-arm
docker push codebattle/codebattle:compile-image-arm
docker push codebattle/codebattle:arm
docker push codebattle/nginx-assets:arm
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 \
--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-push-runner:
docker push codebattle/runner:compile-image
docker push codebattle/runner:latest