.gitlab-ci.yml 6.02 KB
Newer Older
Georgios Bitzes's avatar
Georgios Bitzes committed
1
stages:
2
- build-image
3
- koji
Georgios Bitzes's avatar
Georgios Bitzes committed
4
5
- build
- test
Georgios Bitzes's avatar
Georgios Bitzes committed
6
- publish
Georgios Bitzes's avatar
Georgios Bitzes committed
7

8
9
10
before_script:
  - export GTEST_COLOR="1"

Georgios Bitzes's avatar
Georgios Bitzes committed
11
12
13
14
15
16
17
18
19
20
21
c8:
  stage: build
  image: gitlab-registry.cern.ch/eos/quarkdb/build-image-c8
  script:
    - packaging/gitlab-build.sh
    - mkdir ${CI_JOB_NAME}
    - cp -r /root/rpmbuild/RPMS build/SRPMS ${CI_JOB_NAME}
  artifacts:
    paths:
    - "$CI_JOB_NAME"

Georgios Bitzes's avatar
Georgios Bitzes committed
22
23
cc7:
  stage: build
24
  image: gitlab-registry.cern.ch/eos/quarkdb/build-image-cc7
Georgios Bitzes's avatar
Georgios Bitzes committed
25
26
  script:
    - packaging/gitlab-build.sh
27
28
    - mkdir ${CI_JOB_NAME}
    - cp -r /root/rpmbuild/RPMS build/SRPMS ${CI_JOB_NAME}
Georgios Bitzes's avatar
Georgios Bitzes committed
29
30
  artifacts:
    paths:
31
    - "$CI_JOB_NAME"
Georgios Bitzes's avatar
Georgios Bitzes committed
32

33
fedora:
34
  stage: build
35
  image: gitlab-registry.cern.ch/eos/quarkdb/build-image-fedora
36
37
38
39
40
41
42
43
44
  script:
    - packaging/gitlab-build.sh
    - mkdir ${CI_JOB_NAME}
    - cp -r /root/rpmbuild/RPMS build/SRPMS ${CI_JOB_NAME}
  artifacts:
    paths:
    - "$CI_JOB_NAME"

fedora-tsan:
Georgios Bitzes's avatar
Georgios Bitzes committed
45
  stage: build
46
  image: gitlab-registry.cern.ch/eos/quarkdb/build-image-fedora
Georgios Bitzes's avatar
Georgios Bitzes committed
47
  script:
48
    - CXXFLAGS='-fsanitize=thread' packaging/gitlab-build.sh
49
50
    - mkdir ${CI_JOB_NAME}
    - cp -r /root/rpmbuild/RPMS build/SRPMS ${CI_JOB_NAME}
Georgios Bitzes's avatar
Georgios Bitzes committed
51
52
  artifacts:
    paths:
53
    - "$CI_JOB_NAME"
Georgios Bitzes's avatar
Georgios Bitzes committed
54

Georgios Bitzes's avatar
Georgios Bitzes committed
55
ubuntu-asan:
56
  stage: test
57
  image: gitlab-registry.cern.ch/eos/quarkdb/build-image-ubuntu
Georgios Bitzes's avatar
Georgios Bitzes committed
58
  script:
59
    - ci/ubuntu/asan.sh
60
61
62
  artifacts:
    paths:
    - build/coverage-report
63
64
#  tags:
#    - docker-privileged
Georgios Bitzes's avatar
Georgios Bitzes committed
65

Georgios Bitzes's avatar
Georgios Bitzes committed
66
67
cc7-test:
  stage: test
68
  image: gitlab-registry.cern.ch/eos/quarkdb/build-image-cc7
