.gitlab-ci.yml 1.34 KB
Newer Older
1
2
3
4
5
6
7
image: ruby:2.6.4

stages:
  - build
  - deploy
  - after_deploy

8
9
10
11
12
13
14
15
16
17
18
19
.artifacts_extension:
  artifacts:
    paths:
      - public
      - team.yml
    expire_in: 1d

.only_extension:
  only:
    refs:
      - gitlab_ci_setup_production

20
21
22
before_script:
  - gem install bundler jekyll --no-document

23
24
25
run_jekyll_latest_dependencies:
  stage: build
  script:
26
    - if [[ -f "Gemfile.lock" ]]; then rm Gemfile.lock; fi
27
    - bundle update --jobs $(nproc)  "${FLAGS[@]}"
28
29
30
    - bundle exec jekyll build -d public
  allow_failure: true

31
32
33
34
run_jekyll_production:
  stage: build
  script: 
    - cp _data/team.yml team.yml
35
    - bundle install --jobs $(nproc)  "${FLAGS[@]}"
36
    - bundle exec jekyll build -d public
37
38
39
  extends:
    - .artifacts_extension
    - .only_extension
40
41
42
43
44

pages:
  stage: deploy
  script:
    - echo "deploy"
45
46
47
  extends:
    - .artifacts_extension
    - .only_extension
48
49
50
51
52
53
  dependencies:
    - run_jekyll_production

team_map:
  stage: after_deploy
  script: 
54
    - "HEADERS=\'{\"token\":\"'\"${VAR_TRIGGER_TOKEN_FOR_MULTI_PROJECT_PIPELINE}\"'\", \"ref\":\"gitlab_ci_setup_production\"}\'; curl -X POST -H \"Private-Token: ${VAR_MY_PERSONAL_ACCESS_TOKEN_FOR_API}\" -H \"Content-Type: application/json\" -d \"$HEADERS\" https://gitlab.hzdr.de/api/v4/projects/960/trigger/pipeline"
55
56
57
  extends:
    - .artifacts_extension
    - .only_extension
58
59
60
  dependencies:
    - pages