dev-0x7C6 / dev1990-overlay

My gentoo overlay, there's a ebuild for separate qtsdk workspaces if you want to develop with many qtsdks, slic3r prusa edition and some ebuilds for my projects, and other stuff that I'm using or used
6 stars 1 forks source link

gitlab-runner init script #4

Closed SWSAmor closed 4 years ago

SWSAmor commented 4 years ago

Hi! Thank you for the overlay. We use gitlab-runner with this config script (/etc/conf.d/gitlab-runner)

# config file for /etc/init.d/gitlab-runner

RUNNER_USER="gitlab-runner"
RUNNER_DATADIR="/var/lib/gitlab-runner"
RUNNER_LOGDIR="/var/log/gitlab-runner"
RUNNER_CONFIG="/etc/gitlab-runner/config.toml"

# Additional options (avoid --config, use the variable above)
# run /usr/bin/gitlab-runner -h to see available options
RUNNER_OPTS="-u ${RUNNER_USER} -d ${RUNNER_DATADIR}"

# Logging
#output_log="${RUNNER_LOGDIR}/gitlab-runner.log"
#error_log="${RUNNER_LOGDIR}/error.log"

and with this init script (/etc/init.d/gitlab-runner)

#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

extra_started_commands="reload"
output_log="${output_log:-/dev/null}"
error_log="${error_log:-${RUNNER_LOGDIR}/error.log}"

name="${name:-GitLab Runner}"
command="/usr/bin/gitlab-runner"
command_args="run -c ${RUNNER_CONFIG} ${RUNNER_OPTS}"
command_background=true
pidfile="/run/${RC_SVCNAME}.pid"
required_files="${RUNNER_CONFIG}"
retry="${retry:-TERM/60/KILL/5}"
start_stop_daemon_args="${SSD_OPTS}"

depend() {
        need localmount net
        after sshd
}

start_pre() {
        checkpath -d -m 0700 -o "${RUNNER_USER}" "${RUNNER_DATADIR}"
        checkpath -d -m 0750 -o "${RUNNER_USER}" "${RUNNER_LOGDIR}"
}

reload() {
        ebegin "Reloading ${name} configuration"
        start-stop-daemon --signal HUP --pidfile "${pidfile}"
        eend $? "Failed to reload ${name}"
}

Would you put these into the package?

dev-0x7C6 commented 4 years ago

Hi,

Thanks for patches, I'll apply those changes this weekend.

I added gitlab-runner ebuild about 2-3 days ago and it's quite experimental. It has strange quirk that showing it's from development branch in GitLab UI. This is probably due missing flags in build stage.

Cheers, Bartłomiej

dev-0x7C6 commented 4 years ago

@SWSAmor I've added gitlab-runner-12.10.2-r1 with confd and initd. I'm using systemd so I wasn't able to test it properly.

SWSAmor commented 4 years ago

I tried and works perfectly. Thank you.