From 5974cb5f50caaa81af0dd2c27f156ed02bcd7e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Sun, 10 Feb 2019 21:02:30 +0100 Subject: [PATCH] Better CI --- .travis.yml | 22 ++++++---------------- CHANGELOG.md | 6 ++++++ Makefile | 27 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 742384f..4828be3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 75051bc..71135cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/Makefile b/Makefile index 247b8c6..b23cc76 100644 --- a/Makefile +++ b/Makefile @@ -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 \