Commit 179737ae authored by Thomas Dowrick's avatar Thomas Dowrick

Resolve "Allow skipping of particlar CI stages through commit messages"

parent eb522836
......@@ -9,82 +9,89 @@ stages:
- test
- deploy
build docs:
# Define a template stage with common settings
# that can be extended by specific stages.
# The except block will skip this stage if the commit
# message contains [skip build]
.build-skip-template: &build-skip-template
stage: build
except:
variables:
- $CI_COMMIT_MESSAGE =~ /\[skip[ _-]build?\]/i
.build-install-template: &build-install-template
script:
- tox -e docs
tags:
- shared-linux
- tox -e installer
artifacts:
paths:
- doc/
- dist/
expire_in: 1 week
# The win/mac/linux build stages inherit settings
# from build-install-template
build linux installer:
stage: build
script:
- tox -e installer
<<: *build-skip-template
<<: *build-install-template
tags:
- shared-linux
artifacts:
paths:
- dist/
expire_in: 1 week
build mac installer:
stage: build
script:
- tox -e installer
<<: *build-skip-template
<<: *build-install-template
tags:
- shared-mac
artifacts:
paths:
- dist/
expire_in: 1 week
build windows installer:
stage: build
script:
- tox -e installer
<<: *build-skip-template
<<: *build-install-template
tags:
- shared-win
build docs:
<<: *build-skip-template
script:
- tox -e docs
tags:
- shared-linux
artifacts:
paths:
- dist/
- doc/
expire_in: 1 week
test Linux:
stage: test
script:
- tox
- tox
tags:
- shared-linux
coverage: '/^TOTAL.*\s+(\d+\%)$/'
test macOS:
stage: test
script:
- tox
- tox
tags:
- shared-mac
test Windows:
stage: test
script:
- tox
- tox
tags:
- shared-win
# Template for deploy stages that depend on 'build docs'
# if the build stage is skipped, skip these also
.deploy-docs-skip-template: &deploy-docs-skip-template
stage: deploy
except:
variables:
- $CI_COMMIT_MESSAGE =~ /\[skip[ _-]build?\]/i
dependencies:
- build docs
deploy docs to staging:
stage: deploy
<<: *deploy-docs-skip-template
script:
# Note: the group/username directory must already exist on the server before calling this command
- rsync -avz -e'ssh -v' --numeric-ids --delete doc/build/html/* staging_docs_rsync:{{ cookiecutter.repository_path }} 2>&1
......@@ -95,12 +102,9 @@ deploy docs to staging:
url: http://weisslab-lin.cs.ucl.ac.uk/staging/{{ cookiecutter.repository_path }}
only:
- master
dependencies:
- build docs
deploy docs to production:
stage: deploy
<<: *deploy-docs-skip-template
script:
# Note: the group/username directory must already exist on the server before calling this command
- rsync -avz -e'ssh -v' --numeric-ids --delete doc/build/html/* production_docs_rsync:{{ cookiecutter.repository_path }} 2>&1
......@@ -110,27 +114,24 @@ deploy docs to production:
name: production
only:
- public
dependencies:
- build docs
deploy pip to PyPI:
stage: deploy
when: manual
only:
- tags
environment:
name: PyPI
url: https://pypi.python.org/pypi/{{ cookiecutter.project_slug }}
tags:
- pip-production
artifacts:
paths:
- dist/
- dist/
script:
# Install packages required to build/publish
# remove any previous distribution files
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment