-
Notifications
You must be signed in to change notification settings - Fork 5
/
puppet-jens.spec
209 lines (165 loc) · 7.53 KB
/
puppet-jens.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
Summary: Jens is a Puppet modules/hostgroups librarian
Name: puppet-jens
Version: 1.4.1
Release: 2%{?dist}
License: GPLv3
Group: Applications/System
URL: https://github.com/cernops/jens
Source: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
BuildRequires: systemd-rpm-macros, python3-devel, epel-rpm-macros
# The following requires are for the %check
BuildRequires: python3-pyyaml, python3-urllib3, python3-configobj
BuildRequires: python3-dirq, python3-flask, python3-GitPython, git
Requires: git
Requires(pre): shadow-utils
%description
Python toolkit to generate Puppet environments dynamically
based on files containing metadata.
%prep
%setup -q
%build
%py3_build
%install
%{__rm} -rf %{buildroot}
%py3_install
%{__install} -D -p -m 644 conf/main.conf %{buildroot}/%{_sysconfdir}/jens/main.conf
mkdir -m 755 -p %{buildroot}/%{_mandir}/man1
%{__install} -D -p -m 644 man/* %{buildroot}/%{_mandir}/man1
mkdir -m 750 -p %{buildroot}/var/lib/jens/bare/modules
mkdir -m 750 -p %{buildroot}/var/lib/jens/bare/hostgroups
mkdir -m 750 -p %{buildroot}/var/lib/jens/bare/common
mkdir -m 750 -p %{buildroot}/var/lib/jens/clone/modules
mkdir -m 750 -p %{buildroot}/var/lib/jens/clone/hostgroups
mkdir -m 750 -p %{buildroot}/var/lib/jens/clone/common
mkdir -m 750 -p %{buildroot}/var/lib/jens/cache/environments
mkdir -m 750 -p %{buildroot}/var/lib/jens/environments
mkdir -m 750 -p %{buildroot}/var/lib/jens/metadata
mkdir -m 750 -p %{buildroot}/var/log/jens/
mkdir -m 750 -p %{buildroot}/var/spool/jens-update/
mkdir -m 750 -p %{buildroot}/var/www/jens
%{__install} -D -p -m 755 wsgi/* %{buildroot}/var/www/jens
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 0644 jens-tmpfiles.conf %{buildroot}%{_tmpfilesdir}/%{name}.conf
mkdir -p %{buildroot}%{_unitdir}
install -p -m 644 systemd/jens-update.service %{buildroot}%{_unitdir}/jens-update.service
install -p -m 644 systemd/jens-purge-queue.service %{buildroot}%{_unitdir}/jens-purge-queue.service
%check
export EMAIL="[email protected]"
export GIT_AUTHOR_NAME="RPM build"
export GIT_COMMITTER_NAME="RPM build"
%{__python3} -m unittest
%clean
%{__rm} -rf %{buildroot}
%pre
/usr/bin/getent group jens || /usr/sbin/groupadd -r jens
/usr/bin/getent passwd jens || /usr/sbin/useradd -r -g jens -d /var/lib/jens -s /sbin/nologin jens
%files
%defattr(-,root,root,-)
%doc README.md ENVIRONMENTS.md examples
%{_mandir}/man1/*
/var/www/jens/*
%{python3_sitelib}/*
%{_bindir}/jens-*
%attr(750, jens, jens) /var/lib/jens/*
%attr(750, jens, jens) /var/log/jens
%attr(750, jens, jens) /var/spool/jens-update
%config(noreplace) %{_sysconfdir}/jens/main.conf
%{_tmpfilesdir}/%{name}.conf
%{_unitdir}/jens-update.service
%{_unitdir}/jens-purge-queue.service
%changelog
* Wed Jun 28 2023 Nacho Barrientos <[email protected]> - 1.4.1-2
- Rebuild for RHEL9.
* Fri Mar 24 2023 Nacho Barrientos <[email protected]> - 1.4.1-1
- Switch to Setuptools.
- Adapt SPEC file so the software builds in EL9.
- Run unit tests too when the RPM is built.
- Use built-in unittest.mock instead of mock.
* Mon Mar 13 2023 Nacho Barrientos <[email protected]> - 1.4.0-1
- Gitlab producer: Return 201 if the hint can be enqueued.
- Gitlab producer: Return 200 if the hinted repository is not part of the library.
* Tue Jan 17 2023 Nacho Barrientos <[email protected]> - 1.3.0-1
- Switch to semanting versioning.
- Add support for Gitlab webhook tokens.
- Use Python's unittest runner.
- Close file descriptions explicitly.
- Some Python-3 related code changes: f-strings, super(), etc.
* Tue May 11 2021 Nacho Barrientos <[email protected]> - 1.2-2
- Rebuild for CentOS Stream 8
* Wed Oct 28 2020 Nacho Barrientos <[email protected]> - 1.2-1
- Ship systemd service unit files for jens-update and jens-purge-queue.
* Tue Jul 07 2020 Nacho Barrientos <[email protected]> - 1.1-1
- Python3-only compatibility.
- Use tmpfiles.d to create the lock directory.
* Mon Jun 29 2020 Nacho Barrientos <[email protected]> - 0.25-1
- Minor fixes to the Spec file.
* Mon Jun 11 2018 Nacho Barrientos <[email protected]> - 0.24-1
- Migrate from optparse to argparse.
* Tue Apr 03 2018 Nacho Barrientos <[email protected]> - 0.23-1
- Python 3.x compatibility.
- Spelling and broken links in the documentation.
* Mon Mar 20 2017 Nacho Barrientos <[email protected]> - 0.22-1
- A big bunch of Lint fixes, no new functionality nor bugfixes.
* Wed Jan 11 2017 Nacho Barrientos <[email protected]> - 0.21-1
- Make sure that settings.ENVIRONMENTSDIR exists.
- Add the process ID to the log messages.
- Show the new HEAD when a clone has been updated.
* Wed Nov 09 2016 Nacho Barrientos <[email protected]> - 0.20-1
- Handle AssertionError when doing Git ops
* Tue Nov 08 2016 Nacho Barrientos <[email protected]> - 0.19-1
- Add an option to protect environments.
* Tue Nov 01 2016 Nacho Barrientos <[email protected]> - 0.18-1
- Add jens-purge-queue.
* Wed Jul 27 2016 Nacho Barrientos <[email protected]> - 0.17-1
- Transform the Settings class into a Borg.
- Add an option to set GIT_SSH (fixes AI-4385).
* Tue Jul 19 2016 Nacho Barrientos <[email protected]> - 0.16-1
- Fix git_wrapper so reset(hard=True) actually works.
* Wed Jul 13 2016 Nacho Barrientos <[email protected]> - 0.15-1
- Configure GitPython differently to avoid leaking file descriptors as per
upstream's recommendation.
* Tue Jul 12 2016 Nacho Barrientos <[email protected]> - 0.14-1
- Remove support for etcd.
- Use GitPython for Git operations instead of subprocessing directly.
* Tue Mar 29 2016 Nacho Barrientos <[email protected]> - 0.13-1
- Allow setting 'parser' in environment.conf
* Mon Jan 11 2016 Nacho Barrientos <[email protected]> - 0.12-1
- Add on-demand mode to jens-update.
- Add webapps/gitlabproducer.
* Thu Sep 03 2015 Nacho Barrientos <[email protected]> - 0.11-2
- Prevent RPM from replacing the configuration file.
* Thu Sep 03 2015 Nacho Barrientos <[email protected]> - 0.11-1
- Support variable number of elements in common hieradata.
* Wed Nov 19 2014 Nacho Barrientos <[email protected]> - 0.10-1
- Add support for directory environments
- Add tons of user documentation (README, ENVIRONMENTS, INSTALL)
* Wed Aug 13 2014 Nacho Barrientos <[email protected]> - 0.9-1
- Reset instead of merge when refreshing metadata.
- Add a new testsuite for the metadata refreshing step.
- Add more assertion to some tests.
* Tue May 13 2014 Nacho Barrientos <[email protected]> - 0.8-1
- Ignore malformed keys when reading the desided inventory.
* Mon Mar 31 2014 Nacho Barrientos <[email protected]> - 0.7-1
- Set GIT_HTTP_LOW_SPEED_LIMIT
- Relative path for Git bin
* Tue Mar 18 2014 Nacho Barrientos <[email protected]> - 0.6-1
- No hard timeouts.
- Shared objects for static clones.
* Mon Mar 10 2014 Nacho Barrientos <[email protected]> - 0.5-1
- Add support for etcd locks.
- Add support for commits as overrides.
- Only expand required branches/commits.
- Add soft and hard timeouts for Git calls.
* Tue Oct 01 2013 Nacho Barrientos <[email protected]> - 0.4-1
- Be more chatty about new/changed/deleted branches
- Stop checking for broken links
- Use relative links when binding environments to clones
- Use fcntl to gain the lock
* Wed Sep 11 2013 Nacho Barrientos <[email protected]> - 0.3-1
- Only inform about broken overrides.
* Wed Sep 04 2013 Ben Jones <[email protected]> - 0.2-1
- git clones now reset rather than merged
* Mon Jul 09 2012 Nacho Barrientos <[email protected]> - 0.1-1
- Initial release