mirror of
https://github.com/EpicMorg/docker-scripts.git
synced 2024-12-26 06:35:40 +03:00
23 lines
687 B
Bash
Executable File
23 lines
687 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# gitlab-runner data directory
|
|
DATA_DIR="/etc/gitlab-runner"
|
|
CONFIG_FILE=${CONFIG_FILE:-$DATA_DIR/config.toml}
|
|
# custom certificate authority path
|
|
CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-$DATA_DIR/certs/ca.crt}
|
|
LOCAL_CA_PATH="/usr/local/share/ca-certificates/ca.crt"
|
|
|
|
update_ca() {
|
|
echo "Updating CA certificates..."
|
|
cp "${CA_CERTIFICATES_PATH}" "${LOCAL_CA_PATH}"
|
|
update-ca-certificates --fresh >/dev/null
|
|
}
|
|
|
|
if [ -f "${CA_CERTIFICATES_PATH}" ]; then
|
|
# update the ca if the custom ca is different than the current
|
|
cmp --silent "${CA_CERTIFICATES_PATH}" "${LOCAL_CA_PATH}" || update_ca
|
|
fi
|
|
|
|
# launch gitlab-runner passing all arguments
|
|
exec gitlab-runner "$@"
|