File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# StreamSource
22# Usage: make [command]
33
4- .PHONY : help up down shell test migrate seed setup reset logs lint rebuild
4+ .PHONY : help up down stop restart shell test migrate seed setup reset logs lint rebuild browse
55
66STREAMSOURCE_ENV ?= dev
7+ APP_URL ?= http://localhost:3001/admin
78
89ifeq ($(STREAMSOURCE_ENV ) ,prod)
910COMPOSE_FILES := -f docker-compose.yml -f docker-compose.prod.yml
1920 @echo " Commands:"
2021 @echo " up - Start services (STREAMSOURCE_ENV=prod for production)"
2122 @echo " down - Stop services"
23+ @echo " stop - Stop services without removing containers"
24+ @echo " restart - Restart services without removing containers"
25+ @echo " browse - Open the app in your browser (APP_URL=$( APP_URL) )"
2226 @echo " shell - Rails console"
2327 @echo " test - Run tests"
2428 @echo " lint - Run lint checks (RuboCop, ESLint)"
3539down :
3640 $(COMPOSE ) down
3741
42+ stop :
43+ $(COMPOSE ) stop
44+
45+ restart :
46+ $(COMPOSE ) restart
47+
48+ browse :
49+ @url=" $( APP_URL) " ; \
50+ if [ " $( STREAMSOURCE_ENV) " != " prod" ]; then \
51+ echo " Admin login (dev): admin@example.com / Password123!" ; \
52+ echo " Alternate admin: admin2@example.com / Password123!" ; \
53+ echo " Run \` make seed\` if these users are missing." ; \
54+ fi ; \
55+ if command -v open > /dev/null 2>&1 ; then \
56+ open " $$ url" ; \
57+ elif command -v xdg-open > /dev/null 2>&1 ; then \
58+ xdg-open " $$ url" ; \
59+ else \
60+ echo " Open $$ url in your browser." ; \
61+ fi
62+
3863shell :
3964 $(COMPOSE ) exec web bin/rails console
4065
You can’t perform that action at this time.
0 commit comments