Enable fuel daily runs on POD2 49/2249/2
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Mon, 5 Oct 2015 07:30:41 +0000 (09:30 +0200)
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>
Mon, 5 Oct 2015 07:31:49 +0000 (09:31 +0200)
Change-Id: Iad31f257d1198e9730ea0db68a18737009c00a95
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
jjb/fuel/fuel-deploy.sh [new file with mode: 0755]
jjb/fuel/fuel-lab-reconfig.sh [new file with mode: 0755]
jjb/fuel/fuel.yml
jjb/genesis/genesis-fuel.yml

diff --git a/jjb/fuel/fuel-deploy.sh b/jjb/fuel/fuel-deploy.sh
new file mode 100755 (executable)
index 0000000..4d7a9b9
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# source the file so we get OPNFV vars
+source latest.properties
+
+# echo the info about artifact that is used during the deployment
+echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f4) for deployment"
+
+# create TMPDIR if it doesn't exist
+export TMPDIR=$HOME/tmpdir
+[[ -d $TMPDIR ]] || mkdir -p $TMPDIR
+
+# change permissions down to TMPDIR
+chmod a+x $HOME
+chmod a+x $TMPDIR
+
+# set CONFDIR, BRIDGE
+export CONFDIR=$WORKSPACE/fuel/deploy/templates/hardware_environment/conf/linux_foundation_lab/pod2
+export BRIDGE=pxebr
+
+# clone genesis repo and checkout the SR1 tag
+echo "Cloning genesis repo"
+cd $WORKSPACE
+git clone https://gerrit.opnfv.org/gerrit/p/genesis.git genesis
+cd genesis
+git checkout arno.2015.2.0
+
+# cleanup first
+sudo $WORKSPACE/genesis/common/ci/clean.sh -base_config $WORKSPACE/genesis/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
+
+# prepare for Fuel Deployment
+sudo $WORKSPACE/genesis/common/ci/setup.sh
+
+# log info to console
+echo "Starting the deployment using $INSTALLER. This could take some time..."
+echo "--------------------------------------------------------"
+echo
+
+# start the deployment
+echo "Issuing command"
+echo "sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
+sudo $WORKSPACE/fuel/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
+
+echo
+echo "--------------------------------------------------------"
+echo "Done!"
diff --git a/jjb/fuel/fuel-lab-reconfig.sh b/jjb/fuel/fuel-lab-reconfig.sh
new file mode 100755 (executable)
index 0000000..a79bc2c
--- /dev/null
@@ -0,0 +1,72 @@
+#!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# check to see if ucs login info file exists
+if [ -e ~/.ssh/ucs_creds ];then
+    source ~/.ssh/ucs_creds
+else
+    echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
+    exit 1
+fi
+
+# clone releng
+echo "Cloning releng repo..."
+if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
+    echo "Unable to clone releng repo...Exiting"
+    exit 1
+fi
+
+# log info to console
+echo "Starting the lab reconfiguration for $INSTALLER..."
+echo "--------------------------------------------------------"
+echo
+
+# create venv
+$WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
+
+# disable nounset because 'activate' script contains unbound variable(s)
+set +o nounset
+# enter venv
+source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
+# set nounset back again
+set -o nounset
+
+# verify we are in venv
+if [[ ! $(which python | grep venv) ]]; then
+    echo "Unable to activate venv...Exiting"
+    exit 1
+fi
+
+python $WORKSPACE/releng/utils/lab-reconfiguration/reconfigUcsNet.py -i $ucs_host -u $ucs_user -p $ucs_password -f $WORKSPACE/releng/utils/lab-reconfiguration/fuel.yaml
+
+# while undergoing reboot
+sleep 30
+
+# check to see if slave is back up
+ping_counter=0
+ping_flag=0
+while [ "$ping_counter" -lt 20 ]; do
+    if [[ $(ping -c 5 172.30.10.72) ]]; then
+        ping_flag=1
+        break
+    fi
+    ((ping_counter++))
+    sleep 10
+done
+
+if [ "$ping_flag" -eq 1 ]; then
+    echo "Slave is pingable, now wait 180 seconds for services to start"
+    sleep 180
+else
+    echo "Slave did not come back up after reboot: please check opnfv-jump-2"
+    exit 1
+fi
+
+set +o nounset
+deactivate
+
+echo
+echo "--------------------------------------------------------"
+echo "Done!"
index 1d0b369..5703b0a 100644 (file)
@@ -15,6 +15,9 @@
         - 'fuel-merge-build-{stream}'
         - 'fuel-merge-virtual-deploy-{stream}'
         - 'fuel-daily-{stream}'
+        - 'fuel-build-{stream}'
+        - 'fuel-deploy-{stream}'
+        - 'fuel-lab-reconfig-{stream}'
 
     stream:
         - master:
 - job-template:
     name: 'fuel-daily-{stream}'
 
+    project-type: freestyle
+
     node: ericsson-build
 
