Commit 59c1f7e9 authored by Emeric Verschuur's avatar Emeric Verschuur

[CA] Fill CI_SERVER_TLS_CA_FILE with local CA certs on local worstation

parent e18477ff
......@@ -776,8 +776,21 @@ fi
CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME:-$(cd $CI_PROJECT_DIR && git rev-parse --abbrev-ref HEAD)}
CITBX_JOB_DOCKER_RUN_ARGS+=(-e CI_COMMIT_REF_NAME="$CI_COMMIT_REF_NAME")
# If not set, fill the CI_SERVER_TLS_CA_FILE with local CA certificates
if ! [[ -v CITBX_TLS_CA_SEARCH_DIR_LIST ]]; then
CITBX_TLS_CA_SEARCH_DIR_LIST=("/usr/local/share/ca-certificates/")
fi
if ! [[ -v CI_SERVER_TLS_CA_FILE ]]; then
CI_SERVER_TLS_CA_FILE="$(
for dir in "${CITBX_TLS_CA_SEARCH_DIR_LIST[@]}"; do
test ! -d "$dir" \
|| find "$dir" -iregex '.*\.\(pem\|crt\)$' -exec openssl x509 -in '{}' \;
done
)"
fi
# Add variable to the environment list
CITBX_ENV_EXPORT_LIST+=(CI_JOB_NAME CI_REGISTRY CI_PROJECT_DIR)
CITBX_ENV_EXPORT_LIST+=(CI_JOB_NAME CI_REGISTRY CI_PROJECT_DIR CI_SERVER_TLS_CA_FILE)
if [ "$CITBX_DEBUG_SCRIPT_ENABLED" == "true" ]; then
citbx_before_script="set -x"
......
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