]> granicus.if.org Git - esp-idf/commitdiff
ci: Remove unused IS_PRIVATE and IS_PUBLIC environment
authorAnton Maklakov <anton@espressif.com>
Thu, 30 May 2019 06:12:36 +0000 (13:12 +0700)
committerAnton Maklakov <anton@espressif.com>
Tue, 25 Jun 2019 15:24:45 +0000 (22:24 +0700)
.gitlab-ci.yml
tools/ci/configure_ci_environment.sh
tools/ci/test_configure_ci_environment.sh

index 1603cd162ec318a2c9bad0a62fb5b706dd894e16..ba2f0562615d38aa839dfaa767981d62fb508a70 100644 (file)
@@ -90,10 +90,7 @@ before_script:
   - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
   - chmod 600 ~/.ssh/id_rsa
   - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
-
-  # Set IS_PRIVATE or IS_PUBLIC depending on if our branch is public or not
-  #
-  # (the same regular expressions are used to set these are used in 'only:' sections below
+  # Set some options and environment for CI
   - source tools/ci/configure_ci_environment.sh
 
   - *setup_tools_unless_target_test
index 73721746e3de51517e47a2a3e5660ed532f0451a..9a664c1ce9e90b284c5e0c9d0ea08f0f5e24d92f 100644 (file)
@@ -7,30 +7,12 @@
 set -o errexit # Exit if command failed.
 set -o pipefail # Exit if pipe failed.
 
-# we can use the appropriate secret variable for debugging
-[ ! -z $DEBUG_SHELL ] && set -x
+# We can use the appropriate CI variable for debugging
+DEBUG_SHELL=${DEBUG_SHELL:-"0"}
+[ "${DEBUG_SHELL}" = "1" ] && set -x
 
 [ -z $CI_COMMIT_REF_NAME ] && echo "This internal script should only be run by a Gitlab CI runner." && exit 1
 
-# Sets IS_PUBLIC and IS_PRIVATE based on branch type
-#
-# 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
-#
-REF=$CI_COMMIT_REF_NAME
-if [[ $REF = "master" || $REF =~ ^release/v || $REF =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-|$) ]]; then
-    export IS_PRIVATE=
-    export IS_PUBLIC=1
-else
-    export IS_PRIVATE=1
-    export IS_PUBLIC=
-fi
-unset REF
-
 # 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)
 export PEDANTIC_CFLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
index 8f513de95d8acf1305a981ab01a63942d12ab575..0cd4909c12017b8d812946d00b7fb473e3a4ff33 100755 (executable)
@@ -5,34 +5,7 @@
 #
 cd $(dirname $0)  # make dir
 
-touch .gitmodules  # dummy file
-
-# $1 - branch name
-# $2 - 1 if public, empty if private
-function assert_branch_public()
-{
-    (
-        CI_COMMIT_REF_NAME=$1
-        set -e
-        source ./configure_ci_environment.sh
-        [[ $IS_PUBLIC = $2 ]] || exit 1
-    ) || { echo "Expected $1 public=$2. Failing"; exit 1; }
-}
-
-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
-
 (
     . ./configure_ci_environment.sh
     [[ $PEDANTIC_CFLAGS ]] || { echo "PEDANTIC_CFLAGS is not defined"; exit 1; }
 ) || { exit 1; }
-
-rm -f .gitmodules