2022-08-30 08:12:25 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Script to generate e2e test child pipeline
|
|
|
|
# This is required because environment variables that are generated dynamically are not picked up by rules in child pipelines
|
|
|
|
|
2022-09-05 23:12:08 -04:00
|
|
|
source $ENV_FILE
|
|
|
|
|
|
|
|
echo "Generating child pipeline yml definitions for review-app and package-and-test child pipelines"
|
2022-08-30 08:12:25 -04:00
|
|
|
|
|
|
|
if [ "$QA_SKIP_ALL_TESTS" == "true" ]; then
|
2022-09-05 23:12:08 -04:00
|
|
|
skip_pipeline=".gitlab/ci/_skip.yml"
|
|
|
|
|
|
|
|
echo "Using ${skip_pipeline} due to QA_SKIP_ALL_TESTS set to 'true'"
|
|
|
|
cp $skip_pipeline "$OMNIBUS_PIPELINE_YML"
|
|
|
|
cp $skip_pipeline "$REVIEW_PIPELINE_YML"
|
2022-08-30 08:12:25 -04:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-09-06 14:10:28 -04:00
|
|
|
variables=$(cat <<YML
|
2022-08-30 08:12:25 -04:00
|
|
|
variables:
|
2022-09-06 14:10:28 -04:00
|
|
|
GITLAB_VERSION: "$(cat VERSION)"
|
2022-09-15 02:12:51 -04:00
|
|
|
COLORIZED_LOGS: "true"
|
2022-08-30 08:12:25 -04:00
|
|
|
QA_TESTS: "$QA_TESTS"
|
|
|
|
QA_FEATURE_FLAGS: "${QA_FEATURE_FLAGS}"
|
|
|
|
QA_FRAMEWORK_CHANGES: "${QA_FRAMEWORK_CHANGES:-false}"
|
|
|
|
QA_SUITES: "$QA_SUITES"
|
|
|
|
YML
|
|
|
|
)
|
|
|
|
|
2022-09-05 23:12:08 -04:00
|
|
|
echo "Using .gitlab/ci/review-apps/main.gitlab-ci.yml and .gitlab/ci/package-and-test/main.gitlab-ci.yml"
|
|
|
|
cp .gitlab/ci/review-apps/main.gitlab-ci.yml "$REVIEW_PIPELINE_YML"
|
2022-09-06 14:10:28 -04:00
|
|
|
echo "$variables" >>"$REVIEW_PIPELINE_YML"
|
2022-09-05 23:12:08 -04:00
|
|
|
cp .gitlab/ci/package-and-test/main.gitlab-ci.yml "$OMNIBUS_PIPELINE_YML"
|
2022-09-06 14:10:28 -04:00
|
|
|
echo "$variables" >>"$OMNIBUS_PIPELINE_YML"
|
2022-09-15 02:12:51 -04:00
|
|
|
|
|
|
|
echo "Successfully generated review-app and package-and-test pipeline with following variables section:"
|
2022-09-06 14:10:28 -04:00
|
|
|
echo "$variables"
|