forked from espressif/esp-idf
Merge branch 'bugfix/aws_iot_examples_cmake_build' into 'master'
examples: aws_iot: fix cmake build issue which used to pick dummy certificates See merge request idf/esp-idf!4180
This commit is contained in:
@@ -113,7 +113,6 @@ build_template_app:
|
|||||||
- build
|
- build
|
||||||
variables:
|
variables:
|
||||||
BATCH_BUILD: "1"
|
BATCH_BUILD: "1"
|
||||||
IDF_CI_BUILD: "1"
|
|
||||||
only:
|
only:
|
||||||
variables:
|
variables:
|
||||||
- $BOT_TRIGGER_WITH_LABEL == null
|
- $BOT_TRIGGER_WITH_LABEL == null
|
||||||
@@ -246,7 +245,6 @@ build_esp_idf_tests_cmake:
|
|||||||
- $LOG_PATH
|
- $LOG_PATH
|
||||||
expire_in: 2 days
|
expire_in: 2 days
|
||||||
variables:
|
variables:
|
||||||
IDF_CI_BUILD: "1"
|
|
||||||
LOG_PATH: "$CI_PROJECT_DIR/log_examples_make"
|
LOG_PATH: "$CI_PROJECT_DIR/log_examples_make"
|
||||||
only:
|
only:
|
||||||
variables:
|
variables:
|
||||||
@@ -279,7 +277,6 @@ build_esp_idf_tests_cmake:
|
|||||||
- $LOG_PATH
|
- $LOG_PATH
|
||||||
expire_in: 2 days
|
expire_in: 2 days
|
||||||
variables:
|
variables:
|
||||||
IDF_CI_BUILD: "1"
|
|
||||||
LOG_PATH: "$CI_PROJECT_DIR/log_examples_cmake"
|
LOG_PATH: "$CI_PROJECT_DIR/log_examples_cmake"
|
||||||
only:
|
only:
|
||||||
variables:
|
variables:
|
||||||
|
@@ -6,23 +6,6 @@ register_component()
|
|||||||
|
|
||||||
if(CONFIG_EXAMPLE_EMBEDDED_CERTS)
|
if(CONFIG_EXAMPLE_EMBEDDED_CERTS)
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "certs/aws-root-ca.pem" TEXT)
|
target_add_binary_data(${COMPONENT_TARGET} "certs/aws-root-ca.pem" TEXT)
|
||||||
|
target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
|
||||||
if(NOT IDF_CI_BUILD)
|
target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT)
|
||||||
add_custom_command(OUTPUT certs/certificate.pem.crt certs/private.pem.key
|
|
||||||
COMMAND echo "Dummy certificate data for continuous integration" >
|
|
||||||
certs/certificate.pem.crt
|
|
||||||
COMMAND echo "Dummy certificate data for continuous integration" >
|
|
||||||
certs/private.pem.key
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
VERBATIM)
|
|
||||||
add_custom_target(example_certificates DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt ${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key)
|
|
||||||
|
|
||||||
add_dependencies(${COMPONENT_TARGET} example_certificates)
|
|
||||||
|
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt" TEXT)
|
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key" TEXT)
|
|
||||||
else()
|
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
|
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
@@ -7,16 +7,8 @@ ifdef CONFIG_EXAMPLE_EMBEDDED_CERTS
|
|||||||
# from AWS, see README for details.
|
# from AWS, see README for details.
|
||||||
COMPONENT_EMBED_TXTFILES := certs/aws-root-ca.pem certs/certificate.pem.crt certs/private.pem.key
|
COMPONENT_EMBED_TXTFILES := certs/aws-root-ca.pem certs/certificate.pem.crt certs/private.pem.key
|
||||||
|
|
||||||
ifndef IDF_CI_BUILD
|
|
||||||
# Print an error if the certificate/key files are missing
|
# Print an error if the certificate/key files are missing
|
||||||
$(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
|
$(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
|
||||||
@echo "Missing PEM file $@. This file identifies the ESP32 to AWS for the example, see README for details."
|
@echo "Missing PEM file $@. This file identifies the ESP32 to AWS for the example, see README for details."
|
||||||
exit 1
|
exit 1
|
||||||
else # IDF_CI_BUILD
|
|
||||||
# this case is for the internal Continuous Integration build which
|
|
||||||
# compiles all examples. Add some dummy certs so the example can
|
|
||||||
# compile (even though it won't work)
|
|
||||||
$(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
|
|
||||||
echo "Dummy certificate data for continuous integration" > $@
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
@@ -0,0 +1,2 @@
|
|||||||
|
# For CI build example assuming certificates stored on sdcard
|
||||||
|
CONFIG_EXAMPLE_SDCARD_CERTS=y
|
@@ -6,23 +6,6 @@ register_component()
|
|||||||
|
|
||||||
if(CONFIG_EXAMPLE_EMBEDDED_CERTS)
|
if(CONFIG_EXAMPLE_EMBEDDED_CERTS)
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "certs/aws-root-ca.pem" TEXT)
|
target_add_binary_data(${COMPONENT_TARGET} "certs/aws-root-ca.pem" TEXT)
|
||||||
|
target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
|
||||||
if(NOT IDF_CI_BUILD)
|
target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT)
|
||||||
add_custom_command(OUTPUT certs/certificate.pem.crt certs/private.pem.key
|
|
||||||
COMMAND echo "Dummy certificate data for continuous integration" >
|
|
||||||
certs/certificate.pem.crt
|
|
||||||
COMMAND echo "Dummy certificate data for continuous integration" >
|
|
||||||
certs/private.pem.key
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
VERBATIM)
|
|
||||||
add_custom_target(example_certificates DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt ${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key)
|
|
||||||
|
|
||||||
add_dependencies(${COMPONENT_TARGET} example_certificates)
|
|
||||||
|
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt" TEXT)
|
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key" TEXT)
|
|
||||||
else()
|
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
|
|
||||||
target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
@@ -7,16 +7,8 @@ ifdef CONFIG_EXAMPLE_EMBEDDED_CERTS
|
|||||||
# from AWS, see README for details.
|
# from AWS, see README for details.
|
||||||
COMPONENT_EMBED_TXTFILES := certs/aws-root-ca.pem certs/certificate.pem.crt certs/private.pem.key
|
COMPONENT_EMBED_TXTFILES := certs/aws-root-ca.pem certs/certificate.pem.crt certs/private.pem.key
|
||||||
|
|
||||||
ifndef IDF_CI_BUILD
|
|
||||||
# Print an error if the certificate/key files are missing
|
# Print an error if the certificate/key files are missing
|
||||||
$(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
|
$(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
|
||||||
@echo "Missing PEM file $@. This file identifies the ESP32 to AWS for the example, see README for details."
|
@echo "Missing PEM file $@. This file identifies the ESP32 to AWS for the example, see README for details."
|
||||||
exit 1
|
exit 1
|
||||||
else # IDF_CI_BUILD
|
|
||||||
# this case is for the internal Continuous Integration build which
|
|
||||||
# compiles all examples. Add some dummy certs so the example can
|
|
||||||
# compile (even though it won't work)
|
|
||||||
$(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key:
|
|
||||||
echo "Dummy certificate data for continuous integration" > $@
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
2
examples/protocols/aws_iot/thing_shadow/sdkconfig.ci
Normal file
2
examples/protocols/aws_iot/thing_shadow/sdkconfig.ci
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# For CI build example assuming certificates stored on sdcard
|
||||||
|
CONFIG_EXAMPLE_SDCARD_CERTS=y
|
Reference in New Issue
Block a user