]> git.pld-linux.org Git - packages/gitlab-runner.git/commitdiff
add initscripts from upstream repo
authorElan Ruusamäe <glen@delfi.ee>
Fri, 4 Nov 2016 15:19:09 +0000 (17:19 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Fri, 4 Nov 2016 15:58:15 +0000 (17:58 +0200)
they got removed in v0.1.13-9-g3a14284
so this is what they were before removal

gitlab-ci-multi-runner.init [new file with mode: 0755]
gitlab-ci-multi-runner.service [new file with mode: 0644]
gitlab-ci-multi-runner.spec
gitlab-ci-multi-runner.sysconfig [new file with mode: 0644]

diff --git a/gitlab-ci-multi-runner.init b/gitlab-ci-multi-runner.init
new file mode 100755 (executable)
index 0000000..6e7546d
--- /dev/null
@@ -0,0 +1,81 @@
+#! /bin/bash
+
+### BEGIN INIT INFO
+# Provides:          gitlab-ci-multi-runner
+# Required-Start:    $local_fs $remote_fs $network $syslog
+# Required-Stop:     $local_fs $remote_fs $network $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: GitLab CI-Multi Runner init.d script
+# Description: Enables automatic start of runners at boot time in the background.
+### END INIT INFO
+
+DESC="GitLab CI-Multi Runner"
+USER="gitlab_ci_multi_runner"
+GROUP="gitlab_ci_multi_runner"
+CHDIR="~$USER"
+NAME="gitlab-ci-multi-runner"
+DAEMON="/usr/bin/gitlab-ci-multi-runner"
+PIDFILE="/var/run/gitlab-ci-multi-runner.pid"
+LOGFILE="/var/log/gitlab-ci-multi-runner.log"
+
+# Exit if the package is not installed
+if [ ! -x "$DAEMON" ]; then
+  echo "$DAEMON not present or not executable"
+  exit 1
+fi
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Define LSB log_* functions.
+. /lib/lsb/init-functions
+
+## Check to see if we are running as root first.
+if [ "$(id -u)" != "0" ]; then
+    echo "This script must be run as root"
+    exit 1
+fi
+
+eval CHDIR=$CHDIR
+
+do_start() {
+  start-stop-daemon --start \
+    --pidfile "$PIDFILE" \
+    --chdir "$CHDIR" \
+    --background \
+    --make-pidfile \
+    --chuid "$USER:$GROUP" \
+    --no-close \
+    --exec "$DAEMON" -- "run" &>> $LOGFILE
+}
+
+do_stop() {
+  start-stop-daemon --stop --pidfile "$PIDFILE" --user "$USER" --exec "$DAEMON" --quiet
+}
+
+case "$1" in
+  start)
+    log_daemon_msg "Starting $DESC"
+    do_start
+    log_end_msg $?
+    ;;
+  stop)
+    log_daemon_msg "Stopping $DESC"
+    do_stop
+    log_end_msg $?
+    ;;
+  restart)
+    $0 stop
+    $0 start
+    ;;
+  status)
+    status_of_proc -p "$PIDFILE" "$DAEMON" "$DESC"
+    ;;
+  *)
+    echo "Usage: sudo service gitlab-ci-multi-runner {start|stop|restart|status}" >&2
+    exit 1
+    ;;
+esac
+
+exit 0
diff --git a/gitlab-ci-multi-runner.service b/gitlab-ci-multi-runner.service
new file mode 100644 (file)
index 0000000..9bd226a
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# systemd unit file for CentOS 7, Ubuntu bleeding edge
+#
+[Unit]
+Description=GitLab CI-Multi Runner
+# start us only once the network and logging subsystems are available
+After=syslog.target network.target
+
+# See these pages for lots of options:
+# http://0pointer.de/public/systemd-man/systemd.service.html
+# http://0pointer.de/public/systemd-man/systemd.exec.html
+[Service]
+Type=simple
+User=gitlab_ci_multi_runner
+Group=gitlab_ci_multi_runner
+ExecStart=/usr/bin/gitlab-ci-multi-runner run
+
+# if we crash, restart
+RestartSec=1
+Restart=on-failure
+
+# use syslog for logging
+StandardOutput=syslog
+StandardError=syslog
+SyslogIdentifier=gitlab-ci-multi-runner
+
+[Install]
+WantedBy=multi-user.target
index 8ba9fb959c86758284dd670fd4639ab539b90549..440760c42ae962c0245f0f1e0380d4338ca7c24b 100644 (file)
@@ -11,7 +11,7 @@
 Summary:       The official GitLab CI runner written in Go
 Name:          gitlab-ci-multi-runner
 Version:       1.7.1
-Release:       1
+Release:       1.1
 License:       MIT
 Group:         Development/Building
 Source0:       https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/repository/archive.tar.gz?ref=v%{version}&/%{name}-%{version}.tar.gz
@@ -20,6 +20,9 @@ Source1:      https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/master/docker
 # Source1-md5: 0d89c7578a0b5d22a4ae85dcb7d5b4f5
 Source2:       https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/master/docker/prebuilt-arm.tar.xz
 # Source2-md5: c0533c581624dcb33095f08f06e6a00b
+Source3:       %{name}.init
+Source4:       %{name}.sysconfig
+Source5:       %{name}.service
 Patch0:                nodim_gz.patch
 Patch1:                branch-preserver.patch
 URL:           https://gitlab.com/gitlab-org/gitlab-ci-multi-runner
@@ -108,9 +111,12 @@ test "$v" = "%{version}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir}/gitlab-runner,%{_bindir},/var/lib/gitlab-runner/.gitlab-runner}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/gitlab-runner,%{_bindir},/etc/{rc.d/init.d,sysconfig},%{systemdunitdir},/var/lib/gitlab-runner/.gitlab-runner}
 
 install -p src/%{import_path}/%{name} $RPM_BUILD_ROOT%{_bindir}/gitlab-runner
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}
 
 # backward compat name for previous pld packaging
 ln -s gitlab-runner $RPM_BUILD_ROOT%{_bindir}/gitlab-ci-multi-runner
@@ -136,9 +142,12 @@ fi
 %files
 %defattr(644,root,root,755)
 %doc README.md CHANGELOG.md
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gitlab-ci-multi-runner
+%attr(754,root,root) /etc/rc.d/init.d/gitlab-ci-multi-runner
 %dir %attr(750,root,root) %{_sysconfdir}/gitlab-runner
 %attr(755,root,root) %{_bindir}/gitlab-ci-multi-runner
 %attr(755,root,root) %{_bindir}/gitlab-runner
+%{systemdunitdir}/gitlab-ci-multi-runner.service
 %dir %attr(750,gitlab-runner,gitlab-runner) /var/lib/gitlab-runner
 %dir %attr(750,gitlab-runner,gitlab-runner) /var/lib/gitlab-runner/.gitlab-runner
 
diff --git a/gitlab-ci-multi-runner.sysconfig b/gitlab-ci-multi-runner.sysconfig
new file mode 100644 (file)
index 0000000..802ac1f
--- /dev/null
@@ -0,0 +1 @@
+## TODO
This page took 0.101003 seconds and 4 git commands to generate.