forked from mozilla/experimenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
125 lines (85 loc) · 4.11 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
ssl: nginx/key.pem nginx/cert.pem
nginx/key.pem:
openssl genrsa -out nginx/key.pem 4096
nginx/cert.pem: nginx/key.pem
openssl req -new -x509 -nodes -sha256 -key nginx/key.pem \
-subj "/C=US/ST=California/L=Mountain View/O=Mozilla/CN=experiment_local" \
> nginx/cert.pem
secretkey:
openssl rand -hex 24
build:
./scripts/build.sh
test_build: build
docker-compose -f docker-compose-test.yml build
test: test_build
docker-compose -f docker-compose-test.yml run app sh -c "/app/bin/wait-for-it.sh db:5432 -- pytest -vvvv --cov --cov-report term-missing --show-capture=no"
test-watch: compose_build
docker-compose -f docker-compose-test.yml run app sh -c "/app/bin/wait-for-it.sh db:5432 -- ptw -- --testmon --show-capture=no --disable-warnings"
eslint_assets: test_build
docker-compose -f docker-compose-test.yml run app sh -c "yarn run lint"
eslint_fix: test_build
docker-compose -f docker-compose-test.yml run app sh -c "yarn run lint-fix"
lint: test_build
docker-compose -f docker-compose-test.yml run app flake8 .
black_check: test_build
docker-compose -f docker-compose-test.yml run app black -l 90 --check .
black_fix: test_build
docker-compose -f docker-compose-test.yml run app black -l 90 .
code_format: black_fix eslint_fix
echo "Code Formatted"
check_migrations: test_build
docker-compose -f docker-compose-test.yml run app sh -c "/app/bin/wait-for-it.sh db:5432 -- python manage.py makemigrations --check --dry-run --noinput"
check: test_build check_migrations black_check lint eslint_assets test
echo "Success"
compose_build: build ssl
docker-compose build
compose_build_all: build ssl
docker-compose -f docker-compose-full.yml build
compose_kill:
docker-compose kill
compose_rm:
docker-compose rm -f
kill: compose_kill compose_rm
echo "All containers removed!"
up: compose_kill compose_build
docker-compose up
up_all: compose_build_all
docker-compose -f docker-compose-full.yml up
gunicorn: compose_build
docker-compose -f docker-compose.yml -f docker-compose-gunicorn.yml up
makemigrations: compose_build
docker-compose run app python manage.py makemigrations
migrate: compose_build
docker-compose run app sh -c "/app/bin/wait-for-it.sh db:5432 -- python manage.py migrate"
createuser: compose_build
docker-compose run app python manage.py createsuperuser
load_locales_countries: compose_build
docker-compose run app python manage.py load-locales-countries
load_dummy_experiments: compose_build
docker-compose run app python manage.py load-dummy-experiments
shell: compose_build
docker-compose run app python manage.py shell
dbshell: compose_build
docker-compose run app python manage.py dbshell
bash: compose_build
docker-compose run app bash
normandy_shell: compose_build_all
docker-compose -f docker-compose-full.yml run normandy ./manage.py shell
refresh: kill migrate load_locales_countries load_dummy_experiments
# integration tests
integration_kill:
docker-compose -p experimenter_integration -f docker-compose.integration-test.yml kill
docker-compose -p experimenter_integration -f docker-compose.integration-test.yml rm -f
integration_build: integration_kill ssl build
docker-compose -p experimenter_integration -f docker-compose.integration-test.yml build
docker-compose -p experimenter_integration -f docker-compose.integration-test.yml run app sh -c "/app/bin/wait-for-it.sh db:5432 -- python manage.py migrate;python manage.py load-locales-countries;python manage.py createsuperuser --username admin --email admin@example.com --noinput"
integration_shell: integration_build
docker-compose -p experimenter_integration -f docker-compose.integration-test.yml run firefox bash
integration_up_shell:
docker-compose -p experimenter_integration -f docker-compose.integration-test.yml run firefox bash
integration_up_detached: integration_build
docker-compose -p experimenter_integration -f docker-compose.integration-test.yml up -d
integration_up: integration_build
docker-compose -p experimenter_integration -f docker-compose.integration-test.yml up
integration_test: integration_build
docker-compose -p experimenter_integration -f docker-compose.integration-test.yml run firefox tox -c tests/integration