-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
65 lines (54 loc) · 2.56 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
# Y - in response to Would you like to add the Github addon?
# Y - in response to Would you like to add the OpenAPI addon?
# Y - in response to Would you like to add the Mock Server addon?
# Y - in response to Would you like to add the SemaphoreCI addon?
# Y - in response to Would you like to add the Nginx addon?
# Y - in response to Would you like to add the Phrase addon?
# Y - in response to Would you like to add the CRUD addon?
# - Devise auto included with the CRUD addon.
# - Bootstrap auto included with the CRUD addon.
# - Slim Template Engine auto included with the CRUD addon.
# Y - in response to Would you like to add the Hotwire addon?
# Y - in response to Would you like to add the Svgeez addon?
create_web:
printf "Y\nY\nY\nY\nY\nY\nY\nY\nY\n" | rails new $(APP_NAME) -m ./template.rb -T ${OPTIONS}
# Y - in response to Would you like to add the Github addon?
# Y - in response to Would you like to add the Mock Server addon?
# Y - in response to Would you like to add the SemaphoreCI addon?
# Y - in response to Would you like to add the Nginx addon?
# Y - in response to Would you like to add the Phrase addon?
# Y - in response to Would you like to add the Devise addon?
create_api:
printf "Y\nY\nY\nY\nY\nY\n" | rails new $(APP_NAME) -m ./template.rb -T --api ${OPTIONS}
build:
cd $(APP_NAME) && \
bin/docker-prepare && \
docker compose -f docker-compose.test.yml build
build_production:
cd $(APP_NAME) && \
bin/docker-prepare && \
docker compose build
test_variant_app:
cd $(APP_NAME) && \
docker compose -f docker-compose.test.yml run test
base_addon_spec = spec/addons/base/**/*_spec.rb
web_addon_spec = spec/addons/variants/web/**/*_spec.rb
api_addon_spec = spec/addons/variants/api/**/*_spec.rb
base_spec = spec/base/**/*_spec.rb
web_spec = spec/variants/web/**/*_spec.rb
api_spec = spec/variants/api/**/*_spec.rb
test_template:
cd $(APP_NAME) && \
docker compose -f docker-compose.test.yml up --detach db redis && \
docker compose -f docker-compose.test.yml run test bash -c "./bin/inject_port_into_nginx.sh && nginx -c /etc/nginx/conf.d/default.conf -t" && \
docker compose -f docker-compose.test.yml run --detach test bin/start.sh && \
cd ../.template && \
bundle install; \
if [ $(VARIANT) = web ]; then \
bundle exec rspec --pattern="${base_spec}, ${web_spec}, ${base_addon_spec}, ${web_addon_spec}" --format progress; \
elif [ $(VARIANT) = api ]; then \
bundle exec rspec --pattern="${base_spec}, ${api_spec}, ${base_addon_spec}, ${api_addon_spec}" --format progress; \
fi;
cleanup:
rm -rf $(APP_NAME)
.PHONY: create build run cleanup test_template