Last active
June 25, 2019 14:34
-
-
Save ranrubin/2e911220de279d881adbadb14a1e2759 to your computer and use it in GitHub Desktop.
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
@Library('Jenkins-Shared-Library-Objects@stateful-shared-library') | |
def consul = new org.foo.Consul() | |
node('NODE') { | |
try { | |
String jsonRegisterData = "{ .. }" // A string of whatever data we want in json format | |
consul.construct("http://myconsul.com", "8500") | |
stage("register data") { | |
consul.register(jsonRegisterData) | |
} | |
stage("store some data") { | |
consul.store("v1/kv/test/1/data", "value1") | |
consul.store("v1/kv/test/2/data", "value2") | |
} | |
stage("list Nodes"){ | |
consul.list_nodes() | |
} | |
} | |
catch(err){ | |
//.. handle | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment