Created
May 10, 2017 16:48
-
-
Save avtar/82ef906687d1fabba58821b208fec327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The standard configuration file to run our Vagrant tests in QI. | |
# | |
# See https://github.com/avtar/qi-development-environments | |
--- | |
# Cache directories such as 'node_modules' in between stages. | |
cache: | |
key: "$CI_COMMIT_SHA" | |
untracked: true | |
paths: | |
- node_modules/ | |
# Run the following stages sequentially. | |
stages: | |
- vagrant_up | |
- vagrant_tests | |
- vagrant_destroy | |
# Move the '.vagrant' directory to a location so that it won't be removed by the CI runner when it | |
# cleans the workspace. | |
before_script: | |
- "mkdir -p ../.vagrant-$CI_COMMIT_SHA" | |
- rm -fr .vagrant | |
- "ln -sf ../.vagrant-$CI_COMMIT_SHA .vagrant" | |
# "when: always" ensures the 'vagrant up' (and later 'vagrant destroy -f') command is run always, | |
# so failures in other stages won't interfere with the execution of these critical stages. | |
vagrant_up: | |
stage: vagrant_up | |
script: | |
- vagrant up | |
when: always | |
vagrant_tests: | |
stage: vagrant_tests | |
script: | |
- vagrant ci test | |
vagrant_destroy: | |
stage: vagrant_destroy | |
script: | |
# Using separate vagrant halt and destroy commands as workarounds for a VirtualBox bug: | |
# https://www.virtualbox.org/ticket/12477 | |
# https://github.com/mitchellh/vagrant/issues/8104 | |
- vagrant halt | |
- vagrant destroy -f | |
- "rm -fr ../.vagrant-$CI_COMMIT_SHA" | |
when: always | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
concurrent = 1 | |
check_interval = 0 | |
log_level = "debug" | |
[[runners]] | |
name = "your-runners-name" | |
limit = 1 | |
url = "https://gitlab.com/" | |
token = "secret-token-sssshhhhh" | |
executor = "shell" | |
[runners.cache] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment