2017-03-22 10:39:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Short script to verify behaviour of configure_ci_environment.sh
|
|
|
|
#
|
|
|
|
#
|
|
|
|
cd $(dirname $0) # make dir
|
|
|
|
|
|
|
|
touch .gitmodules # dummy file
|
|
|
|
|
|
|
|
# $1 - branch name
|
|
|
|
# $2 - 1 if public, empty if private
|
|
|
|
function assert_branch_public()
|
|
|
|
{
|
|
|
|
(
|
2017-05-31 09:20:29 +00:00
|
|
|
CI_COMMIT_REF_NAME=$1
|
2017-03-22 10:39:28 +00:00
|
|
|
set -e
|
|
|
|
source ./configure_ci_environment.sh
|
|
|
|
[[ $IS_PUBLIC = $2 ]] || exit 1
|
2018-12-05 13:00:36 +00:00
|
|
|
) || { echo "Expected $1 public=$2. Failing"; exit 1; }
|
2017-03-22 10:39:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
assert_branch_public master 1
|
|
|
|
assert_branch_public release/v3.0 1
|
|
|
|
assert_branch_public release/invalid
|
|
|
|
assert_branch_public bugfix/invalid
|
|
|
|
assert_branch_public v1.0 1
|
|
|
|
assert_branch_public v1.0.0 1
|
|
|
|
assert_branch_public v50.50.50 1
|
|
|
|
assert_branch_public v1.2-rc77 1
|
|
|
|
assert_branch_public v1.2.3-rc1 1
|
|
|
|
assert_branch_public v1.2.3invalid
|
|
|
|
|
2018-11-27 11:16:18 +00:00
|
|
|
(
|
|
|
|
. ./configure_ci_environment.sh
|
|
|
|
[[ $PEDANTIC_CFLAGS ]] || { echo "PEDANTIC_CFLAGS is not defined"; exit 1; }
|
|
|
|
) || { exit 1; }
|
2017-03-22 10:39:28 +00:00
|
|
|
|
2018-11-27 11:16:18 +00:00
|
|
|
rm -f .gitmodules
|