Scenario:
I have a for-in loop written in groovy in Jenkinsfile. For every iteration of this loop i want to assign a value from within a shell script which runs(aws cli commond) on every iteration to a Groovy list/map variable outside the loop.
Example code snippet:
def functionName() {
Groovy variable(list/map type);
for in loop {
sh """
Groovy variable = value
"""
}
}
Can anyone provide an example or explain how can this be done? Any help is appreciated