From 9a6f84a905b89b5a6e8b9869eef745f24975bf05 Mon Sep 17 00:00:00 2001 From: Augusto Date: Sat, 28 Oct 2023 19:47:07 +0200 Subject: [PATCH] Deploying eShopContainers --- Jenkinsfile | 41 +++++++++++++------ .../scripts/coilifecycles/coi-setup.sh | 2 +- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 02bdc9fb..53d4123c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,34 +1,49 @@ -node ('xretorch-agent') { - stage ('Clone eShopContainers Project') { +pipeline { + agent {label 'xretorch-agent'} + environment { + ET_EUS_API = "http://selenoid:4444/wd/hub" + CURRENT_DATE = " date +\'[%m-%d-%y] %T - \'" + //Used to avoid the UnixHTTPConnectionPool(host='localhost', port=None): Read timed out and + DOCKER_CLIENT_TIMEOUT = 120 + COMPOSE_HTTP_TIMEOUT = 120 + }//EndEnvironment + options { + disableConcurrentBuilds() + }//EndPipOptions +stages{ + stage ('Clone eShopContainers Project') { +steps{ checkout([$class: 'GitSCM', branches: [[name: '*/retorch']], userRemoteConfigs: [[url: 'https://github.com/augustocristian/retorch-st-eShopOnContainers.git']]]) checkout scm - +}//EndSteps }//End git stage stage('SETUP-Infrastructure') { - sh 'ls -a .' - sh 'cd ./eshopcontainers-e2etestsuite' - sh 'ls -a .' + steps{ //Change the permisions to the scripts folder the - sh 'chmod +x -R ./retorchfiles/scripts' - sh './retorchfiles/scripts/coilifecycles/coi-setup.sh' + sh 'chmod +x -R ./eshopcontainers-e2etestsuite/retorchfiles/scripts' + sh './eshopcontainers-e2etestsuite/retorchfiles/scripts/coilifecycles/coi-setup.sh' + }//End Steps }//EndStageSETUPInf stage('test') { - + steps{ sh "sleep 10" sh "mvn test" + }//End Steps }// End test stage + + }//EndStagesPipeline post { always { - archiveArtifacts artifacts: 'artifacts/*.csv', onlyIfSuccessful: true }//EndAlways + archiveArtifacts artifacts: 'eshopcontainers-e2etestsuite/artifacts/*.csv', onlyIfSuccessful: true }//EndAlways cleanup { - cleanWs() + //cleanWs() sh """(eval \$CURRENT_DATE ; echo "Cleaning Environment ") | cat |tr '\n' ' ' """ - sh './retorchfiles/scripts/coilifecycles/coi-teardown.sh' }//EndCleanUp + sh './eshopcontainers-e2etestsuite/retorchfiles/scripts/coilifecycles/coi-teardown.sh' }//EndCleanUp }//EndPostActions -} \ No newline at end of file +}//EndPipeline \ No newline at end of file diff --git a/eshopcontainers-e2etestsuite/retorchfiles/scripts/coilifecycles/coi-setup.sh b/eshopcontainers-e2etestsuite/retorchfiles/scripts/coilifecycles/coi-setup.sh index 34aa21fe..c6422807 100644 --- a/eshopcontainers-e2etestsuite/retorchfiles/scripts/coilifecycles/coi-setup.sh +++ b/eshopcontainers-e2etestsuite/retorchfiles/scripts/coilifecycles/coi-setup.sh @@ -1,7 +1,7 @@ #!/bin/bash OUTPUTDIRCOI="./src/retorchcostestimationdata/exec$BUILD_NUMBER/COI.data" COISETUPSTART=$(date +%s%3N) - +ls -la . #Directories to store the data mkdir -p "./src/retorchcostestimationdata/exec$BUILD_NUMBER" mkdir -p "./artifacts"