61 lines
1.6 KiB
Plaintext
61 lines
1.6 KiB
Plaintext
%define debug_package %{nil}
|
|
|
|
Name: netoik-cicd
|
|
Version: %(make version)
|
|
Release: 1%{?dist}
|
|
Summary: Netoik Continuous Deployment tool
|
|
|
|
License: GPLv3
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
BuildArch: x86_64
|
|
BuildRequires: make
|
|
Requires: bash,rpm-build,rpmdevtools,inotify-tools
|
|
|
|
%description
|
|
Netoik Continuous Deployment tool
|
|
|
|
%prep
|
|
%autosetup -v
|
|
|
|
%build
|
|
%make_build
|
|
|
|
%install
|
|
%make_install
|
|
|
|
%pre
|
|
# Build rpm setuptree if not already done.
|
|
runuser --login git --command "rpmdev-setuptree"
|
|
|
|
%post
|
|
# Reload systemctl daemon and (re)start service.
|
|
systemctl daemon-reload
|
|
systemctl restart %{name}-deployer.service
|
|
systemctl enable %{name}-deployer.service
|
|
|
|
%preun
|
|
# Stop service only if uninstalling.
|
|
if [ $1 -eq 0 ]; then
|
|
systemctl disable --now %{name}-deployer.service
|
|
fi
|
|
|
|
%postun
|
|
# Reload systemctl daemon only if uninstalling.
|
|
if [ $1 -eq 0 ]; then
|
|
systemctl daemon-reload
|
|
fi
|
|
|
|
%files
|
|
%attr(755, root, root) %dir %{_sysconfdir}/%{name}
|
|
%attr(644, root, root) %config(noreplace) %{_sysconfdir}/%{name}/deployer.conf
|
|
%attr(644, root, root) %{_sysconfdir}/%{name}/deployer.conf.sample
|
|
%attr(644, root, root) %{_sysconfdir}/profile.d/%{name}-git.sh
|
|
%attr(644, root, root) %{_unitdir}/%{name}-deployer.service
|
|
%attr(755, root, root) %{_bindir}/%{name}-deployer
|
|
%attr(755, root, root) %{_bindir}/%{name}-newtag
|
|
%attr(755, root, root) %dir %{_tmppath}/%{name}
|
|
%attr(755, root, root) %dir %{_tmppath}/%{name}/deployer
|
|
%attr(775, root, git) %dir %{_tmppath}/%{name}/deployer/request
|
|
%attr(775, root, root) %dir %{_tmppath}/%{name}/deployer/response
|