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
package org.foo | |
/** A map that holds all constants and data members that can be override when constructing */ | |
consulEnv | |
/** | |
* Imitates a constructor | |
* Defines an instance of Consul object. All according to api | |
* @param ip - ip for consul |
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") |
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
package org.foo | |
/** A map that holds all constants and data members that can be override when constructing */ | |
consulEnv | |
/** An HttpRest object that handles http requests */ | |
httpHandler | |
def construct(httpObj){ |
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
package org.boo | |
httpEnv | |
def construct(String base_url){ | |
httpEnv = [ | |
base_url: base_url, | |
curl_options: '-sS', | |
debug: false, |
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
def call(httpObj){ | |
def consul = new org.foo.Consul() | |
consul.construct(httpObj) | |
return consul | |
} |
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
def call(String base_url){ | |
def http = new org.boo.HttpRest() | |
http.construct(base_url) | |
return http | |
} |
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-advanced') | |
def httpHandler = getHttpRestHandler("http://myconsul.com:8500") // constructing a HttpRest | |
def consul = getConsulHandler(httpHandler) | |
node('NODE') { | |
try { | |
String jsonRegisterData = "{ .. }" // A string of whatever data we want in json format | |
stage("register data") { |
OlderNewer