2022-10-11 01:57:18 +05:30
|
|
|
#!/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
|
|
|
|
|
|
|
|
source $ENV_FILE
|
|
|
|
|
|
|
|
echo "Generating child pipeline yml definitions for review-app and package-and-test child pipelines"
|
|
|
|
|
|
|
|
if [ "$QA_SKIP_ALL_TESTS" == "true" ]; then
|
|
|
|
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"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
# set custom cache key to override default cache in pipeline-common because we use bundle to install gitlab-qa gem
|
|
|
|
qa_cache_key="qa-e2e-ruby-${RUBY_VERSION}-$(md5sum qa/Gemfile.lock | awk '{ print $1 }')"
|
2022-10-11 01:57:18 +05:30
|
|
|
variables=$(cat <<YML
|
|
|
|
variables:
|
2023-04-23 21:23:45 +05:30
|
|
|
GIT_DEPTH: "20"
|
|
|
|
GIT_STRATEGY: "clone" # 'GIT_STRATEGY: clone' optimizes the pack-objects cache hit ratio
|
|
|
|
GIT_SUBMODULE_STRATEGY: "none"
|
2022-11-25 23:54:43 +05:30
|
|
|
GITLAB_QA_CACHE_KEY: "$qa_cache_key"
|
2023-05-27 22:25:52 +05:30
|
|
|
GITLAB_SEMVER_VERSION: "$(cat VERSION)"
|
2023-06-20 00:43:36 +05:30
|
|
|
SKIP_OMNIBUS_TRIGGER: "false"
|
2023-01-13 00:05:48 +05:30
|
|
|
QA_EXPORT_TEST_METRICS: "${QA_EXPORT_TEST_METRICS:-true}"
|
|
|
|
QA_FEATURE_FLAGS: "${QA_FEATURE_FLAGS}"
|
2023-04-23 21:23:45 +05:30
|
|
|
QA_FRAMEWORK_CHANGES: "${QA_FRAMEWORK_CHANGES:-false}"
|
|
|
|
QA_RUN_ALL_TESTS: "${QA_RUN_ALL_TESTS:-false}"
|
2023-06-20 00:43:36 +05:30
|
|
|
QA_RUN_ALL_E2E_LABEL: "${QA_RUN_ALL_E2E_LABEL:-false}"
|
2023-04-23 21:23:45 +05:30
|
|
|
QA_SAVE_TEST_METRICS: "${QA_SAVE_TEST_METRICS:-false}"
|
2022-10-11 01:57:18 +05:30
|
|
|
QA_SUITES: "$QA_SUITES"
|
2023-04-23 21:23:45 +05:30
|
|
|
QA_TESTS: "$QA_TESTS"
|
2022-10-11 01:57:18 +05:30
|
|
|
YML
|
|
|
|
)
|
|
|
|
|
|
|
|
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"
|
|
|
|
echo "$variables" >>"$REVIEW_PIPELINE_YML"
|
2023-05-27 22:25:52 +05:30
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
cp .gitlab/ci/package-and-test/main.gitlab-ci.yml "$OMNIBUS_PIPELINE_YML"
|
|
|
|
echo "$variables" >>"$OMNIBUS_PIPELINE_YML"
|
|
|
|
|
|
|
|
echo "Successfully generated review-app and package-and-test pipeline with following variables section:"
|
|
|
|
echo "$variables"
|