fuel: Enable usage of new scenario description 93/6193/1
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Mon, 11 Jan 2016 15:56:57 +0000 (16:56 +0100)
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>
Mon, 11 Jan 2016 15:56:57 +0000 (16:56 +0100)
Change-Id: Id61ddc6a2dae9378e2517174006ab1836a45114d
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
jjb/fuel/fuel-ci-jobs.yml
jjb/fuel/fuel-deploy-new.sh [new file with mode: 0755]

index 37cf788..452d037 100644 (file)
@@ -49,6 +49,7 @@
     jobs:
         - 'fuel-{sdn-controller}-{pod}-daily-{stream}'
         - 'fuel-deploy-{pod}-daily-{stream}'
+        - 'fuel-deploy-{pod}-daily-{stream}-wip'
 
 ########################
 # job templates
     publishers:
         - email:
             recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
+
+- job-template:
+    name: 'fuel-deploy-{pod}-daily-{stream}-wip'
+
+    concurrent: false
+
+    properties:
+        - throttle:
+            enabled: true
+            max-total: 1
+            max-per-node: 1
+
+    parameters:
+        - project-parameter:
+            project: 'fuel'
+        - 'ericsson-pod2-defaults'
+        - 'fuel-defaults'
+        - fuel-ci-parameter:
+            gs-pathname: ''
+
+    scm:
+        - git-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            branch: 'master'
+
+    wrappers:
+        - build-name:
+            name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
+
+    builders:
+        - shell:
+            !include-raw-escape: ./fuel-download-artifact.sh
+        - shell:
+            !include-raw-escape: ./fuel-deploy-new.sh
+
+    publishers:
+        - email:
+            recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com
 ########################
 # parameter macros
 ########################
diff --git a/jjb/fuel/fuel-deploy-new.sh b/jjb/fuel/fuel-deploy-new.sh
new file mode 100755 (executable)
index 0000000..1e362bc
--- /dev/null
@@ -0,0 +1,59 @@
+#!/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'/' -f3) for deployment"
+
+# checkout the commit that was used for building the downloaded artifact
+# to make sure the ISO and deployment mechanism uses same versions
+#echo "Checking out $OPNFV_GIT_SHA1"
+#git checkout $OPNFV_GIT_SHA1 --quiet
+
+# set deployment parameters
+BRIDGE=pxebr
+export TMPDIR=$HOME/tmpdir
+LAB_NAME=${NODE_NAME/-*}
+POD_NAME=${NODE_NAME/*-}
+
+# create TMPDIR if it doesn't exist
+mkdir -p $TMPDIR
+
+# change permissions down to TMPDIR
+chmod a+x $HOME
+chmod a+x $TMPDIR
+
+# clone the securedlab repo
+cd $WORKSPACE
+echo "Cloning securedlab repo"
+git clone ssh://jenkins-ericsson@gerrit.opnfv.org:29418/securedlab
+
+# construct the command
+DEPLOY_COMMAND="sudo $WORKSPACE/ci/deploy.sh -b file://$WORKSPACE/securedlab -l $LAB_NAME -p $POD_NAME -s $DEPLOY_SCENARIO -i $WORKSPACE/opnfv.iso -H -B $BRIDGE  -S $TMPDIR"
+
+# log info to console
+echo "Deployment parameters"
+echo "Scenario: $DEPLOY_SCENARIO"
+echo "--------------------------------------------------------"
+echo "Lab: $LAB_NAME"
+echo "POD: $POD_NAME"
+echo "ISO: $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f3)"
+echo
+echo "Starting the deployment using $INSTALLER_TYPE. This could take some time..."
+echo "--------------------------------------------------------"
+echo
+
+# start the deployment
+echo "Issuing command"
+echo "$DEPLOY_COMMAND"
+echo
+
+$DEPLOY_COMMAND
+
+echo
+echo "--------------------------------------------------------"
+echo "Done!"