summaryrefslogtreecommitdiffstats
path: root/classes/image_types_ostree.bbclass
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo@opensourcefoundries.com>2018-04-11 14:11:30 -0300
committerRicardo Salveti <ricardo@opensourcefoundries.com>2018-04-11 18:41:23 -0300
commit1c48a48f0a0134e53854b4b32d558eca807df766 (patch)
tree0d1b1cd298ca7954b684e62176d4b72dc76e477f /classes/image_types_ostree.bbclass
parentc2d1d2a086102cab64629ac2770055d11015af2d (diff)
downloadmeta-updater-1c48a48f0a0134e53854b4b32d558eca807df766.tar.gz
Add support for custom garage target version and url
Both values can be defined by the user, allowing a custom version id and URL, which is specially useful for CI builds. Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
Diffstat (limited to 'classes/image_types_ostree.bbclass')
-rw-r--r--classes/image_types_ostree.bbclass10
1 files changed, 8 insertions, 2 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 660483e..bc44e33 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -200,6 +200,12 @@ IMAGE_CMD_garagesign () {
200 200
201 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) 201 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME})
202 202
203 # Use OSTree target hash as version if none was provided by the user
204 target_version=${ostree_target_hash}
205 if [ -n "${GARAGE_TARGET_VERSION}" ]; then
206 target_version=${GARAGE_TARGET_VERSION}
207 fi
208
203 # Push may fail due to race condition when multiple build machines try to push simultaneously 209 # Push may fail due to race condition when multiple build machines try to push simultaneously
204 # in which case targets.json should be pulled again and the whole procedure repeated 210 # in which case targets.json should be pulled again and the whole procedure repeated
205 push_success=0 211 push_success=0
@@ -210,9 +216,9 @@ IMAGE_CMD_garagesign () {
210 --home-dir ${GARAGE_SIGN_REPO} \ 216 --home-dir ${GARAGE_SIGN_REPO} \
211 --name ${GARAGE_TARGET_NAME} \ 217 --name ${GARAGE_TARGET_NAME} \
212 --format OSTREE \ 218 --format OSTREE \
213 --version ${ostree_target_hash} \ 219 --version ${target_version} \
214 --length 0 \ 220 --length 0 \
215 --url "https://example.com/" \ 221 --url "${GARAGE_TARGET_URL}" \
216 --sha256 ${ostree_target_hash} \ 222 --sha256 ${ostree_target_hash} \
217 --hardwareids ${MACHINE} 223 --hardwareids ${MACHINE}
218 garage-sign targets sign --repo tufrepo \ 224 garage-sign targets sign --repo tufrepo \