-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
88 lines (78 loc) · 1.74 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
77
78
79
80
81
82
83
84
85
86
87
88
---
image: gitlab-registry.cern.ch/db/cc7-base-koji
variables:
KOJI_TARGET: 'db7'
DIST: '.el7.cern'
PKGNAME: cerndb-sw-dbod-core
SPECFILE: dbod-core
# KRB_USER, KRB_PASSWORD defined as Gitlab-CI variables
stages:
- sources
- srpm
- rpm
- kscratch
- kbuild
- deploy_qa
- deploy_stable
sources:
stage: sources
script:
- make sources
artifacts:
paths:
- ${PKGNAME}-*.tar.gz
expire_in: 1 hour
build_srpm:
stage: srpm
script:
- make srpm
artifacts:
paths:
- SRPMS/${PKGNAME}-*.src.rpm
expire_in: 1 hour
build_rpm:
stage: rpm
script:
- yum -y install perl-Module-Install perl-File-ShareDir
- make rpm
artifacts:
paths:
- RPMS/x86_64/${PKGNAME}-*.rpm
expire_in: 1 hour
.koji_deps_template: &koji_deps
before_script:
- echo $KRB_PWD | kinit [email protected]
kscratch:
<<: *koji_deps
stage: kscratch
script:
- koji --config=.koji build --wait --scratch $KOJI_TARGET SRPMS/${PKGNAME}*src.rpm
kbuild:
<<: *koji_deps
stage: kbuild
only:
- master
script:
- koji --config=.koji build --wait $KOJI_TARGET SRPMS/${PKGNAME}*src.rpm
tag_qa:
<<: *koji_deps
stage: deploy_qa
only:
- master
script:
- export P_V_R_D=$(rpm -q --specfile ${SPECFILE}.spec -D "dist ${DIST}" --qf "%{n}-%{v}-%{r}" 2>/dev/null)
- koji --config=.koji tag-build ${KOJI_TARGET}-qa ${P_V_R_D}
allow_failure: false
dependencies: []
tag_stable:
<<: *koji_deps
stage: deploy_stable
when: manual
only:
- master
script:
- export P_V_R_D=$(rpm -q --specfile ${SPECFILE}.spec -D "dist ${DIST}" --qf "%{n}-%{v}-%{r}" 2>/dev/null)
- koji --config=.koji tag-build ${KOJI_TARGET}-stable ${P_V_R_D}
allow_failure: false
dependencies:
- tag_qa