Skip to content

Commit

Permalink
Fixes #28065 - package dynflow sidekiq service files
Browse files Browse the repository at this point in the history
  • Loading branch information
ezr-ondrej committed Oct 22, 2019
1 parent 78e71b4 commit d397dca
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions comps/comps-foreman-rhel7.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<packagereq type="default">foreman-cli</packagereq>
<packagereq type="default">foreman-console</packagereq>
<packagereq type="default">foreman-debug</packagereq>
<packagereq type="default">foreman-dynflow-sidekiq</packagereq>
<packagereq type="default">foreman-ec2</packagereq>
<packagereq type="default">foreman-gce</packagereq>
<packagereq type="default">foreman-journald</packagereq>
Expand Down
38 changes: 38 additions & 0 deletions packages/foreman/foreman/foreman.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
%global confdir extras/packaging/rpm/sources
%global foreman_rake %{_sbindir}/%{name}-rake
%global executor_service_name dynflowd
%global dynflow_sidekiq_service_name dynflow-sidekiq@
%global foreman_restart (touch %{homedir}/tmp/restart.txt ; /bin/systemctl try-restart %{name}.service) >/dev/null 2>&1

# explicitly define, as we build on top of an scl, not inside with scl_package
Expand Down Expand Up @@ -711,6 +712,43 @@ Meta Package to install requirements for Redis caching support
%files redis
%{_datadir}/%{name}/bundler.d/redis.rb

%package dynflow-sidekiq
Summary: Foreman Redis caching support
Group: Applications/System
# start specfile redis Requires
Requires: %{?scl_prefix}rubygem(sidekiq) >= 5.0
Requires: %{?scl_prefix}rubygem(sidekiq) < 6
Requires: %{?scl_prefix}rubygem(gitlab-sidekiq-fetcher)
# end specfile redis Requires
Requires: %{name} = %{version}-%{release}

%description dynflow-sidekiq
Meta Package to install dynflow sidekiq executor support

%files dynflow-sidekiq
%{_datadir}/%{name}/bundler.d/sidekiq.rb
%{_unitdir}/%{dynflow_sidekiq_service_name}.service
%{_datadir}/%{name}/extras/dynflow-sidekiq.rb

%install dynflow-sidekiq
install -Dp -m0644 extras/systemd/%{dynflow_sidekiq_service_name}.service %{buildroot}%{_unitdir}/%{dynflow_sidekiq_service_name}.service

sed -i '/^ExecStart/ s|/usr/bin/sidekiq \(.\+\)$|/usr/bin/scl enable tfm "sidekiq \1"|' %{buildroot}%{_unitdir}/%{dynflow_sidekiq_service_name}.service

for i in orchestrator.yml worker.yml; do
mv %{buildroot}%{_datadir}/%{name}/config/dynflow/$i %{buildroot}%{_sysconfdir}/%{name}/dynflow/
ln -sv %{_sysconfdir}/%{name}/$i %{buildroot}%{_datadir}/%{name}/config/$i
done

%post dynflow-sidekiq
%systemd_post %{dynflow_sidekiq_service_name}.service

%preun dynflow-sidekiq
%systemd_preun %{dynflow_sidekiq_service_name}.service

%postun dynflow-sidekiq
%systemd_postun_with_restart %{dynflow_sidekiq_service_name}.service

%package service
Summary: Foreman systemd service support
Group: Applications/System
Expand Down

0 comments on commit d397dca

Please sign in to comment.