X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fapex%2Fapex-deploy.sh;h=4244f44279fc4f4922bebc4e043d635f5861b6ca;hb=71a9ca68b973420a90429bbd75c198c0ed7582b7;hp=74f67ce5f12f1d38f5fd18958515fb81db4efb97;hpb=2898aade06c834cbe2f2d6b3a212e1cf5accaf09;p=releng.git diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index 74f67ce5f..958e4bf5e 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -3,7 +3,6 @@ set -o errexit set -o nounset set -o pipefail -APEX_PKGS="common undercloud" # removed onos for danube IPV6_FLAG=False # log info to console @@ -14,30 +13,19 @@ 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 # Dev or RPM/ISO build -if [[ "$ARTIFACT_VERSION" =~ dev ]]; then +# 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 # Settings for deploying from git workspace DEPLOY_SETTINGS_DIR="${WORKSPACE}/config/deploy" NETWORK_SETTINGS_DIR="${WORKSPACE}/config/network" - DEPLOY_CMD="${WORKSPACE}/ci/deploy.sh" - CLEAN_CMD="${WORKSPACE}/ci/clean.sh" + DEPLOY_CMD="opnfv-deploy --image-dir ${WORKSPACE}/.build" + CLEAN_CMD="opnfv-clean" RESOURCES="${WORKSPACE}/.build/" CONFIG="${WORKSPACE}/build" BASE=$CONFIG @@ -47,6 +35,11 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then # Ensure artifacts were downloaded and extracted correctly # TODO(trozet) add verification here + # Install dev build + sudo rm -rf /tmp/.build + mv -f .build /tmp/ + sudo pip3 install --upgrade --force-reinstall . + mv -f /tmp/.build ${WORKSPACE}/ else DEPLOY_SETTINGS_DIR="/etc/opnfv-apex/" NETWORK_SETTINGS_DIR="/etc/opnfv-apex/" @@ -57,12 +50,17 @@ else BASE=$CONFIG IMAGES=$RESOURCES LIB="/var/opt/opnfv/lib" - + sudo mkdir -p /var/log/apex + sudo chmod 777 /var/log/apex + cd /var/log/apex fi # Install Dependencies # Make sure python34 dependencies are installed -for dep_pkg in epel-release python34 python34-PyYAML python34-setuptools; do +dependencies="epel-release python34 python34-devel libvirt-devel python34-pip \ +ansible python34-PyYAML python34-jinja2 python34-setuptools python-tox ansible" + +for dep_pkg in $dependencies; do if ! rpm -q ${dep_pkg} > /dev/null; then if ! sudo yum install -y ${dep_pkg}; then echo "Failed to install ${dep_pkg}" @@ -71,31 +69,12 @@ for dep_pkg in epel-release python34 python34-PyYAML python34-setuptools; do fi done -# Make sure jinja2 is installed -for python_pkg in jinja2; do - if ! python3.4 -c "import $python_pkg"; then - echo "$python_pkg package not found for python3.4, attempting to install..." - if ! sudo easy_install-3.4 $python_pkg; then - echo -e "Failed to install $python_pkg package for python3.4" - exit 1 - fi - fi -done - if [[ "$JOB_NAME" =~ "virtual" ]]; then # Make sure ipxe-roms-qemu package is updated to latest. # This package is needed for multi virtio nic PXE boot in virtual environment. sudo yum update -y ipxe-roms-qemu - if [ -z ${PYTHONPATH:-} ]; then - export PYTHONPATH=${WORKSPACE}/lib/python - else - export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python - fi fi -# set env vars to deploy cmd -DEPLOY_CMD="BASE=${BASE} IMAGES=${IMAGES} LIB=${LIB} ${DEPLOY_CMD}" - if [ "$OPNFV_CLEAN" == 'yes' ]; then if sudo test -e '/root/inventory/pod_settings.yaml'; then clean_opts='-i /root/inventory/pod_settings.yaml' @@ -103,7 +82,7 @@ if [ "$OPNFV_CLEAN" == 'yes' ]; then clean_opts='' fi - sudo BASE=${BASE} LIB=${LIB} ${CLEAN_CMD} ${clean_opts} + sudo ${CLEAN_CMD} ${clean_opts} fi if echo ${DEPLOY_SCENARIO} | grep ipv6; then @@ -129,7 +108,7 @@ if [[ "$JOB_NAME" =~ "virtual" ]]; then DEPLOY_CMD="${DEPLOY_CMD} -e csit-environment.yaml" fi if [[ "$PROMOTE" == "True" ]]; then - DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 2" + DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 1" fi else # settings for bare metal deployment @@ -144,10 +123,13 @@ else DEPLOY_CMD="${DEPLOY_CMD} -i ${INVENTORY_FILE}" fi +if [[ "$DEPLOY_SCENARIO" =~ "upstream" ]]; 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 echo ${DEPLOY_SCENARIO} | grep fdio; then - NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_vpp.yaml" else NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings.yaml" fi