X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fapex%2Fapex-deploy.sh;h=f5c6ab108212ad75d2b580b44c0b27041c4455ac;hb=67095804e6eff887bbc8ea2f96f36821095d325f;hp=958e4bf5e5e8a34ce1ec03a5f037ff2829d600e2;hpb=8d84d7d9ac290135804b8ab3f5506e175db8d29e;p=releng.git diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index 958e4bf5e..f5c6ab108 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -18,20 +18,26 @@ else fi # Dev or RPM/ISO build -# For upstream deployments we currently only use git repo and not RPM -# Need to decide after Fraser if we want to use RPM or not for upstream -if [[ "$ARTIFACT_VERSION" =~ dev || "$DEPLOY_SCENARIO" =~ "upstream" ]]; then +if [[ "$ARTIFACT_VERSION" =~ dev ]]; then # Settings for deploying from git workspace DEPLOY_SETTINGS_DIR="${WORKSPACE}/config/deploy" NETWORK_SETTINGS_DIR="${WORKSPACE}/config/network" - DEPLOY_CMD="opnfv-deploy --image-dir ${WORKSPACE}/.build" CLEAN_CMD="opnfv-clean" - RESOURCES="${WORKSPACE}/.build/" + # if we are using master, then we are downloading/caching upstream images + # we want to use that built in mechanism to avoid re-downloading every job + # so we use a dedicated folder to hold the upstream cache + UPSTREAM_CACHE=$HOME/upstream_cache + if [ "$BRANCH" == 'master' ]; then + mkdir -p ${UPSTREAM_CACHE} + RESOURCES=$UPSTREAM_CACHE + else + RESOURCES="${WORKSPACE}/.build/" + fi CONFIG="${WORKSPACE}/build" BASE=$CONFIG IMAGES=$RESOURCES LIB="${WORKSPACE}/lib" - + DEPLOY_CMD="opnfv-deploy --image-dir ${RESOURCES}" # Ensure artifacts were downloaded and extracted correctly # TODO(trozet) add verification here @@ -43,9 +49,17 @@ if [[ "$ARTIFACT_VERSION" =~ dev || "$DEPLOY_SCENARIO" =~ "upstream" ]]; then else DEPLOY_SETTINGS_DIR="/etc/opnfv-apex/" NETWORK_SETTINGS_DIR="/etc/opnfv-apex/" - DEPLOY_CMD="opnfv-deploy" CLEAN_CMD="opnfv-clean" - RESOURCES="/var/opt/opnfv/images" + # set to use different directory here because upon RPM removal this + # directory will be wiped in daily + UPSTREAM_CACHE=$HOME/upstream_cache + if [ "$BRANCH" == 'master' ]; then + mkdir -p ${UPSTREAM_CACHE} + RESOURCES=$UPSTREAM_CACHE + else + RESOURCES="/var/opt/opnfv/images" + fi + DEPLOY_CMD="opnfv-deploy --image-dir ${RESOURCES}" CONFIG="/var/opt/opnfv" BASE=$CONFIG IMAGES=$RESOURCES @@ -104,11 +118,8 @@ if [[ "$JOB_NAME" =~ "virtual" ]]; then if [[ "${DEPLOY_SCENARIO}" =~ fdio|ovs ]]; then DEPLOY_CMD="${DEPLOY_CMD} --virtual-default-ram 12 --virtual-compute-ram 7" fi - if [[ "$JOB_NAME" == *csit* ]]; then - DEPLOY_CMD="${DEPLOY_CMD} -e csit-environment.yaml" - fi if [[ "$PROMOTE" == "True" ]]; then - DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 1" + DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 2 -e csit-environment.yaml" fi else # settings for bare metal deployment @@ -123,13 +134,15 @@ else DEPLOY_CMD="${DEPLOY_CMD} -i ${INVENTORY_FILE}" fi -if [[ "$DEPLOY_SCENARIO" =~ "upstream" ]]; then +if [[ "$BRANCH" == "master" ]]; then echo "Upstream deployment detected" DEPLOY_CMD="${DEPLOY_CMD} --upstream" fi if [ "$IPV6_FLAG" == "True" ]; then NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_v6.yaml" +elif [[ "$PROMOTE" == "True" ]]; then + NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_csit.yaml" else NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings.yaml" fi @@ -143,16 +156,6 @@ fi # start deployment sudo ${DEPLOY_CMD} -d ${DEPLOY_FILE} -n ${NETWORK_FILE} --debug -if [[ "$JOB_NAME" == *csit* ]]; then - echo "CSIT job: setting host route for floating ip routing" - # csit route to allow docker container to reach floating ips - UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo "[0-9\.]+{3}[0-9]+") - if sudo route | grep 192.168.37.128 > /dev/null; then - sudo route del -net 192.168.37.128 netmask 255.255.255.128 - fi - sudo route add -net 192.168.37.128 netmask 255.255.255.128 gw ${UNDERCLOUD} -fi - echo echo "--------------------------------------------------------" echo "Done!"