2017-03-23 08:57:28 -04:00
|
|
|
.PHONY = build-git-tag, build, test, test-api, test-ui, demo, stop, run-sc
|
2016-12-14 08:55:30 -05:00
|
|
|
|
2017-03-08 21:08:29 -05:00
|
|
|
# Creates a git tag to track the version of the API used.
|
2017-03-07 15:53:09 -05:00
|
|
|
build-git-tag:
|
|
|
|
scripts/gen_git_info.sh
|
|
|
|
|
2016-12-14 08:55:30 -05:00
|
|
|
# Build the API image
|
2017-03-14 09:09:16 -04:00
|
|
|
build: build-git-tag
|
2017-09-15 16:27:58 -04:00
|
|
|
docker build \
|
|
|
|
--pull \
|
|
|
|
--cache-from=dorianpula/rookeries:latest \
|
|
|
|
--tag dorianpula/rookeries:latest .
|
2016-12-14 08:55:30 -05:00
|
|
|
|
|
|
|
# Runs all the tests
|
2017-03-20 08:48:56 -04:00
|
|
|
test: build test-api test-ui
|
2016-12-14 08:55:30 -05:00
|
|
|
|
2017-03-20 08:48:56 -04:00
|
|
|
# Runs API tests
|
2017-03-17 00:54:54 -04:00
|
|
|
test-api: stop build
|
2017-09-15 16:27:58 -04:00
|
|
|
docker-compose run --no-deps rookeries \
|
|
|
|
inv test.python_style
|
2017-04-05 17:43:24 -04:00
|
|
|
docker-compose up -d db rookeries
|
2017-09-15 16:27:58 -04:00
|
|
|
docker-compose exec rookeries \
|
|
|
|
inv db.wait db.init db.upgrade
|
|
|
|
docker-compose exec rookeries \
|
|
|
|
inv server.wait --timeout 100
|
|
|
|
docker-compose exec rookeries \
|
|
|
|
inv test.server
|
2016-12-14 08:55:30 -05:00
|
|
|
|
2017-03-20 08:48:56 -04:00
|
|
|
# Runs UI tests
|
|
|
|
test-ui: stop build
|
2017-09-15 16:27:58 -04:00
|
|
|
docker-compose run --no-deps rookeries \
|
|
|
|
inv test.js_style test.js
|
2017-02-25 12:25:31 -05:00
|
|
|
docker-compose up -d
|
2017-09-15 16:27:58 -04:00
|
|
|
docker-compose exec rookeries \
|
|
|
|
inv db.wait
|
|
|
|
docker-compose exec rookeries \
|
|
|
|
inv server.wait --timeout 100
|
|
|
|
docker-compose exec rookeries \
|
|
|
|
inv test.ui
|
2016-12-14 08:55:30 -05:00
|
|
|
|
|
|
|
# Demos Rookeries in a browser
|
2017-08-04 09:26:29 -04:00
|
|
|
demo: build
|
2016-12-14 08:55:30 -05:00
|
|
|
docker-compose up -d --remove-orphans
|
2017-03-14 18:03:52 -04:00
|
|
|
python -m webbrowser -n http://localhost:5000/
|
2016-12-14 08:55:30 -05:00
|
|
|
|
|
|
|
# Shuts down Rookeries
|
|
|
|
stop:
|
2017-02-24 09:02:38 -05:00
|
|
|
docker-compose down --remove-orphans --volumes
|