awslabs / aws-codebuild-jenkins-plugin

AWS CodeBuild integration as a Jenkins build step.
https://aws.amazon.com/codebuild
Apache License 2.0
150 stars 121 forks source link

Unable to pass environment variables to CodeBuild #102

Closed shrivastavshubham34 closed 4 years ago

shrivastavshubham34 commented 4 years ago

I'm trying to pass parameters to AWS codebuild environment variable using $params.VAR1. But it doesn't take the value.

script{
println params.VAR1
}   

above prints abcdefg as output. But when I pass the same variable to CodeBuild in the pipeline script (same stage) like below. I don't get the value

envVariables: '[{buildversion, $(params.VAR1)},{source, jenkins}]', environmentTypeOverride: '',

image

shrivastavshubham34 commented 4 years ago

Figured it out! We just use VAR1 instead of params.VAR1