I\'ve been having a lot of trouble trying to get a Jenkinsfile to work. I\'ve been trying to run this test script:
#!/usr/bin/env groovy
node {
stage(\'
I tried all the above... but didn't work until I included in my steps container()
for some reasons when Jenkins is trying to run the .sh
file it's trying on Jenkins master, even if my agent
is set up:
agent {
label "gen-java-slave"
}
Glob ENV:
environment {
PATH = "/usr/local/openjdk-11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
}
Example of a working stage:
stage('Create a Dump for Senapt Arango DB') {
steps {
container('general-container-name') {
withEnv(['PATH+EXTRA=/usr/bin/arangodump']) {
sh '''
./backup-arango-senapt.sh
'''
}
}
}