2017-02-26 23:26:49 -05:00
|
|
|
.PHONY = build-api, build-webapp, build, test, test-api, test-webapp, test-functional-webapp, demo, start, status, \
|
|
|
|
stop, bootstrap
|
2016-12-14 08:55:30 -05:00
|
|
|
|
|
|
|
# Global values for Rookeries components
|
2017-02-24 19:46:52 -05:00
|
|
|
DB_CONNECTION = "postgresql+psycopg2://admin:password@db:5432/rookeries"
|
2016-12-14 08:55:30 -05:00
|
|
|
|
|
|
|
# Build the API image
|
|
|
|
build-api:
|
|
|
|
docker build --tag rookeries/api:build api
|
|
|
|
|
|
|
|
# Build the webapp image
|
|
|
|
build-webapp:
|
|
|
|
docker build --tag rookeries/webapp:build webapp
|
|
|
|
|
|
|
|
# Build all the images
|
|
|
|
build: build-api build-webapp
|
|
|
|
|
|
|
|
# Runs all the tests
|
|
|
|
test: test-api test-webapp
|
|
|
|
|
|
|
|
# Runs api tests
|
2017-02-24 09:02:38 -05:00
|
|
|
test-api: stop build-api
|
2017-03-01 09:18:44 -05:00
|
|
|
docker-compose up -d --build db api
|
2017-02-28 22:23:21 -05:00
|
|
|
docker-compose run api inv test.style
|
2017-02-26 23:26:49 -05:00
|
|
|
docker-compose run api \
|
2017-02-28 17:32:35 -05:00
|
|
|
inv test.server --db-connection=$(DB_CONNECTION) --server-host=api:5000 --verbosity=3
|
2016-12-14 08:55:30 -05:00
|
|
|
|
|
|
|
# Runs webapp tests
|
2017-02-24 09:02:38 -05:00
|
|
|
test-webapp: stop build-webapp
|
2016-12-14 08:55:30 -05:00
|
|
|
docker-compose run webapp npm run lint
|
|
|
|
docker-compose run webapp npm run tests-unit
|
|
|
|
|
|
|
|
# Runs functional test for webapp
|
2017-02-24 09:02:38 -05:00
|
|
|
test-functional-webapp:
|
2016-12-14 22:26:13 -05:00
|
|
|
scripts/verify_sauceconnect_env_ready.sh
|
2017-02-25 12:25:31 -05:00
|
|
|
docker-compose up -d
|
2016-12-14 08:55:30 -05:00
|
|
|
docker-compose run \
|
2017-02-24 09:02:38 -05:00
|
|
|
-e SAUCE_USERNAME=$SAUCE_USERNAME \
|
|
|
|
-e SAUCE_ACCESS_KEY=$SAUCE_ACCESS_KEY webapp \
|
2016-12-14 08:55:30 -05:00
|
|
|
npm run tests-functional
|
|
|
|
|
|
|
|
# Demos Rookeries in a browser
|
|
|
|
demo:
|
|
|
|
docker-compose up -d --remove-orphans
|
|
|
|
python -m webbrowser -n http://localhost:3000/
|
|
|
|
|
|
|
|
# Starts Rookeries
|
|
|
|
start: build
|
|
|
|
docker-compose up --remove-orphans
|
|
|
|
|
|
|
|
# Starts Rookeries
|
|
|
|
status:
|
|
|
|
docker-compose ps
|
|
|
|
|
|
|
|
# Shuts down Rookeries
|
|
|
|
stop:
|
2017-02-24 09:02:38 -05:00
|
|
|
docker-compose down --remove-orphans --volumes
|
2016-12-14 08:55:30 -05:00
|
|
|
|
|
|
|
# Bootstrap DB
|
|
|
|
bootstrap: build
|
|
|
|
docker-compose up -d db
|
2017-02-24 09:02:38 -05:00
|
|
|
docker-compose run api \
|
|
|
|
inv db.bootstrap --db-connection=$(DB_CONNECTION) --reset-db
|