awslabs / awslabs/aws-codebuild-jenkins-plugin
environment directive gets ignored
- Dominant language
- Java
- Stars
- 156
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Description
An environment variable set by an `environment` directive gets ignored in `envVariables`:
```
stage('Deploy') {
environment {
SOME_VAR = "TEST"
}
steps {
awsCodeBuild(
region: 'eu-central-1',
projectName: 'TestProject',
envVariables: '[{ ENV_VAR, ${SOME_VAR } }]',
credentialsType: 'keys',
sourceControlType: 'project'
)
}
}
```
```
[AWS CodeBuild Plugin] Starting build with
> project name: TestProject
> environment variables: [{ ENV_VAR, ${SOME_VAR} }]
```
I would expect the output to be
```
> environment variables: [{ ENV_VAR, TEST }]
```
I know that I can use double quotes in `envVariables`, but then special characters like äöüß get replaced by ä.
Same problem exists with Variables set by `build-user-vars-plugin`.
Contributor guide
Research direction
Start by reproducing the pipeline in the issue with an environment directive and the awsCodeBuild step, then trace how envVariables are parsed and passed to the build. Done means variables from the environment directive and build-user-vars-plugin resolve correctly while special characters such as äöüß remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- ci-cd, cloud, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100