- sudo chown -R jenkins:jenkins $WORKSPACE
- sudo chown -R jenkins:jenkins ${HOME}/.cache
- fi
-}
-
-function cleanup_and_upload() {
- original_exit=$?
- fix_ownership
- upload_logs
- exit $original_exit
-}
-
-# check distro to see if we support it
-if [[ ! "$DISTRO" =~ (trusty|centos7|suse) ]]; then
- echo "Distro $DISTRO is not supported!"
- exit 1
-fi
-
-# remove previously cloned repos
-sudo /bin/rm -rf /opt/bifrost /opt/stack /opt/releng
-
-# Fix up permissions
-fix_ownership
-
-# clone all the repos first and checkout the patch afterwards
-sudo git clone https://git.openstack.org/openstack/bifrost /opt/bifrost
-sudo git clone https://gerrit.opnfv.org/gerrit/releng /opt/releng
-
-# checkout the patch
-cd $CLONE_LOCATION
-sudo git fetch $PROJECT_REPO $GERRIT_REFSPEC && sudo git checkout FETCH_HEAD
-
-# combine opnfv and upstream scripts/playbooks
-sudo /bin/cp -rf /opt/releng/prototypes/bifrost/* /opt/bifrost/