mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-01-08 16:14:08 +00:00
Move tasks from travis-ci to gitlab CI
We only keep travis-ci for building MacOS/Linux binaries.
This commit is contained in:
parent
205cd9bf1c
commit
dce234bc1e
70
.gitlab-ci.yml
Normal file
70
.gitlab-ci.yml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- deploy:docs # TODO move this to the end
|
||||||
|
- deploy:images
|
||||||
|
- deploy:pypi
|
||||||
|
|
||||||
|
|
||||||
|
build:images:
|
||||||
|
script:
|
||||||
|
- apk add --no-cache docker make
|
||||||
|
- python setup.py install
|
||||||
|
- make ci-build-images
|
||||||
|
tags:
|
||||||
|
- private
|
||||||
|
stage: build
|
||||||
|
|
||||||
|
build:docs:
|
||||||
|
script:
|
||||||
|
- apk add --no-cache make
|
||||||
|
- pip install -r requirements/docs.txt
|
||||||
|
- cd docs && make
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- docs/_build/html
|
||||||
|
stage: build
|
||||||
|
|
||||||
|
build:pypi:
|
||||||
|
script:
|
||||||
|
- apk add --no-cache make
|
||||||
|
- pip install -r requirements/base.txt
|
||||||
|
- pip install -r requirements/plugins.txt
|
||||||
|
- make package
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- dist/
|
||||||
|
stage: build
|
||||||
|
|
||||||
|
deploy:images:
|
||||||
|
script:
|
||||||
|
- apk add --no-cache docker make
|
||||||
|
- python setup.py install
|
||||||
|
- make ci-push-images
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- private
|
||||||
|
stage: deploy:images
|
||||||
|
|
||||||
|
deploy:pypi:
|
||||||
|
script:
|
||||||
|
- apk add --no-cache make
|
||||||
|
- make ci-pypi
|
||||||
|
dependencies:
|
||||||
|
- build:pypi
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- private
|
||||||
|
stage: deploy:pypi
|
||||||
|
|
||||||
|
deploy:docs:
|
||||||
|
dependencies:
|
||||||
|
- build:docs
|
||||||
|
script:
|
||||||
|
- cp -r docs/_build/html/ /var/www/docs.tutor.overhang.io
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- private
|
||||||
|
stage: deploy:docs
|
35
.travis.yml
35
.travis.yml
@ -8,26 +8,8 @@ matrix:
|
|||||||
python: 3.6
|
python: 3.6
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
env:
|
|
||||||
BUILD_BINARY: "true"
|
|
||||||
- os: linux
|
|
||||||
dist: xenial
|
|
||||||
python: 3.6
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
env:
|
|
||||||
BUILD_DOCKER: "true"
|
|
||||||
- os: linux
|
|
||||||
dist: xenial
|
|
||||||
python: 3.6
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
env:
|
|
||||||
BUILD_PYPI: "true"
|
|
||||||
- os: osx
|
- os: osx
|
||||||
language: generic
|
language: generic
|
||||||
env:
|
|
||||||
BUILD_BINARY: "true"
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make ci-info
|
- make ci-info
|
||||||
@ -42,20 +24,3 @@ deploy:
|
|||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
on:
|
on:
|
||||||
tags: true
|
tags: true
|
||||||
condition: $BUILD_BINARY = true
|
|
||||||
|
|
||||||
# Push docker images to docker hub
|
|
||||||
- provider: script
|
|
||||||
script: make ci-images
|
|
||||||
skip_cleanup: true
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
condition: $BUILD_DOCKER = true && $TRAVIS_TAG != "nightly"
|
|
||||||
|
|
||||||
# Push to pypi
|
|
||||||
- provider: script
|
|
||||||
script: make ci-pypi
|
|
||||||
skip_cleanup: true
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
condition: $BUILD_PYPI = true && $TRAVIS_TAG != "nightly"
|
|
||||||
|
26
Makefile
26
Makefile
@ -10,7 +10,6 @@ compile-requirements: ## Compile requirements files
|
|||||||
pip-compile -o requirements/docs.txt requirements/docs.in
|
pip-compile -o requirements/docs.txt requirements/docs.in
|
||||||
|
|
||||||
package: ## Build a package ready to upload to pypi
|
package: ## Build a package ready to upload to pypi
|
||||||
pip install twine
|
|
||||||
python3 setup.py sdist
|
python3 setup.py sdist
|
||||||
|
|
||||||
test: test-lint test-unit test-format test-package ## Run all tests by decreasing order or priority
|
test: test-lint test-unit test-format test-package ## Run all tests by decreasing order or priority
|
||||||
@ -52,9 +51,12 @@ tag:
|
|||||||
@echo "=== Creating tag $(TAG)"
|
@echo "=== Creating tag $(TAG)"
|
||||||
git tag -d $(TAG) || true
|
git tag -d $(TAG) || true
|
||||||
git tag $(TAG)
|
git tag $(TAG)
|
||||||
@echo "=== Pushing tag $(TAG)"
|
@echo "=== Pushing tag $(TAG) to origin"
|
||||||
git push origin :$(TAG) || true
|
git push origin :$(TAG) || true
|
||||||
git push origin $(TAG)
|
git push origin $(TAG)
|
||||||
|
@echo "=== Pushing tag $(TAG) to overhangio"
|
||||||
|
git push overhangio :$(TAG) || true
|
||||||
|
git push overhangio $(TAG)
|
||||||
|
|
||||||
###### Continuous integration tasks
|
###### Continuous integration tasks
|
||||||
|
|
||||||
@ -63,7 +65,7 @@ ci-info: ## Print info about environment
|
|||||||
pip3 --version
|
pip3 --version
|
||||||
|
|
||||||
ci-install: ## Install requirements
|
ci-install: ## Install requirements
|
||||||
pip3 install -U setuptools
|
pip3 install -U setuptools twine
|
||||||
pip3 install -r requirements/dev.txt
|
pip3 install -r requirements/dev.txt
|
||||||
pip3 install -r requirements/plugins.txt
|
pip3 install -r requirements/plugins.txt
|
||||||
|
|
||||||
@ -97,16 +99,20 @@ ci-github: ./releases/github-release ## Upload assets to github
|
|||||||
--tag "v$(shell make version)" \
|
--tag "v$(shell make version)" \
|
||||||
--name "tutor-$$(uname -s)_$$(uname -m)" \
|
--name "tutor-$$(uname -s)_$$(uname -m)" \
|
||||||
--file ./dist/tutor \
|
--file ./dist/tutor \
|
||||||
--replace
|
--replace
|
||||||
|
|
||||||
ci-images: ## Build and push docker images to hub.docker.com
|
ci-config-images:
|
||||||
python setup.py develop
|
tutor config save --set ACTIVATE_NOTES=true --set ACTIVATE_XQUEUE=true
|
||||||
|
|
||||||
|
ci-build-images: ci-config-images ## Build docker images
|
||||||
tutor images build all
|
tutor images build all
|
||||||
tutor local init
|
|
||||||
docker login -u "$$DOCKER_USERNAME" -p "$$DOCKER_PASSWORD"
|
|
||||||
tutor images push all
|
|
||||||
|
|
||||||
ci-pypi: package ## Push release to pypi
|
ci-push-images: ci-config-images ## Push docker images to hub.docker.com
|
||||||
|
docker login -u "$$DOCKER_USERNAME" -p "$$DOCKER_PASSWORD"
|
||||||
|
tutor images push all
|
||||||
|
|
||||||
|
ci-pypi: ## Push release to pypi
|
||||||
|
pip install twine
|
||||||
twine upload dist/*.tar.gz
|
twine upload dist/*.tar.gz
|
||||||
|
|
||||||
###### Additional commands
|
###### Additional commands
|
||||||
|
@ -65,7 +65,8 @@ Releasing a new version
|
|||||||
- Bump the ``__version__`` value in ``tutor/__about__.py``.
|
- Bump the ``__version__`` value in ``tutor/__about__.py``.
|
||||||
- Replace "Latest" by the version name in CHANGELOG.md.
|
- Replace "Latest" by the version name in CHANGELOG.md.
|
||||||
- Create a commit with the version changelog.
|
- Create a commit with the version changelog.
|
||||||
- ``git push``
|
- Push changes to github: ``git push origin``
|
||||||
|
- Push changes to git.overhang.io: ``git push overhangio``
|
||||||
- ``make release``
|
- ``make release``
|
||||||
|
|
||||||
After a regular push to ``master``, run ``make nightly`` to update the "nightly" tag.
|
After a regular push to ``master``, run ``make nightly`` to update the "nightly" tag.
|
||||||
|
Loading…
Reference in New Issue
Block a user