Skip to content

Commit

Permalink
server: provide resalloc-wait-for-ssh command
Browse files Browse the repository at this point in the history
This is a convenience script usable by multiple plugins like
resalloc-aws or resalloc-openstack.
  • Loading branch information
praiskup committed Feb 27, 2024
1 parent fddb704 commit 7d39467
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions rpm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.spec
noarch/
resalloc*/
wait-for-ssh
2 changes: 1 addition & 1 deletion rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $(tarball): clean

srpm: $(tarball) $(spec)
rm -rf *.src.rpm
rpmbuild -bs $(rpmbuild_options) $(spec)
rpmbuild -bs --define _disable_source_fetch\ 0 $(rpmbuild_options) $(spec)

rpm: srpm
rpmbuild --rebuild *.src.rpm --define "_rpmdir $(PWD)"
Expand Down
7 changes: 7 additions & 0 deletions rpm/resalloc.spec.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Source5: resalloc-agent-spawner.service
Source2: logrotate
Source3: merge-hook-logs
Source4: cron.hourly
# GPL-2.0-or-later too
Source6: https://raw.githubusercontent.com/praiskup/wait-for-ssh/main/wait-for-ssh

%description
%desc
Expand Down Expand Up @@ -207,10 +209,13 @@ rm -r resalloc_agent_spawner

%build
%if %{with python2}
python=%__python2
%py2_build
%else
%py3_build
python=%__python3
%endif
sed "1c#! $python" %SOURCE6 > %{name}-wait-for-ssh


%install
Expand Down Expand Up @@ -241,6 +246,7 @@ install -d -m 755 %buildroot/%_libexecdir
install -p -m 755 %SOURCE3 %buildroot/%_libexecdir/%name-merge-hook-logs
install -d %buildroot%_sysconfdir/cron.hourly
install -p -m 755 %SOURCE4 %buildroot%_sysconfdir/cron.hourly/resalloc
install -p -m 755 %name-wait-for-ssh %buildroot%_bindir/%name-wait-for-ssh

%if %{without python3}
rm %buildroot%_bindir/%name-agent-*
Expand Down Expand Up @@ -318,6 +324,7 @@ ln -s "%{default_sitelib}/%{name}server" %buildroot%_homedir/project
%{_bindir}/%{name}-server
%{_bindir}/%{name}-maint
%{_bindir}/%{name}-check-vm-ip
%{_bindir}/%{name}-wait-for-ssh
%attr(0750, %sysuser, %sysgroup) %dir %{_sysconfdir}/%{name}server
%config(noreplace) %{_sysconfdir}/%{name}server/*
%_unitdir/resalloc.service
Expand Down

0 comments on commit 7d39467

Please sign in to comment.