]> granicus.if.org Git - esp-idf/commitdiff
ci, examples: use sdkconfig.ci as an extra defaults file, if present
authorIvan Grokhotkov <ivan@espressif.com>
Mon, 10 Dec 2018 05:26:40 +0000 (13:26 +0800)
committerDavid Cermak <cermak@espressif.com>
Tue, 22 Jan 2019 09:15:10 +0000 (10:15 +0100)
- Allows placing CI-specific settings into sdkconfig.ci file
- Allows substituting environment variables in sdkconfig.ci

examples/protocols/mqtt/tcp/sdkconfig [deleted file]
examples/protocols/mqtt/tcp/sdkconfig.ci [new file with mode: 0644]
examples/protocols/mqtt/tcp/sdkconfig.defaults [deleted file]
tools/ci/build_examples.sh
tools/ci/build_examples_cmake.sh
tools/ci/executable-list.txt

diff --git a/examples/protocols/mqtt/tcp/sdkconfig b/examples/protocols/mqtt/tcp/sdkconfig
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/examples/protocols/mqtt/tcp/sdkconfig.ci b/examples/protocols/mqtt/tcp/sdkconfig.ci
new file mode 100644 (file)
index 0000000..09ca8f3
--- /dev/null
@@ -0,0 +1,2 @@
+CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
+CONFIG_BROKER_URL="FROM_STDIN"
diff --git a/examples/protocols/mqtt/tcp/sdkconfig.defaults b/examples/protocols/mqtt/tcp/sdkconfig.defaults
deleted file mode 100644 (file)
index 51c8139..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-CONFIG_BROKER_URL="FROM_STDIN"
-CONFIG_LOG_DEFAULT_LEVEL_NONE=
-CONFIG_LOG_DEFAULT_LEVEL_ERROR=
-CONFIG_LOG_DEFAULT_LEVEL_WARN=
-CONFIG_LOG_DEFAULT_LEVEL_INFO=
-CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
-CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=
index 2210a4b45f6ce0812fdc1057af4c29e6219f674c..8bd1e52dab8c1b0758eaf57a541ece4215361a6e 100755 (executable)
@@ -61,6 +61,7 @@ FAILED_EXAMPLES=""
 RESULT_ISSUES=22  # magic number result code for issues found
 LOG_SUSPECTED=${LOG_PATH}/common_log.txt
 touch ${LOG_SUSPECTED}
+SDKCONFIG_DEFAULTS_CI=sdkconfig.ci
 
 if [ $# -eq 0 ]
 then
@@ -117,6 +118,16 @@ build_example () {
         export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
         export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
 
+        # sdkconfig files are normally not checked into git, but may be present when
+        # a developer runs this script locally
+        rm -f sdkconfig
+
+        # If sdkconfig.ci file is present, append it to sdkconfig.defaults,
+        # replacing environment variables
+        if [[ -f "$SDKCONFIG_DEFAULTS_CI" ]]; then
+            cat $SDKCONFIG_DEFAULTS_CI | $IDF_PATH/tools/ci/envsubst.py >> sdkconfig.defaults
+        fi
+
         # build non-verbose first
         local BUILDLOG=${LOG_PATH}/ex_${ID}_log.txt
         touch ${BUILDLOG}
@@ -142,8 +153,8 @@ build_example () {
 
 EXAMPLE_NUM=0
 
-find ${IDF_PATH}/examples/ -type f -name Makefile | sort | \
-while read FN
+EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile | grep -v "/build_system/cmake/" | sort )
+for FN in ${EXAMPLE_PATHS}
 do
     if [[ $EXAMPLE_NUM -lt $START_NUM || $EXAMPLE_NUM -ge $END_NUM ]]
     then
index 50ce7f1e61d39a4b88dcb00b41df0e0aedec3e0f..786323291755fc0c4af8a5c714038d3b3cfc5f68 100755 (executable)
@@ -64,6 +64,7 @@ FAILED_EXAMPLES=""
 RESULT_ISSUES=22  # magic number result code for issues found
 LOG_SUSPECTED=${LOG_PATH}/common_log.txt
 touch ${LOG_SUSPECTED}
+SDKCONFIG_DEFAULTS_CI=sdkconfig.ci
 
 EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/main/" | sort )
 
@@ -122,6 +123,16 @@ build_example () {
         export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
         export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
 
+        # sdkconfig files are normally not checked into git, but may be present when
+        # a developer runs this script locally
+        rm -f sdkconfig
+
+        # If sdkconfig.ci file is present, append it to sdkconfig.defaults,
+        # replacing environment variables
+        if [[ -f "$SDKCONFIG_DEFAULTS_CI" ]]; then
+            cat $SDKCONFIG_DEFAULTS_CI | $IDF_PATH/tools/ci/envsubst.py >> sdkconfig.defaults
+        fi
+
         # build non-verbose first
         local BUILDLOG=${LOG_PATH}/ex_${ID}_log.txt
         touch ${BUILDLOG}
index 729edc2cf4b7964dd82df0997cb71558963e45dc..cd71b6e69dd34f5b604514c167f2053d08b21947 100644 (file)
@@ -21,6 +21,7 @@ tools/ci/build_examples_cmake.sh
 tools/ci/check-executable.sh
 tools/ci/check-line-endings.sh
 tools/ci/checkout_project_ref.py
+tools/ci/envsubst.py
 tools/ci/get-full-sources.sh
 tools/ci/mirror-submodule-update.sh
 tools/ci/mirror-synchronize.sh