From version 0.33.1
onwards, aws-sam-cli supports colored output. I'm trying to run the sam deploy
command from Jenkins pipeline and the output is not displaying in colored format. I've installed ANSIColor Jenkins plugin and wrapped the sam deploy command with ansiColor('xterm') {}
. The command works as expected and the Cloudformation stack is getting created. The concern is the output is not in colored format.
node {
stage('Example') {
ansiColor('xterm') {
sh "sam deploy --parameter-overrides ${someparameter} --template-file ${templatefile} --stack-name ${stackname} --capabilities CAPABILITY_NAMED_IAM --no-fail-on-empty-changeset --no-execute-changeset"
}
}
}
In order to verify my Jenkins, I tried test-snippet in Jenkins and it displayed the colored output.
ansiColor('xterm') {
stage "\u001B[31mI'm Red\u001B[0m Now not"
}
So Jenkins is able to display ANSI color, but the aws-sam-cli
output is not in colored format.
Any ideas or pointers would be helpful.