Parameterize the name of the blueprint 97/1797/1
authorYolanda Robla <yroblamo@redhat.com>
Thu, 17 Oct 2019 10:41:39 +0000 (12:41 +0200)
committerYolanda Robla <yroblamo@redhat.com>
Thu, 17 Oct 2019 10:42:56 +0000 (12:42 +0200)
Now we don't have a single blueprint, but two.
So we cannot have the name of the blueprint hardcoded
anymore. By looking at the env vars provided by
jenkins, we can reuse the GIT_CHECKOUT_DIR env var
instead, that will contain the name of the blueprint.

Signed-off-by: Yolanda Robla <yroblamo@redhat.com>
Change-Id: I3a0e517d64268f2287bb19ca50d2e5f7431ded22

ci/kni_deploy_aws.sh
ci/kni_deploy_libvirt.sh

index 3a9a867..775f1d8 100755 (executable)
@@ -35,9 +35,9 @@ mkdir $HOME/.kni || true
 cp $WORKSPACE/akraino-secrets/coreos-pull-secret $HOME/.kni/pull-secret.json || true
 
 # replace site path with a local ref to the cloned blueprint
-BLUEPRINT_PATH="${WORKSPACE}/blueprint-pae/"
+BLUEPRINT_PATH="${WORKSPACE}/${GIT_CHECKOUT_DIR}/"
 KUSTOMIZATION_FILE=${BLUEPRINT_PATH}/sites/${SITE_NAME}/00_install-config/kustomization.yaml
-sed -i "s#- git::https://gerrit.akraino.org/r/kni/blueprint-pae.git/#- file://${BLUEPRINT_PATH}#g" ${KUSTOMIZATION_FILE}
+sed -i "s#- git::https://gerrit.akraino.org/r/kni/${GIT_CHECKOUT_DIR}.git/#- file://${BLUEPRINT_PATH}#g" ${KUSTOMIZATION_FILE}
 
 # start the workflow
 sudo rm -rf /$HOME/.kni/${SITE_NAME}/final_manifests || true
index f83c39d..2f47a8f 100755 (executable)
@@ -42,9 +42,9 @@ cp $WORKSPACE/akraino-secrets/coreos-pull-secret $HOME/.kni/pull-secret.json ||
 cp $HOME/.ssh/id_rsa.pub $HOME/.kni/id_rsa.pub || true
 
 # replace site path with a local ref to the cloned blueprint
-BLUEPRINT_PATH="${WORKSPACE}/blueprint-pae/"
+BLUEPRINT_PATH="${WORKSPACE}/${GIT_CHECKOUT_DIR}/"
 KUSTOMIZATION_FILE=${BLUEPRINT_PATH}/sites/${SITE_NAME}/00_install-config/kustomization.yaml
-sed -i "s#- git::https://gerrit.akraino.org/r/kni/blueprint-pae.git/#- file://${BLUEPRINT_PATH}#g" ${KUSTOMIZATION_FILE}
+sed -i "s#- git::https://gerrit.akraino.org/r/kni/${GIT_CHECKOUT_DIR}.git/#- file://${BLUEPRINT_PATH}#g" ${KUSTOMIZATION_FILE}
 
 # start the workflow
 sudo rm -rf /$HOME/.kni/${SITE_NAME}/final_manifests || true