Commit cdc791c5 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch '35349-gitlab-shell-has-a-lot-of-liveness-errors-in-review-apps' into 'master'

Fix the Review App `base-config.yml` change detection

See merge request gitlab-org/gitlab!19442
parents 9381ae41 a0d15832
......@@ -117,7 +117,6 @@ schedule:review-build-cng:
- source scripts/utils.sh
- install_api_client_dependencies_with_apk
- source scripts/review_apps/review-apps.sh
- export REVIEW_APP_CONFIG_CHANGED=$(base_config_changed)
script:
- check_kube_domain
- ensure_namespace
......
......@@ -207,19 +207,16 @@ function download_chart() {
}
function base_config_changed() {
git fetch origin master --depth=50
if [ -z "${CI_MERGE_REQUEST_IID}" ]; then return; fi
[ -n "$(git diff origin/master... --name-only -- scripts/review_apps/base-config.yaml)" ]
curl "${CI_API_V4_URL}/projects/${CI_MERGE_REQUEST_PROJECT_ID}/merge_requests/${CI_MERGE_REQUEST_IID}/changes" | jq '.changes | any(.old_path == "scripts/review_apps/base-config.yaml")'
}
function deploy() {
local name="$CI_ENVIRONMENT_SLUG"
local edition="${GITLAB_EDITION-ce}"
local base_config_file_ref="master"
echo "REVIEW_APP_CONFIG_CHANGED: ${REVIEW_APP_CONFIG_CHANGED}"
if [ -n "${REVIEW_APP_CONFIG_CHANGED}" ]; then
base_config_file_ref="$CI_COMMIT_SHA"
fi
if [[ "$(base_config_changed)" == "true" ]]; then base_config_file_ref="$CI_COMMIT_SHA"; fi
local base_config_file="https://gitlab.com/gitlab-org/gitlab/raw/${base_config_file_ref}/scripts/review_apps/base-config.yaml"
echoinfo "Deploying ${name}..." true
......
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