Skip to content

Commit

Permalink
Merge pull request #110 from jeffret-b/documentQuotes
Browse files Browse the repository at this point in the history
Highlight importance of using single-quotes.
  • Loading branch information
jglick authored Oct 14, 2020
2 parents f1c7b3b + 849ce76 commit c85404d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ withCredentials([usernamePassword(credentialsId: 'amazon', usernameVariable: 'US
}
```

#### Note

You should use a single quote (`'`) instead of a double quote (`"`) whenever you can.
This is particularly important in Pipelines where a statement may be interpreted by both the Pipeline engine and an external interpreter, such as a Unix shell (`sh`) or Windows Command (`bat`) or Powershell (`ps`).
This reduces complications with password masking and command processing.
The first step in the above example properly demonstrates this.
The next two steps use the basic Pipeline `echo` step.
The first one references the Groovy variable and needs no quotes.
The second one needs to use double quotes, so that the interpolation is performed in Groovy.

For more information, see the Pipeline step reference for [Credentials Binding Plugin](https://www.jenkins.io/doc/pipeline/steps/credentials-binding/).

## Changelog

See [GitHub Releases](https://github.com/jenkinsci/credentials-binding-plugin/releases) for new releases,
Expand Down

0 comments on commit c85404d

Please sign in to comment.