I recently inherited a code base with some Jenkins files. In one of them I ran into this syntax
stage('Prepare database for integration tests') {
steps {
container('postgres') {
sh "..."
}
}
}
Our Jenkins is running on Openshift and the pod has multiple containers including this postgres one. However I can't find any references for using the container or connecting to a container with container('containerName') like that.
I tried to create a separate pipeline with the following piece
container('az-cli') {
try {
sh 'ls'
} catch (error) {
throw error
}
}
And ls listed the content in the code repository - not the container. Clearly container is not doing what I thought it does and I can't find any documentation on it. Does anyone know what this is supposed to do?
Thanks in advance.