From 27e00b4e2298de0fe09cf7b2928929d0053c0022 Mon Sep 17 00:00:00 2001
From: Denis Pynkin <denis.pynkin@collabora.com>
Date: Tue, 26 Mar 2019 19:07:57 +0300
Subject: [PATCH] Jenkinsfile: enable OSTree Collection ID

Add Collection ID and binding refs for OSTree-based artifacts:
- commits
- images
- test delta

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
---
 Jenkinsfile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
index d23a1554..5897f415 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -3,6 +3,7 @@
 env.PIPELINE_VERSION = VersionNumber(versionNumberString: '${BUILD_DATE_FORMATTED,"yyyyMMdd"}.${BUILDS_TODAY_Z}')
 
 osname = 'apertis'
+collection_id = "org.apertis.os"
 
 release = "v2019dev0"
 
@@ -244,6 +245,7 @@ def buildOStree(architecture, type, board, debosarguments = "", repo = "repo") {
         -t image:${image_name} \
         -t message:${release}-${type}-${architecture}-${board}_${PIPELINE_VERSION} \
         -t ostree:${repo} \
+        -t collection_id:${collection_id} \
         ${WORKSPACE}/${osname}-ostree-commit.yaml""")
 
   sh(script: """
@@ -267,6 +269,8 @@ def buildOStreeRollbackDelta(architecture, type, board, debosarguments = "", rep
       ostree --repo=${repo} commit \
         --tree=ref=${branch} \
         --branch=${rollback_branch} \
+        --add-metadata-string=ostree.collection-binding=${collection_id} \
+        --bind-ref=${branch} \
         --skip-list="skip_list"
       mkdir -p tests
       ostree --repo=${repo} static-delta generate \
@@ -346,6 +350,7 @@ def buildOStreeImage(architecture, type, board, debosarguments = "") {
             -t image:${image_name} \
             -t message:${release}-${type}-${architecture}-${board}_${PIPELINE_VERSION} \
             -t ostree:${repo} \
+            -t collection_id:${collection_id} \
             ${WORKSPACE}/apertis-ostree-image-${board}.yaml;""")
     }
 }
@@ -368,6 +373,7 @@ def buildContainer(architecture, type, board, debosarguments = "") {
              -t ospack:${osname}_ostree_${release}-${type}-${architecture}-${board}_${PIPELINE_VERSION} \
              -t message:${release}-${type}-${architecture}-${type}-${board}_${PIPELINE_VERSION} \
              -t ostree:${repo} \
+             -t collection_id:${collection_id} \
              ${WORKSPACE}/${osname}-ostree-pack.yaml""")
     }
 }
-- 
GitLab