-    disabled: true
+    disabled: false
 
-    project-type: freestyle
+    triggers:
+        - 'fuel-{strem}-trigger'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - fuel-parameter:
+            installer: '{installer}'
+            gs-pathname: '{gs-pathname}'
+
+    scm:
+        - git-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            branch: '{branch}'
 
     logrotate:
         daysToKeep: '{build-days-to-keep}'
         artifactDaysToKeep: '{build-artifact-days-to-keep}'
         artifactNumToKeep: '{build-artifact-num-to-keep}'
 
+    builders:
+        - trigger-builds:
+          - project: 'fuel-build-{stream}'
+            git-revision: true
+            block: true
+        - trigger-builds:
+          - project: 'fuel-lab-reconfig-{stream}'
+            git-revision: true
+            block: true
+        - trigger-builds:
+          - project: 'fuel-deploy-{stream}'
+            git-revision: true
+            block: true
+        - trigger-builds:
+          - project: 'functest-fuel-{stream}'
+            block: true
+            block-thresholds:
+                build-step-failure-threshold: 'never'
+                failure-threshold: 'never'
+                unstable-threshold: 'FAILURE'
+
+    triggers:
+        - 'fuel-{stream}-daily-trigger'
+
+- job-template:
+    name: 'fuel-build-{stream}'
+
+    project-type: freestyle
+
+    node: ericsson-build
+
+    logrotate:
+        daysToKeep: 30
+        numToKeep: 10
+        artifactDaysToKeep: -1
+        artifactNumToKeep: -1
+
     parameters:
         - project-parameter:
             project: '{project}'
+        - fuel-parameter:
+            installer: '{installer}'
+            gs-pathname: '{gs-pathname}'
 
     scm:
         - git-scm:
             refspec: ''
             branch: '{branch}'
 
-    wrappers:
-        - ssh-agent-credentials:
-            user: '{ssh-credentials}'
+    builders:
+        - shell:
+            !include-raw ./fuel-build.sh
+        - shell:
+            !include-raw ./fuel-upload-artifact.sh
+        - shell:
+            !include-raw ./fuel-workspace-cleanup.sh
 
-    triggers:
-        - timed: 'H H * * *'
+    publishers:
+        - email:
+            recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
+
+- job-template:
+    name: 'fuel-deploy-{stream}'
+
+    project-type: freestyle
+
+    disabled: false
+
+    node: opnfv-jump-2
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - fuel-parameter:
+            installer: '{installer}'
+            gs-pathname: '{gs-pathname}'
+        - string:
+            name: GIT_BASE
+            default: ssh://gerrit.opnfv.org:29418/$PROJECT
+            description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again."
+
+    scm:
+        - git-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            branch: '{branch}'
+
+    logrotate:
+        daysToKeep: 30
+        numToKeep: 10
+        artifactDaysToKeep: -1
+        artifactNumToKeep: -1
 
     builders:
         - shell:
-             echo "Hello World"
+            !include-raw ./fuel-download-artifact.sh
+        - shell:
+            !include-raw ./fuel-deploy.sh
+
+    publishers:
+        - email:
+            recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
+
+- job-template:
+    name: 'fuel-lab-reconfig-{stream}'
+
+    project-type: freestyle
+
+    disabled: false
+
+    node: master
+
+    logrotate:
+        daysToKeep: 30
+        numToKeep: 10
+        artifactDaysToKeep: -1
+        artifactNumToKeep: -1
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - fuel-parameter:
+            installer: '{installer}'
+            gs-pathname: '{gs-pathname}'
+        - string:
+            name: GIT_BASE
+            default: ssh://gerrit.opnfv.org:29418/$PROJECT
+            description: "Used for overriding the GIT URL coming from parameters macro."
+
+    scm:
+        - git-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            branch: '{branch}'
+
+    properties:
+        - build-blocker:
+            use-build-blocker: true
+            blocking-jobs:
+                - "apex-daily.*"
+
+    builders:
+        - shell:
+            !include-raw ./fuel-lab-reconfig.sh
 
 ########################
 # parameter macros
             name: GS_URL
             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
             description: "URL to Google Storage."
+
+########################
+# trigger macros
+########################
+- trigger:
+    name: 'fuel-master-daily-trigger'
+    triggers:
+        - timed: '0 5 * * *'
index dc203ef..a957a69 100644 (file)
     disabled: '{obj:disabled}'
 
     triggers:
-        - 'fuel-{stream}'
+        - 'genesis-fuel-{stream}-trigger'
 
     parameters:
         - project-parameter:
 # trigger macros
 ########################
 - trigger:
-    name: 'fuel-master'
+    name: 'genesis-fuel-master-trigger'
     triggers:
         - timed: '0 5 * * *'
 
 - trigger:
-    name: 'fuel-stable-arno'
+    name: 'genesis-fuel-stable-arno-trigger'
     triggers:
         - timed: '0 7 * * *'