forked from OSInside/kiwi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
151 lines (141 loc) · 3.66 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
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
148
149
150
151
stages:
- test
- documentation
- deploy
- sourcepackage
- packages
variables:
LANG: en_US.UTF-8
BUILD_IMAGES_PROJECT: kiwi3/kiwi-ci-containers
TUMBLEWEED_BUILD: buildenv-tumbleweed
FEDORA_BUILD: buildenv-fedora
code_style:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
stage: test
script:
- tox -e check
cache:
key: "$CI_JOB_NAME"
paths:
- .tox/3
unit_py36:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
stage: test
script:
- export PYTHON=python3.6
- tox -e unit_py3_6 "-n $(nproc)"
cache:
key: "$CI_JOB_NAME"
paths:
- .tox/3.6
unit_py37:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
stage: test
script:
- export PYTHON=python3.7
- tox -e unit_py3_7 "-n $(nproc)"
cache:
key: "$CI_JOB_NAME"
paths:
- .tox/3.7
build_doc:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
stage: documentation
script:
- tox -e packagedoc
artifacts:
paths:
- doc/build/
cache:
key: "$CI_JOB_NAME"
paths:
- doc/build
build_suse_doc:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
stage: documentation
script:
- tox -e doc_suse
artifacts:
paths:
- doc/build/
push_suse_doc:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
stage: deploy
only:
- master
script:
- "export GIT_SSH=$(pwd)/run_ssh"
- "export ID_DOC_SUSE=$(pwd)/id_doc_suse"
- echo 'exec ssh -o StrictHostKeyChecking=no -i $ID_DOC_SUSE "$@"' > run_ssh
- chmod u+x run_ssh
- base64 --decode "$DOC_SUSE_SECRET" > id_doc_suse
- chmod 600 id_doc_suse
- git clone [email protected]:OSInside/kiwi-suse-doc.git /tmp/kiwi-suse-doc
- cp doc/DC-kiwi /tmp/kiwi-suse-doc/doc/build
- cp doc/source/.images/* /tmp/kiwi-suse-doc/doc/build/images/src/png
- cp doc/build/xml/book.xml /tmp/kiwi-suse-doc/doc/build/xml
- git config --global user.email "[email protected]"
- git config --global user.name "SUSE KIWI Team"
- cd /tmp/kiwi-suse-doc
- git add .
- git commit -a -m "upstream sync" && git push || true
dependencies:
- build_suse_doc
rpm_source_package:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
stage: sourcepackage
script:
- groupadd -f -g 135 -r mock # workaround RHBZ#1740545
- 'sed -i "s|build: clean tox|build:|" Makefile'
- make build
- mv dist/python-kiwi.spec .
- rm dist/python-kiwi.changes
- >
mock
--isolation=simple -r /etc/mock/fedora-30-x86_64.cfg
--buildsrpm --sources ./dist
--resultdir $(pwd)/mock-result-srpm
--spec ./python-kiwi.spec 2>&1 | tee srpm_build_out
artifacts:
when: always
paths:
- srpm_build_out
- mock-result-srpm
expire_in: 1 week
rpm_fedora_30:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
stage: packages
script:
- "export SRC_RPM=$(ls mock-result-srpm/*kiwi*)"
- cp $SRC_RPM .
- >
mock
--isolation=simple
--resultdir $(pwd)/mock-result-fedora
-r /etc/mock/fedora-30-x86_64.cfg $(basename $SRC_RPM)
artifacts:
when: always
paths:
- mock-result-fedora
expire_in: 1 week
dependencies:
- rpm_source_package
rpm_suse_TW:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
stage: packages
script:
- "export SRC_RPM=$(ls mock-result-srpm/*kiwi*)"
- cp $SRC_RPM .
- >
mock
--isolation=simple
--resultdir $(pwd)/mock-result-tw
-r /etc/mock/opensuse-tumbleweed-x86_64.cfg $(basename $SRC_RPM)
artifacts:
when: always
paths:
- mock-result-tw
expire_in: 1 week
allow_failure: true
dependencies:
- rpm_source_package