forked from podengo-project/ipa-hcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
100 lines (95 loc) · 2.23 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
---
stages:
- check
- srpm
- rpms
- test
tox_check:
tags:
- shared
image: quay.io/tiran/ipa-hcc-ci:fedora
stage: check
needs: []
parallel:
matrix:
- TOXENV:
- py,py36,py39,cov
- ruff,mypy,pylint
- jslint,yamllint,maketest
script:
- tox -e $TOXENV
only:
- merge_requests
srpm:
tags:
- shared
stage: srpm
needs: []
image: quay.io/tiran/ipa-hcc-ci:fedora
before_script:
- dnf install -y 'dnf-command(builddep)'
- mkdir -p $CI_PROJECT_DIR/rpkg
script:
- rpkg spec --outdir $CI_PROJECT_DIR/rpkg
- dnf builddep -y --spec $CI_PROJECT_DIR/rpkg/ipa-hcc.spec
- rpkg local --outdir $CI_PROJECT_DIR/rpkg
artifacts:
name: srpm
when: on_success
expire_in: "30 days"
paths:
- rpkg/ipa-hcc.spec
- rpkg/ipa-hcc*.src.rpm
only:
- merge_requests
rpms:
tags:
- shared
stage: rpms
needs: ["srpm"]
parallel:
matrix:
- VERSION:
- 8
- 9
image: quay.io/tiran/ipa-hcc-ci:$VERSION
before_script:
- export RPMBUILD=$CI_PROJECT_DIR/rpmbuild/$VERSION
- export RPKG_DIR=$CI_PROJECT_DIR/rpkg
- echo $RPMBUILD
- find $RPKG_DIR -type f
# use our RPM build dir as top directory for rpmbuild
- echo "%_topdir $RPMBUILD" > ~/.rpmmacros
- mkdir -p $RPMBUILD
script:
# install deps
- yum-builddep -y $RPKG_DIR/ipa-hcc.spec
# rebuild binary packages from source file
- rpmbuild --rebuild $RPKG_DIR/ipa-hcc*.src.rpm
- find $RPMBUILD/RPMS -type f
# create repo structure
- createrepo $RPMBUILD/RPMS
- |
cat > $CI_PROJECT_DIR/ipa-hcc-$VERSION.repo << EOF
[ipa-hcc-$VERSION]
name=ipa-hcc-$VERSION
baseurl=file://$RPMBUILD/RPMS
gpgcheck=0
enabled=1
EOF
# test repo installation
- cp $CI_PROJECT_DIR/ipa-hcc-$VERSION.repo /etc/yum.repos.d/
- yum search -q ipa-hcc
artifacts:
name: rpm-$VERSION
when: on_success
expire_in: "30 days"
paths:
- rpmbuild/$VERSION/RPMS/
- ipa-hcc-$VERSION.repo
only:
- merge_requests
# stage: test
include:
- remote: 'https://gitlab.cee.redhat.com/identity-management/idm-ci/-/raw/production/gitlab_template/qew.yml'
- local: '.gitlab-idm-ci.yml'