-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.gitlab-ci.yml
76 lines (66 loc) · 2.48 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
# For reference the following ENV are uses in this file.
# CI_REGISTRY_IMAGE, e.g. gitlab-registry.cern.ch/ai/it-puppet-module-ci_images
# CI_BUILD_REF_NAME, e.g. qa , branch name.
# AI_CI_SSH_KEY, contains a private key for fetching deps.
stages:
- images
- tests
# Only in the it-puppet-module-ci_images is the docker image actually created.
# In all other repositories we simply skip this and use the image
# created in it-puppet-module-ci_images, this can be overridden
# via msync.
cc7-puppet-ci:
stage: images
tags:
- docker-image-build
only:
- branches@ai/it-puppet-module-ci_images
script: ""
variables:
CONTEXT_DIR: .
DOCKER_FILE: ci/Dockerfile
FROM: gitlab-registry.cern.ch/linuxsupport/cc7-base
TO: ${CI_REGISTRY_IMAGE}:cc7-puppet-ci-${CI_BUILD_REF_NAME}
before_script:
- '[ -n "${AI_CI_SSH_KEY}" ] && eval $(ssh-agent -s)'
- '[ -n "${AI_CI_SSH_KEY}" ] && ssh-add <(echo "$AI_CI_SSH_KEY")'
puppet3:
stage: tests
tags:
- docker
image: gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:cc7-puppet-ci-master
script:
- cd code
- rm -f ../ci/Gemfile.lock
- BUNDLE_GEMFILE=../ci/Gemfile PUPPET_VERSION='~> 3.0' bundle install --local --without system_tests development
- LANG=en_US.UTF-8 BUNDLE_GEMFILE=../ci/Gemfile PUPPET_VERSION='~> 3.0' bundle exec rake --rakefile ../ci/Rakefile test
puppet4:
stage: tests
tags:
- docker
image: gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:cc7-puppet-ci-master
script:
- cd code
- rm -f ../ci/Gemfile.lock
- BUNDLE_GEMFILE=../ci/Gemfile PUPPET_VERSION='~> 4.8.0' bundle install --local --without system_tests development
- LANG=en_US.UTF-8 BUNDLE_GEMFILE=../ci/Gemfile PUPPET_VERSION='~> 4.8.0' bundle exec rake --rakefile ../ci/Rakefile test
puppet4_latest:
stage: tests
tags:
- docker
image: gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:cc7-puppet-ci-master
script:
- cd code
- rm -f ../ci/Gemfile.lock
- BUNDLE_GEMFILE=../ci/Gemfile PUPPET_VERSION='~> 4.0' bundle install --local --without system_tests development
- LANG=en_US.UTF-8 BUNDLE_GEMFILE=../ci/Gemfile PUPPET_VERSION='~> 4.0' bundle exec rake --rakefile ../ci/Rakefile test
allow_failure: true
yaml-validate:
stage: tests
tags:
- docker
image: gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:cc7-puppet-ci-master
script:
- if [ -d data ] ; then yaml-lint data ; else true; fi
- if [ -f .sync.yml ] ; then yaml-lint .sync.yml ; else true; fi