Georgios Bitzes's avatar
Georgios Bitzes committed
69
70
71
72
73
  dependencies:
  - cc7
  script:
    - yum -y localinstall cc7/RPMS/*
    - quarkdb-tests
Georgios Bitzes's avatar
Georgios Bitzes committed
74
    - quarkdb-stress-tests
Georgios Bitzes's avatar
Georgios Bitzes committed
75

76
77
78
79
80
81
c8-test:
  stage: test
  image: gitlab-registry.cern.ch/eos/quarkdb/build-image-c8
  dependencies:
  - c8
  script:
Georgios Bitzes's avatar
Georgios Bitzes committed
82
    - yum -y localinstall c8/RPMS/*
83
84
85
    - quarkdb-tests
    - quarkdb-stress-tests

86
fedora-test:
Georgios Bitzes's avatar
Georgios Bitzes committed
87
  stage: test
88
  image: gitlab-registry.cern.ch/eos/quarkdb/build-image-fedora
Georgios Bitzes's avatar
Georgios Bitzes committed
89
  dependencies:
90
  - fedora
Georgios Bitzes's avatar
Georgios Bitzes committed
91
  script:
92
    - dnf -y install fedora/RPMS/*
93
94
95
96
97
    - quarkdb-tests
    - quarkdb-stress-tests

fedora-tsan-test:
  stage: test
98
  image: gitlab-registry.cern.ch/eos/quarkdb/build-image-fedora
99
100
101
102
  dependencies:
  - fedora-tsan
  script:
    - dnf -y install fedora-tsan/RPMS/*
103
    - export QDB_TEST_TIMEOUT="default"
Georgios Bitzes's avatar
Georgios Bitzes committed
104
    - quarkdb-tests
105
    - export GTEST_TOTAL_SHARDS=100
106
107
    - MAX_SHARD=$((GTEST_TOTAL_SHARDS - 1))
    - for i in $(seq 0 ${MAX_SHARD}); do export GTEST_SHARD_INDEX=$i; quarkdb-stress-tests; done
Georgios Bitzes's avatar
Georgios Bitzes committed
108

109
rpms:
Georgios Bitzes's avatar
Georgios Bitzes committed
110
  stage: publish
111
  image: gitlab-registry.cern.ch/eos/gitlab-eos/cc7:latest
Georgios Bitzes's avatar
Georgios Bitzes committed
112
113
  dependencies:
  - cc7
114
  - c8
115
  - fedora
Georgios Bitzes's avatar
Georgios Bitzes committed
116
  script:
117
   - yum install -y createrepo
118
   - automount
119
   - cat "$STCI_PASSWORD" | kinit stci
120
121
   - eosfusebind
   - for platform in cc7 c8 fedora; do packaging/repo-manager.py --action add --base /eos/project/s/storage-ci/www/quarkdb --ref ${CI_COMMIT_REF_NAME} --packages ${platform}/RPMS/* ${platform}/SRPMS/* ; done
Georgios Bitzes's avatar
Georgios Bitzes committed
122
  tags:
123
   - docker-privileged
124
  retry: 2
125
126
127
  only:
    - branches@eos/quarkdb
    - tags@eos/quarkdb
128

129
130
docs:
  stage: publish
131
  image: gitlab-registry.cern.ch/eos/gitlab-eos/cc7:latest
132
  script:
133
134
135
   - automount
   - cat "$STCI_PASSWORD" | kinit stci
   - eosfusebind
136
   - yum install -y npm git
137
138
139
140
141
142
143
144
   - npm install -g gitbook-cli
   - npm install gitbook
   - gitbook build
   - SNAPSHOT=$(date +%s)
   - TARGET="/eos/project/q/quarkdb/www/docs/${CI_COMMIT_REF_NAME}"
   - STAGING_AREA="$TARGET-${SNAPSHOT}"
   - cp -r _book "$STAGING_AREA"
   - packaging/replace-directory.sh "$STAGING_AREA" "$TARGET"
145
  tags:
146
   - docker-privileged
147
  retry: 2
148
149
150
  only:
    - branches@eos/quarkdb
    - tags@eos/quarkdb
151
152
153

coverage:
  stage: publish
154
  image: gitlab-registry.cern.ch/eos/gitlab-eos/cc7:latest
155
156
157
  dependencies:
  - ubuntu-asan
  script:
158
159
160
   - automount
   - cat "$STCI_PASSWORD" | kinit stci
   - eosfusebind
161
162
163
   - SNAPSHOT=$(date +%s)
   - TARGET="/eos/project/q/quarkdb/www/coverage/${CI_COMMIT_REF_NAME}"
   - STAGING_AREA="$TARGET-${SNAPSHOT}"
164
165
   - cp -r build/coverage-report "$STAGING_AREA"
   - packaging/replace-directory.sh "$STAGING_AREA" "$TARGET"
166
  tags:
167
   - docker-privileged
168
  retry: 2
169
170
171
  only:
    - branches@eos/quarkdb
    - tags@eos/quarkdb
172

173
174
175
176
177
178
179
180
181
182
183
184
185
cc7-koji-scratch:
  stage: koji
  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
  script:
    - yum install -y koji
    - yum install -y git rpm-build python python3
    - mkdir ~/.koji
    - cp ci/koji/config ~/.koji
    - echo "${QDBKOJI_PASSWORD}" | kinit qdbkoji
    - packaging/make-srpm.sh
    - koji build --scratch --wait quarkdb7 ./build/SRPMS/*.src.rpm
  when: manual

186
cc7-koji:
187
188
189
  stage: koji
  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
  script:
190
    - yum install -y koji
Georgios Bitzes's avatar
Georgios Bitzes committed
191
    - yum install -y git rpm-build python python3
192
193
194
195
    - mkdir ~/.koji
    - cp ci/koji/config ~/.koji
    - echo "${QDBKOJI_PASSWORD}" | kinit qdbkoji
    - packaging/make-srpm.sh
196
    - koji build --wait quarkdb7 ./build/SRPMS/*.src.rpm
197
198
    - cd build/SRPMS
    - TAG_NAME=$(echo *.src.rpm | python -c "import sys; inp = sys.stdin.readlines()[0][0:-1]; print('.'.join(inp.split('.')[0:-2])); ")
199
    - koji tag-build quarkdb7-qa ${TAG_NAME}
200
    - koji tag-build quarkdb7-stable ${TAG_NAME}
Georgios Bitzes's avatar
Georgios Bitzes committed
201
  only:
202
    - tags@eos/quarkdb
203

Georgios Bitzes's avatar
Georgios Bitzes committed
204
205
206
207
208
209
210
211
212
213
214
215
216
217
c8-image:
  stage: build-image
  variables:
    TO: gitlab-registry.cern.ch/eos/quarkdb/build-image-c8
    DOCKER_FILE: ci/c8/Dockerfile
    NO_CACHE: 1
  script:
  - ""
  tags:
  - docker-image-build
  only:
    variables:
      - $BUILD_IMAGES == "1"

218
219
220
cc7-image:
  stage: build-image
  variables:
221
    TO: gitlab-registry.cern.ch/eos/quarkdb/build-image-cc7
222
    DOCKER_FILE: ci/cc7/Dockerfile
223
    NO_CACHE: 1
224
225
226
227
228
229
230
  script:
  - ""
  tags:
  - docker-image-build
  only:
    variables:
      - $BUILD_IMAGES == "1"
231
232
233
234
235
236

fedora-image:
  stage: build-image
  variables:
    TO: gitlab-registry.cern.ch/eos/quarkdb/build-image-fedora
    DOCKER_FILE: ci/fedora/Dockerfile
237
    NO_CACHE: 1
238
239
240
241
242
243
244
245
246
247
248
249
250
  script:
  - ""
  tags:
  - docker-image-build
  only:
    variables:
      - $BUILD_IMAGES == "1"

ubuntu-image:
  stage: build-image
  variables:
    TO: gitlab-registry.cern.ch/eos/quarkdb/build-image-ubuntu
    DOCKER_FILE: ci/ubuntu/Dockerfile
251
    NO_CACHE: 1
252
253
254
255
256
257
258
  script:
  - ""
  tags:
  - docker-image-build
  only:
    variables:
      - $BUILD_IMAGES == "1"