turbaszek commented on a change in pull request #8393: Bring back CI
optimisations
URL: https://github.com/apache/airflow/pull/8393#discussion_r409383392
##########
File path: scripts/ci/_utils.sh
##########
@@ -917,34 +925,113 @@ function match_files_regexp() {
export FILE_MATCHES
}
+function get_ci_environment() {
+ if [[ ${CI:=} != "true" ]]; then
+ echo
+ echo "This is not a CI environment!. Set target branch to master and
evert type to manual"
+ echo
+ export CI_EVENT_TYPE="manual"
+ export CI_TARGET_BRANCH="master"
+ else
+ if [[ ${TRAVIS:=} == "true" ]]; then
+ if [[ "${TRAVIS_PULL_REQUEST:=}" == "true" ]]; then
+ export CI_EVENT_TYPE="pull_request"
+ export CI_PR_REPO="${TRAVIS_PULL_REQUEST_SLUG}"
+ export CI_PR_BRANCH="${TRAVIS_PULL_REQUEST_BRANCH}"
+ elif [[ "${TRAVIS_EVENT_TYPE:=}" == "cron" ]]; then
+ export CI_EVENT_TYPE="schedule"
+ export CI_PR_REPO=""
+ export CI_PR_BRANCH=""
Review comment:
Can we move those variables before elifs? It seems that we are repeating it
few times
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services