32 lines
763 B
Plaintext
32 lines
763 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
ENV_FILE=${ENV_FILE:-/var/run/one-context/one_env}
|
||
|
|
||
|
# $TOKENTXT is available only through the env. file
|
||
|
# shellcheck disable=SC1090
|
||
|
if [ -f "${ENV_FILE}" ]; then
|
||
|
. "${ENV_FILE}"
|
||
|
fi
|
||
|
|
||
|
###
|
||
|
|
||
|
if [ -n "${GITLAB_URL}" ]; then
|
||
|
if command -v gitlab-runner; then
|
||
|
if [ -n "${GITLAB_SHELL}" ]; then
|
||
|
opts="--shell=${GITLAB_SHELL}"
|
||
|
fi
|
||
|
# shellcheck disable=SC2086
|
||
|
gitlab-runner register \
|
||
|
--non-interactive \
|
||
|
--url="${GITLAB_URL}" \
|
||
|
--registration-token="${GITLAB_TOKEN}" \
|
||
|
--executor="${GITLAB_EXECUTOR}" \
|
||
|
--description="${GITLAB_RUNNER_NAME}" \
|
||
|
--tag-list="${GITLAB_TAG_LIST}" \
|
||
|
--locked=false \
|
||
|
--access-level=not_protected \
|
||
|
--run-untagged=false \
|
||
|
"${opts}"
|
||
|
fi
|
||
|
fi
|