Add Jenkinsfile
All checks were successful
jenkins_organization/some-project/pipeline/head This commit looks good
All checks were successful
jenkins_organization/some-project/pipeline/head This commit looks good
This commit is contained in:
commit
9f89ba7641
23
Jenkinsfile
vendored
Normal file
23
Jenkinsfile
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh 'echo "sample artifact" > 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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user