Add Jenkinsfile
All checks were successful
jenkins_organization/some-project/pipeline/head This commit looks good

This commit is contained in:
first_admin 2024-08-24 07:17:23 +00:00
commit 9f89ba7641

23
Jenkinsfile vendored Normal file
View 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'
}
}
}
}