Better CI

This commit is contained in:
Régis Behmo 2019-02-10 21:02:30 +01:00
parent 1781e6e3c3
commit 5974cb5f50
3 changed files with 39 additions and 16 deletions

View File

@ -28,18 +28,11 @@ matrix:
language: generic
env:
BUILD_BINARY: "true"
script:
- python3 --version
- pip3 --version
- pip3 install -U setuptools
- pip3 install -r requirements/dev.txt
- make bundle
- ./dist/tutor config noninteractive
- ./dist/tutor images env
- ./dist/tutor local env
before_deploy:
- cp ./dist/tutor ./dist/tutor-$TRAVIS_OS_NAME
script:
- make ci-info
- make ci-bundle
- make ci-test
deploy:
# Push tutor binary to github releases
@ -54,10 +47,7 @@ deploy:
# Push docker images to docker hub
- provider: script
script: ./dist/tutor images build all && \
./dist/tutor local databases && \
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" && \
./dist/tutor images push all
script: make ci-images
skip_cleanup: true
on:
tags: true
@ -65,7 +55,7 @@ deploy:
# Push to pypi
- provider: script
script: pip install twine && python setup.py sdist && twine upload dist/*.tar.gz
script: make ci-pypi
skip_cleanup: true
on:
tags: true

View File

@ -1,5 +1,11 @@
# Changelog
## Latest
- [Improvement] Better handling of continuous integration
- [Bugfix] fix `tutor --version` (#156)
- [Improvement] Absolute settings imports -- 📯 thanks @tonytan4ever!
## 3.0.0 (2019-06-09)
- [Improvement] Complete rewrite of Tutor: switch from a make-based project to a single binary which runs all commands.

View File

@ -13,6 +13,33 @@ travis: bundle ## Run tests on travis-ci
./dist/tutor images build all
./dist/tutor local databases
ci-info: ## Print info about environment
python3 --version
pip3 --version
ci-bundle: ## Create bundle
pip3 install -U setuptools
pip3 install -r requirements/dev.txt
$(MAKE) bundle
cp ./dist/tutor ./dist/tutor-$$TRAVIS_OS_NAME
ci-test: ## Run basic tests
./dist/tutor config noninteractive
./dist/tutor images env
./dist/tutor local env
ci-images: ## Build and push docker images to hub.docker.com
python setup.py develop
tutor images build all
tutor local databases
docker login -u "$$DOCKER_USERNAME" -p "$$DOCKER_PASSWORD"
tutor images push all
ci-pypi: ## Push release to pypi
pip install twine
python setup.py sdist
twine upload dist/*.tar.gz
ESCAPE = 
help: ## Print this help
@grep -E '^([a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \