Skip to content

Commit

Permalink
re-integrate migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
philfry committed Jul 4, 2023
1 parent 2d53cbe commit 60ddd68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rpm/build/SPECS/jenkins.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Summary: @@SUMMARY@@
Source: jenkins.war
Source1: jenkins.service
Source2: jenkins.sh
Source3: migrate.sh
URL: @@HOMEPAGE@@
License: @@LICENSE@@
BuildRoot: %{_tmppath}/build-%{name}-%{version}
Expand Down Expand Up @@ -40,6 +41,7 @@ rm -rf "%{buildroot}"
%__install -D -m0644 "%{SOURCE0}" "%{buildroot}%{_javadir}/%{name}.war"
%__install -D -m0644 "%{SOURCE1}" "%{buildroot}%{_unitdir}/%{name}.service"
%__install -D -m0755 "%{SOURCE2}" "%{buildroot}%{_bindir}/%{name}"
%__install -D -m0755 "%{SOURCE3}" "%{buildroot}%{_datadir}/%{name}/migrate"

%pre
/usr/bin/getent group %{name} &>/dev/null || /usr/sbin/groupadd -r %{name} &>/dev/null
Expand All @@ -48,11 +50,13 @@ rm -rf "%{buildroot}"
-d "%{workdir}" %{name} &>/dev/null

%post
%systemd_post %{name}.service
if [ $1 -eq 1 ]; then
%__install -d -m 0755 -o %{name} -g %{name} %{workdir}
%__install -d -m 0750 -o %{name} -g %{name} %{_localstatedir}/cache/%{name}
elif [ -f "%{_sysconfdir}/sysconfig/%{name}" ]; then
%{_datadir}/%{name}/migrate "/etc/sysconfig/%{name}" || true
fi
%systemd_post %{name}.service

%preun
if [ $1 -eq 0 ]; then
Expand Down

0 comments on commit 60ddd68

Please sign in to comment.