Skip to content

Commit

Permalink
docs: add docs for project-variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ANGkeith committed Oct 4, 2024
1 parent 9a0ddea commit df19bb2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,29 @@ gitlab-ci-local --remote-variables git@gitlab.com:firecow/example.git=gitlab-var

### Project file variables

Put a file like this in `$CWD/.gitlab-ci-local-variables.yml`
The `--variables-file` [default: $CWD/.gitlab-ci-local-variables.yml] supports the following format

#### yaml
```yaml
---
AUTHORIZATION_PASSWORD: djwqiod910321
DOCKER_LOGIN_PASSWORD: dij3213n123n12in3
# Will be type File, because value is a file path
KNOWN_HOSTS: '~/.ssh/known_hosts'
# This is only supported in the yaml format
# https://docs.gitlab.com/ee/ci/environments/index.html#limit-the-environment-scope-of-a-cicd-variable
EXAMPLE:
values:
"*": "I am only available the rest of the jobs"
staging: "I am only available in jobs with `environment: staging`"
production: "I am only available in jobs with `environment: production`"
```
#### .env
```
AUTHORIZATION_PASSWORD=djwqiod910321
DOCKER_LOGIN_PASSWORD=dij3213n123n12in3
KNOWN_HOSTS='~/.ssh/known_hosts'
```

Variables will now appear in your jobs.
Expand Down

0 comments on commit df19bb2

Please sign in to comment.