I have a script in Jenkins:
stage('test') {
steps {
script {
def listCatalog = sh script: "ls src/examplecatalog", returnStdout: true
def arrayExample=[]
arrayExample+=("$listCatalog")
echo "${arrayExample}"
}
}
}
arrayExample returned [catalog_1 catalog_2 catalog_3] but it's not array I think it's string. I need array like this:
['catalog_1', 'catalog_2', 'catalog_3'].
How I can push/append string to empty array in Jenkins?
