Skip to content

Instantly share code, notes, and snippets.

@daipresents
Last active August 27, 2023 18:19
Show Gist options
  • Save daipresents/c6ba0749c8c402125c1496de5dc937c5 to your computer and use it in GitHub Desktop.
Save daipresents/c6ba0749c8c402125c1496de5dc937c5 to your computer and use it in GitHub Desktop.
Split Jenkinsfile
def notify(message) {
def channel = "#notify-channel"
def domain = "daipresents"
def token = "TOKEN_IS_HERE"
def slack_msg = "${message}"
slackSend channel: "${channel}", color: "good", message: "${slack_msg}", teamDomain: "${domain}", token: "${token}"
}
return this
Running on master in /var/lib/jenkins/workspace/MY_JOB_NAME
[Pipeline] {
[Pipeline] pwd
[Pipeline] load
[Pipeline] // load
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.nio.file.NoSuchFileException: /var/lib/jenkins/workspace/MY_JOB_NAME/common.groovy
node {
checkout scm
common = load "${pwd()}/common.groovy"
common.notify("This is message")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment