Я пытаюсь выполнить запрос curl в groovy, но он выдает синтаксическую ошибку:
def pyString = "import json,sys;text=str(sys.stdin.read().strip());obj=json.loads(text);print ([dict['id'] for dict in obj if dict['name_with_namespace']=='prjs/myProj'])"
def pyCmdArray = ["python", "-c", ${pyString}]
def pyCmdOutput = pyCmdArray.execute()
println "Here you are: "
println pyCmdOutput.text()
def responseUrl = "https://abc.dev.sys/api/v3/projects?per_page=100"+pyCmdOutput.text()
def response = (curl -H "PRIVATE-TOKEN:yyyyyyyyyyyyyyyy" -H "Content-Type:application/json" ${responseUrl})
Ошибка:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 29: expecting ')', found 'PRIVATE-TOKEN:yyyyyyyyyyyyyyyy' @ line 29, column 27.
def response = (curl -H "PRIVATE-TOKEN:yyyyyyyyyyyyyyyy" -H "Content-Type:application/json" ${responseUrl})
Любая помощь приветствуется.