-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
147 lines (135 loc) · 4.68 KB
/
.gitlab-ci.yml
File metadata and controls
147 lines (135 loc) · 4.68 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
---
stages:
- deploy-to-api-servers
- check
- generate-access-history
- resources-explorer
include:
- project: 'grid5000/grid5000-gitlab-templates'
ref: master
file:
# Execute rubocop
- '/rubocop.yml'
# Import g5k default stages
- '/g5k-default-stages.yml'
.template-refrepo:
extends: .template-test
parallel:
matrix:
- TARGET_DEBIAN_VERSION: [bookworm]
before_script:
- apt-get update && apt-get -y --no-install-recommends install build-essential wget git ruby ruby-dev bundler rake gpg clustershell graphviz
# Call the original before_script section
- !reference [.base, before_script]
# Add G5K CA certificate
- wget --no-check-certificate -q https://www.grid5000.fr/certs/ca2019.grid5000.fr.crt -O /usr/local/share/ca-certificates/ca2019.grid5000.fr.crt
- /usr/sbin/update-ca-certificates
validate-input-data:
extends: .template-refrepo
stage: check
script:
- bundle exec rake valid:schema
- bundle exec rake valid:duplicates
- bundle exec rake valid:required-unwanted-files
- bundle exec rake valid:duplicate-values
wikigen:
extends: .template-refrepo
stage: check
allow_failure: true
variables:
SITE_GENERATORS: site_hardware site_network
GLOBAL_GENERATORS: cpu_parameters disk_reservation environments group_storage hardware kwollect_metrics oar_properties status
parallel:
matrix:
- SITE: [global, grenoble, lille, luxembourg, louvain, lyon, nancy, nantes, rennes, sophia, strasbourg, toulouse]
TARGET_DEBIAN_VERSION: [bookworm]
script:
- echo "$GRID5000_API" > "${HOME}/.grid5000_api.yml"
- if [ "${SITE}" = "global" ]; then export GENERATORS=$GLOBAL_GENERATORS ; else export GENERATORS=$SITE_GENERATORS; fi
- if [ "$CI_COMMIT_BRANCH" = "master" ]; then export WIKI="update"; else export WIKI="diff"; fi
- for GENERATOR in ${GENERATORS}; do
echo -e "\e[0Ksection_start:`date +%s`:$GENERATOR\r\e[0KRunning $GENERATOR";
bundle exec rake gen:wiki NAME=${GENERATOR} SITE=${SITE} DO=${WIKI} ;
echo -e "\e[0Ksection_end:`date +%s`:$GENERATOR\r\e[0K";
done
check-no-changes-in-data:
extends: .template-refrepo
stage: check
script:
- export TZ=Europe/Paris
- bundle exec rake reference-api
- git status
- echo "Checking that git status output is empty..."
- sh -c '[ "`git status -s`" = "" ]'
- git diff --exit-code
generate-access-history:
extends: .template-refrepo
stage: generate-access-history
script:
- export TZ=Europe/Paris
- bundle exec rake gen:accesses-history
artifacts:
paths:
- data/grid5000/accesses/accesses_mode_history.yaml
expire_in: 1 week
deploy-to-api-servers:
stage: deploy-to-api-servers
tags:
- grid5000-shell
script:
- /srv/ci-runner-scripts/bin/update-api-servers
rules:
- if: '$CI_COMMIT_TAG'
when: never
- when: on_success
rebuild_resources_explorer:
stage: resources-explorer
# NOTE: this job triggers a rebuild of resources explorer which will be
# automatically deployed to production if it succeeds, therefore it is only
# ran on the main branch.
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: on_success
trigger:
project: grid5000/resources-explorer
# This mirrors the status of RE's pipeline into our own.
# We may want to revisit this if we want to show a "green" job as soon
# as the pipeline is triggered, regardless of its status.
strategy: depend
preview_resources_explorer:
stage: resources-explorer
# NOTE: this job triggers a rebuild of resources explorer which will be
# automatically deployed to a specific environment.
# Resources Explorer build environments are available here:
# https://gitlab.inria.fr/grid5000/resources-explorer/-/environments
rules:
# Do not create the job on master
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: never
# But create a manual job on branches
- when: manual
allow_failure: true
variables:
NEXT_PUBLIC_REFREPO_BRANCH: $CI_COMMIT_BRANCH
trigger:
project: grid5000/resources-explorer
# This mirrors the status of RE's pipeline into our own.
# We may want to revisit this if we want to show a "green" job as soon
# as the pipeline is triggered, regardless of its status.
strategy: depend
rspec:
stage: check # we use 'checks' here to avoid blocking on this when updating the ref-repo
extends: .template-refrepo
script:
- export TZ=Europe/Paris
- bundle exec rspec
valid-homogeneity:
stage: check
extends: .template-refrepo
script:
- bundle exec rake valid:homogeneity
valid-network:
stage: check
extends: .template-refrepo
script:
- bundle exec rake valid:network