summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Luck <ben+qa@advancedtelematic.com>2017-08-22 12:33:31 +0200
committerGitHub <noreply@github.com>2017-08-22 12:33:31 +0200
commit4e5064a1caae234a2ba755c246803d550234fd2b (patch)
tree113ca4d3975fc43acb84115fed5530ba181feca1
parentdeac6ea989030eb12231a600d4db462f1c89aa44 (diff)
parentdee9bf7a66253d782c1cb78ab57990774d00ec3e (diff)
downloadmeta-updater-4e5064a1caae234a2ba755c246803d550234fd2b.tar.gz
Merge pull request #126 from leon-anavi/morty
Show warnings if credentials are not provided
-rw-r--r--classes/image_types_ostree.bbclass23
1 files changed, 16 insertions, 7 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 6a1b33e..8c9f262 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -133,9 +133,11 @@ IMAGE_CMD_ostree () {
133 133
134 # deploy SOTA credentials 134 # deploy SOTA credentials
135 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then 135 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
136 cp ${SOTA_PACKED_CREDENTIALS} var/sota/sota_provisioning_credentials.zip 136 if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then
137 # Device should not be able to push data to treehub 137 cp ${SOTA_PACKED_CREDENTIALS} var/sota/sota_provisioning_credentials.zip
138 zip -d var/sota/sota_provisioning_credentials.zip treehub.json 138 # Device should not be able to push data to treehub
139 zip -d var/sota/sota_provisioning_credentials.zip treehub.json
140 fi
139 fi 141 fi
140 142
141 if [ -n "${SOTA_SECONDARY_ECUS}" ]; then 143 if [ -n "${SOTA_SECONDARY_ECUS}" ]; then
@@ -183,10 +185,17 @@ IMAGE_CMD_ostree () {
183IMAGE_TYPEDEP_ostreepush = "ostree" 185IMAGE_TYPEDEP_ostreepush = "ostree"
184IMAGE_DEPENDS_ostreepush = "sota-tools-native:do_populate_sysroot" 186IMAGE_DEPENDS_ostreepush = "sota-tools-native:do_populate_sysroot"
185IMAGE_CMD_ostreepush () { 187IMAGE_CMD_ostreepush () {
188 # Print warnings if credetials are not set or if the file has not been found.
186 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then 189 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
187 garage-push --repo=${OSTREE_REPO} \ 190 if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then
188 --ref=${OSTREE_BRANCHNAME} \ 191 garage-push --repo=${OSTREE_REPO} \
189 --credentials=${SOTA_PACKED_CREDENTIALS} \ 192 --ref=${OSTREE_BRANCHNAME} \
190 --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt 193 --credentials=${SOTA_PACKED_CREDENTIALS} \
194 --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt
195 else
196 bbwarn "SOTA_PACKED_CREDENTIALS file does not exist."
197 fi
198 else
199 bbwarn "SOTA_PACKED_CREDENTIALS not set. Please add SOTA_PACKED_CREDENTIALS."
191 fi 200 fi
192} 201}