Last active
June 1, 2017 23:43
-
-
Save adampats/c059babc01c2e1b65f68b0d4d8da3059 to your computer and use it in GitHub Desktop.
Jenkinsfile Shared Library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Library('jenkinsfile-library') | |
import com.foo.Methods | |
node { | |
def m = new com.foo.Methods() | |
def ip = m.getPublicIP() | |
echo ip | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
package com.foo | |
class Methods implements Serializable { | |
static def getPublicIP() { | |
sh returnStdout: true, script: 'curl icanhazip.com' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error message from line 6 of Jenkinsfile: