jenkins
b73f72347d
All checks were successful
jenkins_organization/some-project/pipeline/head This commit looks good
24 lines
641 B
Groovy
24 lines
641 B
Groovy
pipeline {
|
|
agent any
|
|
stages {
|
|
stage('Build') {
|
|
steps {
|
|
sh 'echo "sample artifact change" > artifact.txt'
|
|
}
|
|
}
|
|
stage('Save user') {
|
|
steps {
|
|
script {
|
|
def username = currentBuild.getBuildCauses().find { it._class == 'hudson.model.Cause$UserIdCause' }?.userId
|
|
writeFile file: 'user.txt', text: username
|
|
}
|
|
}
|
|
}
|
|
stage('Archive artifacts') {
|
|
steps {
|
|
archiveArtifacts artifacts: '**/artifact.txt, user.txt'
|
|
}
|
|
}
|
|
}
|
|
}
|