Add scalability script to Jenkinsfile

This commit is contained in:
bernat 2020-03-19 00:45:00 +01:00
parent 2ae7902714
commit 3bef703f24
1 changed files with 79 additions and 11 deletions

90
Jenkinsfile vendored
View File

@ -1,3 +1,5 @@
#!/usr/bin/env groovy
pipeline
{
agent none
@ -9,13 +11,27 @@ pipeline
stages
{
stage('windows and ubuntu in parallel')
stage('Creating nodes')
{
agent { label "master" }
steps
{
script
{
JOB_ID = "${env.BUILD_TAG}"
jenkinsLib = load("/home/jenkins/jenkins.groovy")
jenkinsLib.CreateBuildNode(JOB_ID)
}
}
}
stage('Building CARLA')
{
parallel
{
stage('ubuntu')
{
agent { label 'ubuntu && build' }
agent { label "ubuntu && build && ${JOB_ID}" }
environment
{
UE4_ROOT = '/home/jenkins/UnrealEngine_4.22'
@ -77,17 +93,32 @@ pipeline
sh 'make package ARGS="--packages=AdditionalMaps --clean-intermediate"'
sh 'make examples ARGS="localhost 3654"'
}
post {
always {
post
{
always
{
archiveArtifacts 'Dist/*.tar.gz'
stash includes: 'Dist/CARLA*.tar.gz', name: 'ubuntu_package'
stash includes: 'Examples/', name: 'ubuntu_examples'
}
success
{
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
jenkinsLib = load("/home/jenkins/jenkins.groovy")
jenkinsLib.CreateTestNode(JOB_ID)
}
}
}
}
}
stage('ubuntu smoke tests')
{
agent { label 'ubuntu && gpu' }
agent { label "ubuntu && gpu && ${JOB_ID}" }
steps
{
unstash name: 'ubuntu_eggs'
@ -105,6 +136,16 @@ pipeline
archiveArtifacts 'CarlaUE4.log'
junit 'Build/test-results/smoke-tests-*.xml'
deleteDir()
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
jenkinsLib = load("/home/jenkins/jenkins.groovy")
jenkinsLib.DeleteTestNode(JOB_ID)
}
}
}
}
}
@ -137,8 +178,15 @@ pipeline
git push
'''
}
post
{
always
{
deleteDir()
}
}
}
stage('Cleanning')
stage('Cleaning')
{
steps
{
@ -149,7 +197,7 @@ pipeline
}
// stage('windows')
// {
// agent { label 'windows && build' }
// agent { label "windows && build && ${JOB_ID}" }
// environment
// {
// UE4_ROOT = 'C:\\Program Files\\Epic Games\\UE_4.22'
@ -175,8 +223,8 @@ pipeline
// make LibCarla
// make PythonAPI
// make CarlaUE4Editor
// // make examples
// // """
// """
// // make examples
// }
// post
// {
@ -208,9 +256,9 @@ pipeline
// bat """
// call ../setEnv64.bat
// make package
// make package ARGS="--packages=AdditionalMaps --clean-intermediate"
// make package ARGS="--packages=AdditionalMaps --clean"
// """
// // make examples ARGS="localhost 3654"
// // make examples ARGS="localhost 3654"
// }
// post {
// always {
@ -235,8 +283,28 @@ pipeline
// }
// }
// }
// post
// {
// always { deleteDir() }
// }
// }
}
}
}
post
{
always
{
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
jenkinsLib = load("/home/jenkins/jenkins.groovy")
jenkinsLib.DeleteBuildNode(JOB_ID)
}
}
}
}
}