//------------------------------------------------------------------- // Set up //------------------------------------------------------------------- import groovy.json.JsonSlurper slurper = new JsonSlurper() serverUrl = 'https://localhost:9443' client = '/Users/clarkeb/urbancode/agent/opt/udclient/udclient.jar' token = '42cf3d77-607d-4b4e-aafe-c4d36b89a318' String compName = args[0] //------------------------------------------------------------------- // Main //------------------------------------------------------------------- String compId = getCompId(compName) println compId //------------------------------------------------------------------- // Subs //------------------------------------------------------------------- String getCompId (String componentName) { def command = ['java', '-jar', client, '--authtoken', token, '--weburl', serverUrl, 'getComponent', '--component', componentName]
def result = command.execute() def json = result.text def compId = slurper.parseText(json).id return(compId) }
No comments:
Post a Comment