forked from redhat-cip/dci-pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdci-pipeline.spec
138 lines (117 loc) · 3.61 KB
/
dci-pipeline.spec
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
%if 0%{?rhel} && 0%{?rhel} < 8
%global with_python2 1
%global python_sitelib %{python2_sitelib}
%else
%global with_python3 1
%global python_sitelib %{python3_sitelib}
%endif
Name: dci-pipeline
Version: 0.0.3
Release: 4.VERS%{?dist}
Summary: CI pipeline management for DCI jobs
License: ASL 2.0
# TODO: actually mirror on github
URL: https://github.com/redhat-cip/%{name}
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
%if 0%{?with_python2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
Requires: PyYAML
Requires: python2-dciclient
Requires: python2-ansible-runner
Requires: python-prettytable
Requires: python2-junit_xml
%endif
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python3-PyYAML
Requires: python3-dciclient
Requires: python3-ansible-runner
Requires: python3-junit_xml
%endif
BuildRequires: systemd
%{?systemd_requires}
Requires(pre): shadow-utils
Requires: ansible
Requires: dci-ansible
Requires: /usr/bin/sudo
%description
CI pipeline management for DCI jobs
%prep -a -v
%autosetup -n %{name}-%{version}
%build
%if 0%{?with_python2}
%py2_build
%endif
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python2}
%py2_install
%endif
%if 0%{?with_python3}
%py3_install
%endif
install -p -D -m 644 systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
install -p -D -m 644 systemd/%{name}.timer %{buildroot}%{_unitdir}/%{name}.timer
install -p -D -m 644 sysconfig/%{name} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}
install -d -m 755 %{buildroot}%{_sysconfdir}/bash_completion.d
install -p -D -m 644 dciqueue/dci-queue.bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/dci-queue
install -d -m 700 %{buildroot}/var/lib/%{name}
install -p -D -m 440 %{name}.sudo %{buildroot}%{_sysconfdir}/sudoers.d/%{name}
cat > %{buildroot}%{_sysconfdir}/%{name}/pipeline.yml <<EOF
---
EOF
%pre
getent group %{name} >/dev/null || groupadd -r %{name}
getent passwd %{name} >/dev/null || \
useradd -m -g %{name} -d %{_sharedstatedir}/%{name} -s /bin/bash \
-c "%{summary}" %{name}
exit 0
%post
%systemd_post %{name}.service
%systemd_preun %{name}.timer
%preun
%systemd_preun %{name}.service
%systemd_preun %{name}.timer
%postun
%systemd_postun %{name}.service
%systemd_postun %{name}.timer
%files
%license LICENSE
%doc README.md
%if 0%{?with_python2}
%{python2_sitelib}/*
%else
%{python3_sitelib}/*
%endif
%{_bindir}/%{name}
%{_bindir}/dci-queue
%{_bindir}/dci-rebuild-pipeline
%{_bindir}/dci-diff-pipeline
%attr(770, %{name}, %{name}) /var/lib/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/pipeline.yml
%config(noreplace) %{_sysconfdir}/bash_completion.d/dci-queue
%{_unitdir}/dci-pipeline.service
%{_unitdir}/dci-pipeline.timer
%{_sysconfdir}/sudoers.d/%{name}
%changelog
* Fri May 7 2021 Frederic Lepied <[email protected]> - 0.0.3-4
- requires junit-xml
* Mon Jan 12 2021 Yassine Lamgarchal <[email protected]> - 0.0.3-3
- add dci-diff-pipeline
* Mon Jan 11 2021 Yassine Lamgarchal <[email protected]> - 0.0.3-2
- add dci-rebuild-pipeline
* Fri Sep 25 2020 Frederic Lepied <[email protected]> - 0.0.3-1
- provide a bash completion file
* Thu Sep 10 2020 Frederic Lepied <[email protected]> - 0.0.2-1
- add dci-queue files
* Fri Aug 21 2020 Frederic Lepied <[email protected]> - 0.0.1-2
- add /var/lib/dci-pipeline directory
* Tue Aug 11 2020 Jorge A Gallegos <[email protected]> - 0.0.1-1
- Initial build