diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2019-08-21 15:01:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-21 15:01:51 +0200 |
commit | abfc287de407fe53cbbdd6edb9d08cf8cf51b298 (patch) | |
tree | f2ae1e7f3b370a1ac66f511b4d27ac5a49860c9d /classes | |
parent | 3bc650084e9db3320c67b6e5abe36920080ff576 (diff) | |
parent | 74d9d16f5a6bb2b28652eb4b5a258092fdb24937 (diff) | |
download | meta-updater-abfc287de407fe53cbbdd6edb9d08cf8cf51b298.tar.gz |
Merge pull request #590 from advancedtelematic/fix/OTA-3419/garage-sign-expiry
aktualizr: latest garage-sign with expiration support.
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 19 | ||||
-rw-r--r-- | classes/sota.bbclass | 2 |
2 files changed, 17 insertions, 4 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 2e8e8f5..795e01b 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -237,10 +237,20 @@ IMAGE_CMD_garagesign () { | |||
237 | # Push may fail due to race condition when multiple build machines try to push simultaneously | 237 | # Push may fail due to race condition when multiple build machines try to push simultaneously |
238 | # in which case targets.json should be pulled again and the whole procedure repeated | 238 | # in which case targets.json should be pulled again and the whole procedure repeated |
239 | push_success=0 | 239 | push_success=0 |
240 | target_url="" | 240 | target_url="" |
241 | if [ -n "${GARAGE_TARGET_URL}" ]; then | 241 | if [ -n "${GARAGE_TARGET_URL}" ]; then |
242 | target_url='--url ${GARAGE_TARGET_URL}' | 242 | target_url="--url ${GARAGE_TARGET_URL}" |
243 | fi | 243 | fi |
244 | target_expiry="" | ||
245 | if [ -n "${GARAGE_TARGET_EXPIRES}" ] && [ -n "${GARAGE_TARGET_EXPIRE_AFTER}" ]; then | ||
246 | bbfatal "Both GARAGE_TARGET_EXPIRES and GARAGE_TARGET_EXPIRE_AFTER are set. Only one can be set at a time." | ||
247 | elif [ -n "${GARAGE_TARGET_EXPIRES}" ]; then | ||
248 | target_expiry="--expires ${GARAGE_TARGET_EXPIRES}" | ||
249 | elif [ -n "${GARAGE_TARGET_EXPIRE_AFTER}" ]; then | ||
250 | target_expiry="--expire-after ${GARAGE_TARGET_EXPIRE_AFTER}" | ||
251 | else | ||
252 | target_expiry="--expire-after 1M" | ||
253 | fi | ||
244 | 254 | ||
245 | for push_retries in $( seq 3 ); do | 255 | for push_retries in $( seq 3 ); do |
246 | garage-sign targets pull --repo tufrepo \ | 256 | garage-sign targets pull --repo tufrepo \ |
@@ -262,6 +272,7 @@ IMAGE_CMD_garagesign () { | |||
262 | fi | 272 | fi |
263 | garage-sign targets sign --repo tufrepo \ | 273 | garage-sign targets sign --repo tufrepo \ |
264 | --home-dir ${GARAGE_SIGN_REPO} \ | 274 | --home-dir ${GARAGE_SIGN_REPO} \ |
275 | ${target_expiry} \ | ||
265 | --key-name=targets | 276 | --key-name=targets |
266 | errcode=0 | 277 | errcode=0 |
267 | garage-sign targets push --repo tufrepo \ | 278 | garage-sign targets push --repo tufrepo \ |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 86863d9..5b06397 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
@@ -51,6 +51,8 @@ GARAGE_SIGN_KEYNAME ?= "garage-key" | |||
51 | GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" | 51 | GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" |
52 | GARAGE_TARGET_VERSION ?= "" | 52 | GARAGE_TARGET_VERSION ?= "" |
53 | GARAGE_TARGET_URL ?= "" | 53 | GARAGE_TARGET_URL ?= "" |
54 | GARAGE_TARGET_EXPIRES ?= "" | ||
55 | GARAGE_TARGET_EXPIRE_AFTER ?= "" | ||
54 | GARAGE_CUSTOMIZE_TARGET ?= "" | 56 | GARAGE_CUSTOMIZE_TARGET ?= "" |
55 | 57 | ||
56 | SOTA_MACHINE ??="none" | 58 | SOTA_MACHINE ??="none" |