ci: Use id_tokens for JWT auth
Fixes: #9180 Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28916>
This commit is contained in:

committed by
Marge Bot

parent
2639c91052
commit
7101aecc53
@@ -72,7 +72,7 @@ variables:
|
||||
bash download-git-cache.sh
|
||||
rm download-git-cache.sh
|
||||
set +o xtrace
|
||||
CI_JOB_JWT_FILE: /minio_jwt
|
||||
S3_JWT_FILE: /s3_jwt
|
||||
S3_HOST: s3.freedesktop.org
|
||||
# per-pipeline artifact storage on MinIO
|
||||
PIPELINE_ARTIFACTS_BASE: ${S3_HOST}/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}
|
||||
@@ -101,8 +101,8 @@ default:
|
||||
export SCRIPTS_DIR=$(mktemp -d) &&
|
||||
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 -O --output-dir "${SCRIPTS_DIR}" "${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/setup-test-env.sh" &&
|
||||
. ${SCRIPTS_DIR}/setup-test-env.sh &&
|
||||
echo -n "${CI_JOB_JWT}" > "${CI_JOB_JWT_FILE}" &&
|
||||
unset CI_JOB_JWT # Unsetting vulnerable env variables
|
||||
echo -n "${S3_JWT}" > "${S3_JWT_FILE}" &&
|
||||
unset CI_JOB_JWT S3_JWT # Unsetting vulnerable env variables
|
||||
|
||||
after_script:
|
||||
# Work around https://gitlab.com/gitlab-org/gitlab/-/issues/20338
|
||||
@@ -111,9 +111,9 @@ default:
|
||||
- >
|
||||
set +x
|
||||
|
||||
test -e "${CI_JOB_JWT_FILE}" &&
|
||||
export CI_JOB_JWT="$(<${CI_JOB_JWT_FILE})" &&
|
||||
rm "${CI_JOB_JWT_FILE}"
|
||||
test -e "${S3_JWT_FILE}" &&
|
||||
export S3_JWT="$(<${S3_JWT_FILE})" &&
|
||||
rm "${S3_JWT_FILE}"
|
||||
|
||||
# Retry when job fails. Failed jobs can be found in the Mesa CI Daily Reports:
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/?sort=created_date&state=opened&label_name%5B%5D=CI%20daily
|
||||
@@ -266,8 +266,7 @@ make git archive:
|
||||
# compress the current folder
|
||||
- tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
|
||||
|
||||
- ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" ../$CI_PROJECT_NAME.tar.gz https://$S3_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
|
||||
|
||||
- ci-fairy s3cp --token-file "${S3_JWT_FILE}" ../$CI_PROJECT_NAME.tar.gz https://$S3_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
|
||||
|
||||
# Sanity checks of MR settings and commit logs
|
||||
sanity:
|
||||
|
Reference in New Issue
Block a user