diff options
author | Tim Rozet <trozet@redhat.com> | 2016-01-06 16:02:10 -0500 |
---|---|---|
committer | Tim Rozet <trozet@redhat.com> | 2016-01-06 16:02:10 -0500 |
commit | b82a99d50e023b5982a815d669b4d31926bb52dc (patch) | |
tree | b852a22f9bd34d85e0229b6f917a4c273eb43f58 | |
parent | 3f1f8344838cb7cfe8efe1aecde75c524441430f (diff) |
Enable baremetal jobs for Apex on LF POD1
Change-Id: I276b3acf7f49d13b7cb125c022d567d4021dac71
Signed-off-by: Tim Rozet <trozet@redhat.com>
-rw-r--r-- | jjb/apex/apex.yml | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index e499f2987..97a70138c 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -197,7 +197,7 @@ # branch: branch (eg. stable) node: opnfv-jump-1 - disabled: true + disabled: false scm: - git-scm: @@ -212,6 +212,7 @@ gs-pathname: '{gs-pathname}' builders: + - 'apex-deploy-baremetal' - 'apex-workspace-cleanup' - job-template: @@ -434,6 +435,64 @@ echo "--------------------------------------------------------" echo "Done!" +- builder: + name: 'apex-deploy-baremetal' + builders: + - shell: | + #!/bin/bash + set -o errexit + set -o nounset + set -o pipefail + + # log info to console + echo "Starting the Apex baremetal deployment." + echo "--------------------------------------------------------" + echo + + if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then + # if artifact name is passed the pull a + # specific artifact from artifacts.opnfv.org + RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME + else + if [[ -f opnfv.properties ]]; then + # if opnfv.properties exists then use the + # local build. Source the file so we get local OPNFV vars + source opnfv.properties + RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL) + else + # no opnfv.properties means use the latest from artifacts.opnfv.org + # get the latest.properties to get the link to the latest artifact + curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties + [[ -f opnfv.properties ]] || exit 1 + # source the file so we get OPNFV vars + source opnfv.properties + RPM_INSTALL_PATH=$OPNFV_RPM_URL + fi + fi + + source opnfv.properties + RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL) + + # update / install the new rpm + if rpm -q opnfv-apex > /dev/null; then + if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then + sudo yum downgrade -y $RPM_INSTALL_PATH; + fi + else + sudo yum install -y $RPM_INSTALL_PATH; + fi + + # cleanup environment before we start + sudo opnfv-clean + # initiate baremetal deployment + sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \ + -d /usr/share/doc/opnfv/deploy_settings.yaml.example \ + -n /root/network/network_settings.yaml + + echo + echo "--------------------------------------------------------" + echo "Done!" + ####################### # trigger macros ######################## |