Commit cba7ffaa authored by Kamil Trzciński's avatar Kamil Trzciński 🔴

Rename gitlab_ci_multi_runner to gitlab_runner

parent 5c8afafd
NAME ?= gitlab-ci-multi-runner
PACKAGE_NAME ?= $(NAME)
PACKAGE_CONFLICT ?= $(NAME)-beta
PACKAGE_CONFLICT ?= $(PACKAGE_NAME)-beta
REVISION := $(shell git rev-parse --short HEAD || echo unknown)
VERSION := $(shell git describe --tags || cat VERSION || echo dev)
VERSION := $(shell echo $(VERSION) | sed -e 's/^v//g')
......@@ -106,6 +106,7 @@ package-deb-fpm:
--vendor "ayufan.eu" \
--conflicts $(PACKAGE_CONFLICT) \
-a $(PACKAGE_ARCH) \
packaging/root=/ \
out/binaries/$(NAME)-linux-$(ARCH)=/usr/bin/gitlab-ci-multi-runner
package-rpm-fpm:
......@@ -123,6 +124,7 @@ package-rpm-fpm:
--vendor "ayufan.eu" \
--conflicts $(PACKAGE_CONFLICT) \
-a $(PACKAGE_ARCH) \
packaging/root=/ \
out/binaries/$(NAME)-linux-$(ARCH)=/usr/bin/gitlab-ci-multi-runner
packagecloud: packagecloud-deps packagecloud-deb packagecloud-rpm
......
......@@ -11,7 +11,7 @@ import (
)
const (
defaultServiceName = "gitlab-ci-multi-runner"
defaultServiceName = "gitlab-runner"
defaultDisplayName = "GitLab Runner"
defaultDescription = "GitLab Runner"
)
......
gitlab-ci-multi-runner
\ No newline at end of file
#!/bin/sh
set -e
# detect user: first try to use gitlab_ci_multi_runner
for USER in gitlab_ci_multi_runner gitlab_runner; do
if id -u "$USER" &>/dev/null; then
echo "GitLab Runner: detected $USER"
continue
fi
done
# create user if doesn't exist: it will create gitlab_runner if not found
if ! id -u "$USER" &>/dev/null; then
echo "GitLab Runner: creating $USER"
useradd --comment 'GitLab Runner' --create-home $USER
fi
# add user to docker group to allow Docker access (insecure)
if usermod -aG docker $USER; then
echo "GitLab Runner: added $USER to docker group (insecure)"
fi
# create empty config and re-register runner
eval HOMEDIR=~$USER
cd $HOMEDIR
touch config.toml
chown $USER:$USER config.toml
chmod 0600 config.toml
# re-register runner
gitlab-ci-multi-runner stop &>/dev/null || :
gitlab-ci-multi-runner uninstall &>/dev/null || :
gitlab-ci-multi-runner install --user=$USER
# start runner service
service gitlab-ci-multi-runner start || :
#!/bin/sh
set -e
gitlab-ci-multi-runner stop || :
gitlab-ci-multi-runner uninstall || :
#!/bin/sh
set -e
USER=gitlab_ci_multi_runner
case "$1" in
abort-upgrade|abort-remove|abort-deconfigure)
;;
configure)
if ! id -u "$USER" >/dev/null 2>/dev/null; then
useradd --comment 'GitLab Runner' --create-home $USER
fi
usermod -aG docker $USER || true
eval HOMEDIR=~$USER
cd $HOMEDIR
touch config.toml
chown $USER:$USER config.toml
chmod 0600 config.toml
gitlab-ci-multi-runner stop || :
gitlab-ci-multi-runner uninstall || :
gitlab-ci-multi-runner install --user=$USER
service gitlab-ci-multi-runner start || :
/usr/share/gitlab-runner/post-install
;;
*)
......
#!/bin/sh
set -e
USER=gitlab_ci_multi_runner
if ! id -u "$USER" >/dev/null 2>/dev/null; then
useradd --comment 'GitLab Runner' --create-home $USER
fi
usermod -aG docker $USER || true
eval HOMEDIR=~$USER
cd $HOMEDIR
touch config.toml
chown $USER:$USER config.toml
chmod 0600 config.toml
gitlab-ci-multi-runner stop || :
gitlab-ci-multi-runner uninstall || :
gitlab-ci-multi-runner install --user=$USER
service gitlab-ci-multi-runner start || :
exit 0
/usr/share/gitlab-runner/post-install
#!/bin/sh
set -e
gitlab-ci-multi-runner stop || :
gitlab-ci-multi-runner uninstall || :
/usr/share/gitlab-runner/pre-remove
......@@ -2,6 +2,5 @@
if [ "x$1" = "x0" ]; then
set -e
gitlab-ci-multi-runner stop || :
gitlab-ci-multi-runner uninstall || :
/usr/share/gitlab-runner/pre-remove
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment