Created
December 9, 2016 00:18
-
-
Save rtyler/e32169ece1d2f51c4b9fe5c7d2883474 to your computer and use it in GitHub Desktop.
Demonstrating setters/getters in a Pipeline Shared Library
This file contains 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
Started by user rtyler | |
Loading library pipeline-library@acme-test | |
> git rev-parse --is-inside-work-tree # timeout=10 | |
Fetching changes from the remote Git repository | |
> git config remote.origin.url git://github.com/jenkins-infra/pipeline-library.git # timeout=10 | |
Fetching upstream changes from git://github.com/jenkins-infra/pipeline-library.git | |
> git --version # timeout=10 | |
> git fetch --tags --progress git://github.com/jenkins-infra/pipeline-library.git +refs/heads/*:refs/remotes/origin/* | |
> git rev-parse refs/remotes/origin/acme-test^{commit} # timeout=10 | |
> git rev-parse refs/remotes/origin/origin/acme-test^{commit} # timeout=10 | |
Checking out Revision 916d2598c0a636826c7c971547e1631fe57170f0 (refs/remotes/origin/acme-test) | |
> git config core.sparsecheckout # timeout=10 | |
> git checkout -f 916d2598c0a636826c7c971547e1631fe57170f0 | |
> git rev-list 916d2598c0a636826c7c971547e1631fe57170f0 # timeout=10 | |
[Pipeline] node | |
Running on master in /var/jenkins_home/workspace/hi@2 | |
[Pipeline] { | |
[Pipeline] echo | |
Hello Mr Jenkins | |
[Pipeline] echo | |
Hello world, Hi, the secret is: | |
[Pipeline] echo | |
pancakes | |
[Pipeline] } | |
[Pipeline] // node | |
[Pipeline] End of Pipeline | |
Finished: SUCCESS |
This file contains 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/groovy | |
def setFoo(v) { | |
this.foo = v; | |
} | |
def getFoo() { | |
return this.foo; | |
} | |
def say(name) { | |
echo "Hello world, ${name}" | |
} |
This file contains 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
node { | |
echo "Hello Mr Jenkins" | |
acme.foo = "pancakes" | |
acme.say "Hi, the secret is:" | |
echo acme.foo | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment