Modify AWS job to run from internal repo 93/1293/1
authorYolanda Robla <yroblamo@redhat.com>
Wed, 31 Jul 2019 09:57:48 +0000 (11:57 +0200)
committerYolanda Robla <yroblamo@redhat.com>
Wed, 31 Jul 2019 09:57:48 +0000 (11:57 +0200)
Signed-off-by: Yolanda Robla <yroblamo@redhat.com>
Change-Id: I4a9224cf4d35d8cbe6b7aea19718c24a2c7c541d

ci/kni_deploy_aws.sh

index d9c468d..3a9a867 100755 (executable)
@@ -23,26 +23,25 @@ SITE_NAME='edge-sites-testing.devcluster.openshift.com'
 echo '---> Starting kni installer generation'
 export GOPATH=${WORKSPACE}/
 
-# move the blueprint to an inner directory
-mkdir ${WORKSPACE}/blueprint-pae
-mv base profiles sites tools ${WORKSPACE}/blueprint-pae/
-
-# clone installer in the right directory
-sudo rm -rf ${WORKSPACE}/${KNI_PATH}
-mkdir -p ${WORKSPACE}/${KNI_PATH}
-pushd ${WORKSPACE}/${KNI_PATH}/
-git clone https://gerrit.akraino.org/r/kni/installer
-pushd installer
-
 # first build kni installer
+sudo rm -rf ${WORKSPACE}/${KNI_PATH}
+mkdir -p ${WORKSPACE}/${KNI_PATH}/installer
+cp -a installer ${WORKSPACE}/${KNI_PATH}/
+pushd ${WORKSPACE}/${KNI_PATH}/installer
 make build 2>&1 | tee ${WORKSPACE}/build.log
 
 # add the right credentials to kni
 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/"
+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}
+
 # start the workflow
-./knictl fetch_requirements file://${WORKSPACE}/blueprint-pae//sites/${SITE_NAME} 2>&1 | tee ${WORKSPACE}/aws_requirements.log
+sudo rm -rf /$HOME/.kni/${SITE_NAME}/final_manifests || true
+./knictl fetch_requirements file://${BLUEPRINT_PATH}/sites/${SITE_NAME} 2>&1 | tee ${WORKSPACE}/aws_requirements.log
 ./knictl prepare_manifests ${SITE_NAME} 2>&1 | tee ${WORKSPACE}/aws_manifests.log
 
 # now run the cluster