forked from fluid-project/fluid-launcher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
48 lines (42 loc) · 1.28 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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