Skip to content

Instantly share code, notes, and snippets.

@EmilienMottet
Created March 3, 2021 22:05
Show Gist options
  • Save EmilienMottet/26b571452cf11563b7b9b62ebbcd8007 to your computer and use it in GitHub Desktop.
Save EmilienMottet/26b571452cf11563b7b9b62ebbcd8007 to your computer and use it in GitHub Desktop.
build_vars:
stage: .pre
script:
- |
if [ "$CI_PIPELINE_TRIGGERED" = "true" ]; then
DIR_TO_BE_TESTED=$(ls -d */)
else
DIR_TO_BE_TESTED=$(git diff --name-only $CI_COMMIT_SHA^ $CI_COMMIT_SHA */ | cut -d'/' -f1 | sort | uniq)
if [ -z $DIR_TO_BE_TESTED ]; then
DIR_TO_BE_TESTED=$(ls -d */)
fi
fi
- echo DIR_TO_BE_TESTED=$DIR_TO_BE_TESTED >> build.env
- cat build.env
artifacts:
reports:
dotenv: build.env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment