Reuben Popp
unread,Mar 20, 2023, 2:47:22 PM3/20/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to BioUno Developers
Good morning/afternoon, I hope that this list is just low traffic and not dead.
I'm trying to set up a dynamic reference parameter in a Jenkinsfile and am struggling a bit with how to reference the value of a previous option. Note the code below; where Target is used, I have attempted appending it to the cmd using + as well as the provided way below. Both ways return my select as empty. What is the proper way to reference another, earlier used option from the Jenkinsfile? I see that it is getting set by watching the javascript console:
Values retrieved from Referenced Parameters: DeployLegacyBackend=No__LESEP__Target=FOO
Also, note my println entries. Given that I have added a logger in Jenkins for biouno, should I not see entries for these? What is the best way to debug scripts here?
Thanks in advance!
Reuben
For example,
[$class: 'DynamicReferenceParameter',
choiceType: 'ET_FORMATTED_HTML',
omitValueField: true,
description: 'Choose a legacy backend install file.',
name: 'LegacyBackendInstallFile',
randomName: 'choice-parameter-5631314456178624',
referencedParameters: 'DeployLegacyBackend,Target',
script: [
$class: 'GroovyScript',
fallbackScript: [
classpath: [],
sandbox: true,
script: 'return[\'Listing not available.....\']'
],
script: [
classpath: [],
sandbox: true,
script: '''
def rawFileList = []
def htmlOut = '<select id="install_file">'
def cmd = "gsutil ls gs://some-cloud-storage-bucket/Target | grep install.tar.gz"
def proc = ['sh', '-c', cmd].execute()
proc.waitFor()
def rawOutString = proc.text
println("rawOutString is [" + rawOutString + "].")
def rawOut = rawOutString.split('\\n')
rawOut.each { item ->
def tmpFile = item
println("tmpFile is [" + tmpFile + "].")
}
htmlOut += '</select>'
return htmlOut
'''
]
]
],