JK
This commit is contained in:
parent
a96e4c8644
commit
b89f8d9ea8
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@ -3,6 +3,7 @@ pipeline {
|
|||||||
docker {
|
docker {
|
||||||
image 'mcr.microsoft.com/dotnet/sdk:9.0'
|
image 'mcr.microsoft.com/dotnet/sdk:9.0'
|
||||||
args '-u root:root'
|
args '-u root:root'
|
||||||
|
label "${params.AGENT_LABEL?.trim() ?: ''}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,6 +18,7 @@ pipeline {
|
|||||||
parameters {
|
parameters {
|
||||||
string(name: 'GIT_URL', defaultValue: 'file:///SourceCode/repos/AS400API.git', description: 'Git repository URL to clone')
|
string(name: 'GIT_URL', defaultValue: 'file:///SourceCode/repos/AS400API.git', description: 'Git repository URL to clone')
|
||||||
string(name: 'GIT_BRANCH', defaultValue: 'main', description: 'Branch or ref to build')
|
string(name: 'GIT_BRANCH', defaultValue: 'main', description: 'Branch or ref to build')
|
||||||
|
string(name: 'AGENT_LABEL', defaultValue: 'docker', description: 'Label of the Jenkins agent that has Docker CLI access')
|
||||||
}
|
}
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
@ -183,7 +185,13 @@ pipeline {
|
|||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
deleteDir()
|
script {
|
||||||
|
try {
|
||||||
|
deleteDir()
|
||||||
|
} catch (org.jenkinsci.plugins.workflow.steps.MissingContextVariableException ignore) {
|
||||||
|
echo 'Workspace cleanup skipped because no workspace was provisioned.'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user