Skip to content

Commit

Permalink
Updating the Jenkins file
Browse files Browse the repository at this point in the history
  • Loading branch information
ashahi1 committed Feb 12, 2018
1 parent a3296e1 commit fe03be2
Showing 1 changed file with 202 additions and 91 deletions.
293 changes: 202 additions & 91 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,105 +1,216 @@
node("vdvs-slave-two") {
pipeline {
agent none

def app

def ERROR = 'false'

dir('vsphere-storage-for-docker') {
sh "echo Deleting \\${JOB_NAME} "
deleteDir()
}

stages {
stage('Checkout code') {
/* Let's make sure we have the repository cloned to our workspace. */
checkout scm
sh "cat Jenkinsfile"
failFast true
parallel {
stage('Checkout on vdvs-slave-2') {
/* Let's make sure we have the repository cloned to our workspace. */
agent {
label "vdvs-slave-two"
}
steps {
checkout scm
}
}
stage('Checkout on vdvs-slave-3') {
/* Let's make sure we have the repository cloned to our workspace..*/
agent {
label "vdvs-slave-three"
}
steps {
checkout scm
}
}
}
}

stage('Build binaries') {
/* This builds binaries */

sh "echo Building the VDVS binaries"
sh "export PKG_VERSION=$BUILD_NUMBER"
sh "echo ESX=$ESX; echo VM1=$VM1; echo VM2=$VM2; echo VM3=$VM3; echo PKG_VERSION"
sh "make build-all"
/* This builds VDVS binaries */
failFast true
parallel {
stage('Build binaries on vdvs-slave-2') {
agent {
label "vdvs-slave-two"
}
steps {
sh "echo Building the VDVS binaries"
sh "export PKG_VERSION=$BUILD_NUMBER"
sh "make build-all"
}
}

stage('Build binaries on vdvs-slave-3') {
agent {
label "vdvs-slave-three"
}
steps {
sh "echo Building the VDVS binaries"
sh "export PKG_VERSION=$BUILD_NUMBER"
sh "make build-all"
}
}
}
}

stage('Deploy - 6.5 setup') {
/* This deploys the actual code */

sh "echo deploying binaries"
sh "echo ESX = $ESX; echo VM1=$VM1; echo VM2=$VM2; echo VM3=$VM3;"
sh "make deploy-all"
sh "echo finished deploying the binaries"

stage('Deployment') {
failFast true
parallel {
stage('Deploy VDVS On 6.5 setup') {
agent {
label "vdvs-slave-two"
}
steps {
sh "echo Deployment On 6.5 setup"
sh "echo ESX=$ESX; echo VM1=$VM1; echo VM2=$VM2; echo VM3=$VM3; echo PKG_VERSION"
sh "echo deploying binaries"
sh "make deploy-all"
sh "echo finished deploying the binaries"
}
}

stage('Deploy On 6.0 setup') {
agent {
label "vdvs-slave-three"
}
steps {
sh "echo Deployment On 6.0 setup"
sh "echo ESX=$ESX; echo VM1=$VM1; echo VM2=$VM2; echo VM3=$VM3; echo PKG_VERSION"
sh "echo deploying binaries"
sh "make deploy-all"
sh "echo finished deploying the binaries"
}
}
}
}

stage('Executing End-to-End Tests') {
/* This runs the e2e test */

sh "echo starting e2e tests"
sh "make test-e2e"
sh "make test-esx"
sh "make test-vm"
}


stage('vFile Tests') {
/* This runs the tests for vFile Plugin */

sh "echo Build, deploy and test vFile plugin"
sh "make build-vfile-all ; make deploy-vfile-plugin; make test-e2e-vfile || \\${ERROR}=true"
stage('Test VDVS') {
failFast true
parallel {
stage('Test On 6.5 setup') {
agent {
label "vdvs-slave-two"
}

steps {
sh "echo Test VDVS On 6.5 setup"
sh "echo ESX=$ESX; echo VM1=$VM1; echo VM2=$VM2; echo VM3=$VM3; echo PKG_VERSION"
sh "echo starting e2e tests"
sh "make test-e2e"
sh "make test-esx"
sh "make test-vm"
}
}
stage('Test On 6.0 setup') {
agent {
label "vdvs-slave-three"
}
steps {
sh "echo Test VDVS On 6.0 setup"
sh "echo ESX=$ESX; echo VM1=$VM1; echo VM2=$VM2; echo VM3=$VM3; echo PKG_VERSION"
sh "echo starting e2e tests"
sh "make test-e2e"
sh "make test-esx"
sh "make test-vm"
}
}
}
}

stage('Build Windows plugin') {
/* This builds the actual windows image; */

sh "echo building binaries for windows"
sh "make build-windows-plugin"
sh "echo Finished building binaries for windows"
}

stage('Deploy Windows plugin') {
/* This deploys the windows plugin image; */

sh "echo deploying binaries for windows"
sh "ls"
sh "echo Windows-VM = $WIN_VM1"
sh "make deploy-deploying-plugin"
sh "echo Finished building binaries for windows"

}

stage('Executing Windows Plugin Tests') {
/* This runs the tests for Windows Plugin */

sh "echo Starting test for Windows"
sh "make test-e2e-windows"

stage('Test vFile') {
failFast true
parallel {
stage('Test vFile On 6.5 setup') {
agent {
label "vdvs-slave-two"
}
steps {
script{
def stopContainers = "docker stop \$(docker ps -a -q) 2> /dev/null || true"
def removeContainers = "docker rm \$(docker ps -a -q) 2> /dev/null || true"
def removeVolumes = "docker volume rm \$(docker volume ls -q -f dangling=true) 2> /dev/null || true"
try{
sh "echo Build, deploy, and test vFile on 6.5 setup"
sh "echo Build vFile binaries"
sh "echo ESX = $ESX; echo VM1=$VM1; echo VM2=$VM2; echo VM3=$VM3;"
sh "make build-vfile-all"
sh "echo Deploy the vFile binaries"
sh "make deploy-vfile-plugin"
sh "echo Start the vFile tests"
sh "make test-e2e-vfile"
sh "echo vFile tests finished"
} finally{
sh "ssh ${env.GOVC_USERNAME}@$VM1 ${stopContainer}; ${removeContainer}; ${removeVolume}"
sh "ssh ${env.GOVC_USERNAME}@$VM2 ${stopContainer}; ${removeContainer}; ${removeVolume}"
sh "ssh ${env.GOVC_USERNAME}@$VM3 ${stopContainer}; ${removeContainer}; ${removeVolume}"
sh "make clean-vfile"
sh "make clean-all"
}
}
}
}

stage('Test vFile On 6.0 setup') {
agent {
label "vdvs-slave-three"
}

steps {
script{
def stopContainers = "docker stop \$(docker ps -a -q) 2> /dev/null || true"
def removeContainers = "docker rm \$(docker ps -a -q) 2> /dev/null || true"
def removeVolumes = "docker volume rm \$(docker volume ls -q -f dangling=true) 2> /dev/null || true"
try{
echo "Build, deploy, and test vFile on 6.0 setup"
sh "echo Build vFile binaries"
sh "echo ESX=$ESX; echo VM1=$VM1; echo VM2=$VM2; echo VM3=$VM3;"
sh "make build-vfile-all"
sh "echo Deploy the vFile binaries"
sh "make deploy-vfile-plugin"
sh "echo Run the vFile tests"
sh "make test-e2e-vfile"
sh "echo vFile tests finished"
}finally{
sh "ssh ${env.GOVC_USERNAME}@$VM1 ${stopContainer}; ${removeContainer}; ${removeVolume}"
sh "ssh ${env.GOVC_USERNAME}@$VM2 ${stopContainer}; ${removeContainer}; ${removeVolume}"
sh "ssh ${env.GOVC_USERNAME}@$VM3 ${stopContainer}; ${removeContainer}; ${removeVolume}"
sh "make clean-vfile"
sh "make clean-all"
}
}

}
}
}
}

stage('Deploy - 6.0 setup') {
/* This deploys the actual code */

sh "export ESX=$ESX60; export VM1=$VM160; export VM2=$VM260; export VM3=$VM360"
sh "export MANAGER1=$MANAGER160; export WORKER1=$WORKER160; export WORKER2=$WORKER260"
sh "echo deploying binaries to 6.0 setup"
sh "echo ESX = $ESX; echo VM1=$VM1; echo VM2=$VM2; echo VM3=$VM3"
sh "make deploy-all"
sh "echo finished deploying the binaries"
stage('Windows plugin') {
/* This builds, deploys and tests the windows binaries */
agent {
label "vdvs-slave-two"
}

steps {
sh "echo Build, deploy, and test Windows plugin"
sh "echo Windows-VM=$WIN_VM1"
sh "echo Build Windows plugin binaries"
sh "make build-windows-plugin"
sh "echo Finished building binaries for windows"
sh "echo Deploy the Windows plugin binaries"
sh "make deploy-windows-plugin"
sh "echo Finished deploying binaries for windows"
sh "echo Run the Windows plugin tests"
sh "make test-e2e-windows"
sh "echo Windows plugin tests finished"
}
}
}

stage('Executing VDVS tests on 6.0 ESX') {
/* This runs the e2e test */

sh "echo starting e2e tests"
sh "make test-e2e"
sh "make test-esx"
sh "make test-vm"
}

stage('Executing vFile tests on 6.0 ESX') {
/* This runs the tests for vFile Plugin.. */
sh "echo Build, deploy and test vFile plugin"
sh "make build-vfile-all ; make deploy-vfile-plugin; make test-e2e-vfile || \\${ERROR}=true"
}
}
// The options directive is for configuration that applies to the whole job.
options {
// This ensures we only have 10 builds at a time, so
// we don't fill up our storage!
buildDiscarder(logRotator(numToKeepStr:'10'))
}
}

0 comments on commit fe03be2

Please sign in to comment.