2017-06-18 21:59:18 -04:00
|
|
|
# This file is sourced in to the CI environment
|
2017-03-22 06:39:28 -04:00
|
|
|
# in .gitlab-ci.yml
|
|
|
|
#
|
2017-06-18 21:59:18 -04:00
|
|
|
|
|
|
|
# Sets the error behaviour options for shell throughout the CI environment
|
2017-03-22 06:39:28 -04:00
|
|
|
#
|
2017-06-18 21:59:18 -04:00
|
|
|
set -o errexit # Exit if command failed.
|
2018-03-27 01:13:35 -04:00
|
|
|
set -o pipefail # Exit if pipe failed.
|
|
|
|
|
|
|
|
# we can use the appropriate secret variable for debugging
|
|
|
|
[ ! -z $DEBUG_SHELL ] && set -x
|
2017-03-22 06:39:28 -04:00
|
|
|
|
2017-05-31 05:20:29 -04:00
|
|
|
[ -z $CI_COMMIT_REF_NAME ] && echo "This internal script should only be run by a Gitlab CI runner." && exit 1
|
2017-03-22 06:39:28 -04:00
|
|
|
|
2017-06-18 21:59:18 -04:00
|
|
|
# Sets IS_PUBLIC and IS_PRIVATE based on branch type
|
|
|
|
#
|
2017-03-22 06:39:28 -04:00
|
|
|
# Public branches are:
|
|
|
|
# release branches - start with release/
|
|
|
|
# release tags - look like vXX.YY or vXX.YY.ZZ with an optional dash followed by anything on the end
|
|
|
|
# master branch
|
|
|
|
#
|
|
|
|
# These POSIX REs are equivalent to the REs in some "only:" sections of the gitlab-ci.yml file
|
|
|
|
#
|
2017-06-18 21:59:18 -04:00
|
|
|
REF=$CI_COMMIT_REF_NAME
|
2017-03-22 06:39:28 -04:00
|
|
|
if [[ $REF = "master" || $REF =~ ^release/v || $REF =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-|$) ]]; then
|
2017-07-06 06:52:08 -04:00
|
|
|
export IS_PRIVATE=
|
2017-03-22 06:39:28 -04:00
|
|
|
export IS_PUBLIC=1
|
|
|
|
else
|
|
|
|
export IS_PRIVATE=1
|
2017-07-06 06:52:08 -04:00
|
|
|
export IS_PUBLIC=
|
2017-03-22 06:39:28 -04:00
|
|
|
fi
|
|
|
|
unset REF
|
2018-11-27 06:16:18 -05:00
|
|
|
|
|
|
|
# Compiler flags to thoroughly check the IDF code in some CI jobs
|
|
|
|
# (Depends on default options '-Wno-error=XXX' used in the IDF build system)
|
2019-04-17 02:31:07 -04:00
|
|
|
export PEDANTIC_CFLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
|