X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fapex%2Fapex-download-artifact.sh;h=3efe1cbc7bb1c4f86cc88a50d564efb55fc41960;hb=82186f604ac1cdb4d65c541555d5278a5f875514;hp=066d6120329eff9f9320b96689cb392d623036d4;hpb=3ec4f930f4ab7910ce730b4648f2a7403711cdcd;p=releng.git diff --git a/jjb/apex/apex-download-artifact.sh b/jjb/apex/apex-download-artifact.sh index 066d61203..3efe1cbc7 100755 --- a/jjb/apex/apex-download-artifact.sh +++ b/jjb/apex/apex-download-artifact.sh @@ -13,36 +13,24 @@ echo if [ -z "$DEPLOY_SCENARIO" ]; then echo "Deploy scenario not set!" exit 1 -elif [[ "$DEPLOY_SCENARIO" == *gate* ]]; then - echo "Detecting Gating scenario..." - if [ -z "$GERRIT_EVENT_COMMENT_TEXT" ]; then - echo "ERROR: Gate job triggered without comment!" - exit 1 - else - DEPLOY_SCENARIO=$(echo ${GERRIT_EVENT_COMMENT_TEXT} | grep start-gate-scenario | grep -Eo 'os-.*$') - if [ -z "$DEPLOY_SCENARIO" ]; then - echo "ERROR: Unable to detect scenario in Gerrit Comment!" - echo "Format of comment to trigger gate should be 'start-gate-scenario: '" - exit 1 - else - echo "Gate scenario detected: ${DEPLOY_SCENARIO}" - fi - fi +else + echo "Deploy scenario: ${DEPLOY_SCENARIO}" fi -# if upstream we do not need to download anything -if [[ "$DEPLOY_SCENARIO" =~ upstream ]]; then - echo "Upstream deployment detected, skipping download artifact" -elif [[ "$ARTIFACT_VERSION" =~ dev ]]; then - # dev build - GERRIT_PATCHSET_NUMBER=$(echo $GERRIT_REFSPEC | grep -Eo '[0-9]+$') - export OPNFV_ARTIFACT_VERSION="dev${GERRIT_CHANGE_NUMBER}_${GERRIT_PATCHSET_NUMBER}" - # get build artifact - pushd ${BUILD_DIRECTORY} > /dev/null - echo "Downloading packaged dev build: apex-${OPNFV_ARTIFACT_VERSION}.tar.gz" - curl --fail -s -o $BUILD_DIRECTORY/apex-${OPNFV_ARTIFACT_VERSION}.tar.gz http://$GS_URL/apex-${OPNFV_ARTIFACT_VERSION}.tar.gz - tar -xvf apex-${OPNFV_ARTIFACT_VERSION}.tar.gz - popd > /dev/null +if [[ "$ARTIFACT_VERSION" =~ dev ]]; then + if [ "$BRANCH" == 'master' ]; then + echo "Skipping download of artifacts for master branch" + else + # dev build + GERRIT_PATCHSET_NUMBER=$(echo $GERRIT_REFSPEC | grep -Eo '[0-9]+$') + export OPNFV_ARTIFACT_VERSION="dev${GERRIT_CHANGE_NUMBER}_${GERRIT_PATCHSET_NUMBER}" + # get build artifact + pushd ${BUILD_DIRECTORY} > /dev/null + echo "Downloading packaged dev build: apex-${OPNFV_ARTIFACT_VERSION}.tar.gz" + curl --fail -s -o $BUILD_DIRECTORY/apex-${OPNFV_ARTIFACT_VERSION}.tar.gz http://$GS_URL/apex-${OPNFV_ARTIFACT_VERSION}.tar.gz + tar -xvf apex-${OPNFV_ARTIFACT_VERSION}.tar.gz + popd > /dev/null + fi else echo "Will use RPMs..." @@ -58,20 +46,16 @@ else RPM_INSTALL_PATH=$(echo "http://"$OPNFV_RPM_URL | sed 's/\/'"$(basename $OPNFV_RPM_URL)"'//') RPM_LIST=$(basename $OPNFV_RPM_URL) - # find version of RPM - VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-([0-9]{8}|[a-z]+-[0-9]\.[0-9]+)') - # build RPM List which already includes base Apex RPM - RPM_LIST+=" opnfv-apex-undercloud-${VERSION_EXTENSION}.noarch.rpm" - - # add back legacy support for danube - if [ "$BRANCH" == 'stable/danube' ]; then - RPM_LIST+=" opnfv-apex-common-${VERSION_EXTENSION}.noarch.rpm" - else + if [ "$BRANCH" != 'master' ]; then + # find version of RPM + VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-([0-9]{8}|[a-z]+-[0-9]\.[0-9]+)') + # build RPM List which already includes base Apex RPM + RPM_LIST+=" opnfv-apex-undercloud-${VERSION_EXTENSION}.noarch.rpm" RPM_LIST+=" python34-opnfv-apex-${VERSION_EXTENSION}.noarch.rpm" fi # remove old / install new RPMs - if rpm -q opnfv-apex > /dev/null; then + if rpm -q python34-opnfv-apex > /dev/null; then INSTALLED_RPMS=$(rpm -qa | grep apex) if [ -n "$INSTALLED_RPMS" ]; then sudo yum remove -y ${INSTALLED_RPMS}