mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +00:00
documented parameter substitution [CI SKIP]
This commit is contained in:
parent
2d37d66e2d
commit
f36cbf54ee
2 changed files with 30 additions and 3 deletions
19
docs/build/env.md
vendored
19
docs/build/env.md
vendored
|
@ -27,11 +27,10 @@ Drone also injects `CI_` prefixed variables for compatibility with other systems
|
|||
* `CI_TAG` - tag name for the current build
|
||||
|
||||
|
||||
## Injecting
|
||||
## Substitution
|
||||
|
||||
A subset of variables may be injected directly into the Yaml at runtime using the `$$` notation:
|
||||
A subset of variables may be substituted directly into the Yaml at runtime using the `$$` notation:
|
||||
|
||||
* `$$COMMIT_SHORT` git sha for the current build, `--short` format
|
||||
* `$$COMMIT` git sha for the current build, long format
|
||||
* `$$BRANCH` git branch for the current build
|
||||
* `$$REPO` repository full name (in `owner/name` format)
|
||||
|
@ -45,3 +44,17 @@ publish:
|
|||
source: ./foo.tar.gz
|
||||
target: ./foo-$$BRANCH.tar.gz
|
||||
```
|
||||
|
||||
## Operations
|
||||
|
||||
A subset of bash string substitution operations are emulated:
|
||||
|
||||
* `$$param` parameter substitution
|
||||
* `$${param}` parameter substitution (same as above)
|
||||
* `"$$param"` parameter substitution with escaping
|
||||
* `$${param:pos}` parameter substition with substring
|
||||
* `$${param:pos:len}` parameter substition with substring
|
||||
* `$${param=default}` parameter substition with default
|
||||
* `$${param##prefix}` parameter substition with prefix removal
|
||||
* `$${param%%suffix}` parameter substition with suffix removal
|
||||
* `$${param/old/new}` parameter substition with find and replace
|
||||
|
|
14
docs/build/secrets.md
vendored
14
docs/build/secrets.md
vendored
|
@ -41,6 +41,20 @@ deploy:
|
|||
token: $$HEROKU_TOKEN
|
||||
```
|
||||
|
||||
## Substitution
|
||||
|
||||
A subset of bash string substitution operations are emulated:
|
||||
|
||||
* `$$param` parameter substitution
|
||||
* `$${param}` parameter substitution (same as above)
|
||||
* `"$$param"` parameter substitution with escaping
|
||||
* `$${param:pos}` parameter substition with substring
|
||||
* `$${param:pos:len}` parameter substition with substring
|
||||
* `$${param=default}` parameter substition with default
|
||||
* `$${param##prefix}` parameter substition with prefix removal
|
||||
* `$${param%%suffix}` parameter substition with suffix removal
|
||||
* `$${param/old/new}` parameter substition with find and replace
|
||||
|
||||
## Pull Requests
|
||||
|
||||
Secret variables are **not** injected into to the build section of the `.drone.yml` if your repository is **public** and the build is a **pull request**. This is for security purposes to prevent a malicious pull request from leaking your secrets.
|
||||
|
|
Loading…
Reference in a new issue