generated from giis-uniovi/samples-giis-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
714a6d5
commit 03d084f
Showing
5 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
node ('xretorch-agent') { | ||
stage ('Clone eShopContainers Project') { | ||
|
||
checkout([$class: 'GitSCM', branches: [[name: '*/retorch']], | ||
userRemoteConfigs: [[url: 'https://github.com/augustocristian/retorch-st-eShopOnContainers.git']]]) | ||
checkout scm | ||
}//End git stage | ||
|
||
stage('SETUP-Infrastructure') { | ||
|
||
sh 'ls -a .' | ||
//Change the permisions to the scripts folder the | ||
sh 'chmod +x -R ./retorchfiles/scripts' | ||
sh './retorchfiles/scripts/coilifecycles/coi-setup.sh' | ||
}//EndStageSETUPInf | ||
|
||
|
||
|
||
stage('test') { | ||
checkout scm | ||
|
||
sh "sleep 10" | ||
sh "mvn test" | ||
} | ||
}// End test stage | ||
post { | ||
always { | ||
archiveArtifacts artifacts: 'artifacts/*.csv', onlyIfSuccessful: true }//EndAlways | ||
cleanup { | ||
cleanWs() | ||
sh """(eval \$CURRENT_DATE ; echo "Cleaning Environment ") | cat |tr '\n' ' ' """ | ||
sh './retorchfiles/scripts/coilifecycles/coi-teardown.sh' }//EndCleanUp | ||
}//EndPostActions | ||
} |
19 changes: 19 additions & 0 deletions
19
eshopcontainers-e2etestsuite/retorchfiles/scripts/coilifecycles/coi-setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
OUTPUTDIRCOI="./src/retorchcostestimationdata/exec$BUILD_NUMBER/COI.data" | ||
COISETUPSTART=$(date +%s%3N) | ||
|
||
#Directories to store the data | ||
mkdir -p "./src/retorchcostestimationdata/exec$BUILD_NUMBER" | ||
mkdir -p "./artifacts" | ||
#Here goes the COI set-up | ||
|
||
|
||
#Here ends the COI set-up | ||
|
||
|
||
COISETUPEND=$(date +%s%3N) | ||
|
||
|
||
echo "COI-SETUP-START;COI-SETUP-END;COI-TEARDOWN-START;COI-TEARDOWN-END" >"$OUTPUTDIRCOI" | ||
echo -n "$COISETUPSTART;$COISETUPEND">>"$OUTPUTDIRCOI" | ||
|
13 changes: 13 additions & 0 deletions
13
eshopcontainers-e2etestsuite/retorchfiles/scripts/coilifecycles/coi-teardown.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
COITEARDOWNSTART="$(date +%s%3N)" | ||
|
||
echo 'Switch off all containers...' | ||
docker stop "$(docker ps | grep eShopContainers | awk '{print \$1}')" || echo 'All the containers are stopped!' | ||
docker rm --volumes "$(docker ps -a | grep eShopContainers | awk '{print \$1}')" || echo 'All the containers are removed!' | ||
sh 'retorchfiles/scripts/saveTJobLifecycledata.sh' | ||
COITEARDOWNEND="$(date +%s%3N)" | ||
|
||
OUTPUTDIRCOI="./src/retorchcostestimationdata/exec$BUILD_NUMBER/COI.data" | ||
echo -n ";$COITEARDOWNSTART;$COITEARDOWNEND" >>"$OUTPUTDIRCOI" | ||
|
14 changes: 14 additions & 0 deletions
14
eshopcontainers-e2etestsuite/retorchfiles/scripts/saveTJobLifecycledata.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
PATH_FILES="./src/retorchcostestimationdata/exec${BUILD_NUMBER}/tjob*" | ||
OUTPUT_FILE="./artifacts/lifecycletimmingsexec${BRANCH_NAME///}-${BUILD_NUMBER}.csv" | ||
OUTPUTDIRCOI="./src/retorchcostestimationdata/exec$BUILD_NUMBER/COI.data" | ||
echo "tjobname;stage;COI-setup-start;COI-setup-end;tjob-setup-start;tjob-setup-end;tjob-testexec-start;tjob-testexec-end;tjob-teardown-start;tjob-teardown-end;coi-teardown-start;coi-teardown-end" >"$OUTPUT_FILE" | ||
for csvfile in $PATH_FILES; do | ||
{ | ||
tail -n +2 "$csvfile" | ||
echo -n ";" | ||
tail -n +2 "$OUTPUTDIRCOI" | rev | cut -d ';' -f 2 | rev | tr -d '\n' | ||
echo -n ";" | ||
tail -n +2 "$OUTPUTDIRCOI" | rev | cut -d ';' -f 1 | rev | ||
} >>"$OUTPUT_FILE" | ||
done |
16 changes: 16 additions & 0 deletions
16
eshopcontainers-e2etestsuite/retorchfiles/scripts/writetime.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
OUTPUTDIR="./src/retorchcostestimationdata/exec$BUILD_NUMBER/$2.data" | ||
OUTPUTDIRCOI="./src/retorchcostestimationdata/exec$BUILD_NUMBER/COI.data" | ||
if [ -f "$OUTPUTDIR" ]; then | ||
echo -n ";$(date +%s%3N)" >>"$OUTPUTDIR" | ||
|
||
else | ||
|
||
echo "tjobname;stage;COI-setup-start;COI-setup-end;setup-start;setup-end;testexec-start;testexec-end;teardown-start;teardown-end" >"$OUTPUTDIR" | ||
{ | ||
echo -n "$2;$1;" | ||
tail -n +2 "$OUTPUTDIRCOI" | ||
echo -n ";$(date +%s%3N)" | ||
} >>"$OUTPUTDIR" | ||
|
||
fi |