summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 8d3afaa5cf652b9eb7bb04ca1a3c8b7a02c7f934 (plain)
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
image: 0xacab.org:4567/leap/gitlab-buildpackage:ruby

# This is for caching the gems not only between the stages, but also persistent
# on the gitlab-runner so we don't need to install from scratch on every pipeline
cache:
  key: "$CI_BUILD_REF_NAME"
  untracked: true
  paths:
    - tests/platform-ci/vendor/

before_script:
  - cd tests/platform-ci

stages:
  - setup
  - syntax
  - deploy

setup:
  stage: setup
  script:
    - ./setup.sh

lint:
  stage: syntax
  script:
    - su -c '/usr/local/bin/bundle exec rake lint' cirunner

syntax:
  stage: syntax
  script:
    - su -c '/usr/local/bin/bundle exec rake syntax' cirunner

validate:
  stage: syntax
  script:
    - su -c '/usr/local/bin/bundle exec rake validate' cirunner

templates:
  stage: syntax
  script:
    - su -c '/usr/local/bin/bundle exec rake templates' cirunner

catalog:
  stage: syntax
  script:
    - su -c '/usr/local/bin/bundle exec rake catalog' cirunner

#rspec:
#  stage: rspec
#  script:
#    - /usr/local/bin/bundle exec rake spec

build:
  stage: deploy
  script:
    - su -c '/usr/bin/unbuffer ./ci-build.sh | /usr/bin/ts -s' cirunner

# Latest job will only run on the master branch, which means all merge requests
# that are created from branches don't get to deploy to the latest-ci server.
# When a merge request is merged, then the latest job will deploy the code to
# the latest provider, and the deployment will be recorded in an environment
# named 'latest'
latest:
  stage: deploy
  environment:
    name: latest
  only:
  - master
  script:
    - su -c '/usr/bin/unbuffer ./ci-build.sh | /usr/bin/ts -s' cirunner