Restrict to pushed/triggered pipelines, force build targets on triggered pipelines
This commit is contained in:
@@ -22,13 +22,22 @@ if ! [[ "$CI_COMMIT_TAG" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If no build indication was given, assume BUILD_LATEST.
|
# When this stage is ran from 'push', the build target is BUILD_LATEST.
|
||||||
# Most likely, this will only cover builds triggered from tag pushes.
|
# When this stage is ran from 'trigger', the build target must be provided.
|
||||||
|
# Otherwise, stop the stage.
|
||||||
|
if [ $CI_PIPELINE_SOURCE == "push" ]; then
|
||||||
|
BUILD_LATEST=true
|
||||||
|
elif [ $CI_PIPELINE_SOURCE == "trigger" ]; then
|
||||||
if [ -z $BUILD_LATEST ] || \
|
if [ -z $BUILD_LATEST ] || \
|
||||||
[ -z $BUILD_MAJOR ] || \
|
[ -z $BUILD_MAJOR ] || \
|
||||||
[ -z $BUILD_MINOR ] || \
|
[ -z $BUILD_MINOR ] || \
|
||||||
[ -z $BUILD_REVISION ]; then
|
[ -z $BUILD_REVISION ]; then
|
||||||
BUILD_LATEST=true
|
echo "You must provide build targets to this stage when ran from Pipeline Triggers."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "This stage is restricted to 'push' or 'trigger' Pipeline sources."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cascade the builds by inheritance.
|
# Cascade the builds by inheritance.
|
||||||
|
|||||||
Reference in New Issue
Block a user