未验证 提交 273ee0e4 编写于 作者: P pityonline

Fix indentation in CI yaml

上级 434efdac
...@@ -88,18 +88,18 @@ The example below simply moves all files from the root of the project to the ...@@ -88,18 +88,18 @@ The example below simply moves all files from the root of the project to the
`public/` directory. The `.public` workaround is so `cp` doesn't also copy `public/` directory. The `.public` workaround is so `cp` doesn't also copy
`public/` to itself in an infinite loop: `public/` to itself in an infinite loop:
``` ```yaml
pages: pages:
stage: deploy stage: deploy
script: script:
- mkdir .public - mkdir .public
- cp -r * .public - cp -r * .public
- mv .public public - mv .public public
artifacts: artifacts:
paths: paths:
- public - public
only: only:
- master - master
``` ```
Read more on [GitLab Pages user documentation](../../user/project/pages/index.md). Read more on [GitLab Pages user documentation](../../user/project/pages/index.md).
...@@ -131,15 +131,15 @@ if you set it per-job: ...@@ -131,15 +131,15 @@ if you set it per-job:
```yaml ```yaml
before_script: before_script:
- global before script - global before script
job: job:
before_script: before_script:
- execute this instead of global before script - execute this instead of global before script
script: script:
- my command - my command
after_script: after_script:
- execute this after my script - execute this after my script
``` ```
## `stages` ## `stages`
...@@ -409,18 +409,18 @@ fails, it will not stop the next stage from running, since it's marked with ...@@ -409,18 +409,18 @@ fails, it will not stop the next stage from running, since it's marked with
job1: job1:
stage: test stage: test
script: script:
- execute_script_that_will_fail - execute_script_that_will_fail
allow_failure: true allow_failure: true
job2: job2:
stage: test stage: test
script: script:
- execute_script_that_will_succeed - execute_script_that_will_succeed
job3: job3:
stage: deploy stage: deploy
script: script:
- deploy_to_staging - deploy_to_staging
``` ```
## `when` ## `when`
...@@ -442,38 +442,38 @@ For example: ...@@ -442,38 +442,38 @@ For example:
```yaml ```yaml
stages: stages:
- build - build
- cleanup_build - cleanup_build
- test - test
- deploy - deploy
- cleanup - cleanup
build_job: build_job:
stage: build stage: build
script: script:
- make build - make build
cleanup_build_job: cleanup_build_job:
stage: cleanup_build stage: cleanup_build
script: script:
- cleanup build when failed - cleanup build when failed
when: on_failure when: on_failure
test_job: test_job:
stage: test stage: test
script: script:
- make test - make test
deploy_job: deploy_job:
stage: deploy stage: deploy
script: script:
- make deploy - make deploy
when: manual when: manual
cleanup_job: cleanup_job:
stage: cleanup stage: cleanup
script: script:
- cleanup after jobs - cleanup after jobs
when: always when: always
``` ```
...@@ -734,8 +734,8 @@ rspec: ...@@ -734,8 +734,8 @@ rspec:
script: test script: test
cache: cache:
paths: paths:
- binaries/*.apk - binaries/*.apk
- .config - .config
``` ```
Locally defined cache overrides globally defined options. The following `rspec` Locally defined cache overrides globally defined options. The following `rspec`
...@@ -744,14 +744,14 @@ job will cache only `binaries/`: ...@@ -744,14 +744,14 @@ job will cache only `binaries/`:
```yaml ```yaml
cache: cache:
paths: paths:
- my/files - my/files
rspec: rspec:
script: test script: test
cache: cache:
key: rspec key: rspec
paths: paths:
- binaries/ - binaries/
``` ```
Note that since cache is shared between jobs, if you're using different Note that since cache is shared between jobs, if you're using different
...@@ -786,7 +786,7 @@ For example, to enable per-branch caching: ...@@ -786,7 +786,7 @@ For example, to enable per-branch caching:
cache: cache:
key: "$CI_COMMIT_REF_SLUG" key: "$CI_COMMIT_REF_SLUG"
paths: paths:
- binaries/ - binaries/
``` ```
If you use **Windows Batch** to run your shell scripts you need to replace If you use **Windows Batch** to run your shell scripts you need to replace
...@@ -796,7 +796,7 @@ If you use **Windows Batch** to run your shell scripts you need to replace ...@@ -796,7 +796,7 @@ If you use **Windows Batch** to run your shell scripts you need to replace
cache: cache:
key: "%CI_COMMIT_REF_SLUG%" key: "%CI_COMMIT_REF_SLUG%"
paths: paths:
- binaries/ - binaries/
``` ```
### `cache:untracked` ### `cache:untracked`
...@@ -819,7 +819,7 @@ rspec: ...@@ -819,7 +819,7 @@ rspec:
cache: cache:
untracked: true untracked: true
paths: paths:
- binaries/ - binaries/
``` ```
### `cache:policy` ### `cache:policy`
...@@ -897,8 +897,8 @@ Send all files in `binaries` and `.config`: ...@@ -897,8 +897,8 @@ Send all files in `binaries` and `.config`:
```yaml ```yaml
artifacts: artifacts:
paths: paths:
- binaries/ - binaries/
- .config - .config
``` ```
To disable artifact passing, define the job with empty [dependencies](#dependencies): To disable artifact passing, define the job with empty [dependencies](#dependencies):
...@@ -927,7 +927,7 @@ release-job: ...@@ -927,7 +927,7 @@ release-job:
- mvn package -U - mvn package -U
artifacts: artifacts:
paths: paths:
- target/*.war - target/*.war
only: only:
- tags - tags
``` ```
...@@ -949,7 +949,7 @@ job: ...@@ -949,7 +949,7 @@ job:
artifacts: artifacts:
name: "$CI_JOB_NAME" name: "$CI_JOB_NAME"
paths: paths:
- binaries/ - binaries/
``` ```
To create an archive with a name of the current branch or tag including only To create an archive with a name of the current branch or tag including only
...@@ -960,7 +960,7 @@ job: ...@@ -960,7 +960,7 @@ job:
artifacts: artifacts:
name: "$CI_COMMIT_REF_NAME" name: "$CI_COMMIT_REF_NAME"
paths: paths:
- binaries/ - binaries/
``` ```
To create an archive with a name of the current job and the current branch or To create an archive with a name of the current job and the current branch or
...@@ -971,7 +971,7 @@ job: ...@@ -971,7 +971,7 @@ job:
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths: paths:
- binaries/ - binaries/
``` ```
To create an archive with a name of the current [stage](#stages) and branch name: To create an archive with a name of the current [stage](#stages) and branch name:
...@@ -981,7 +981,7 @@ job: ...@@ -981,7 +981,7 @@ job:
artifacts: artifacts:
name: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME" name: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths: paths:
- binaries/ - binaries/
``` ```
--- ---
...@@ -994,7 +994,7 @@ job: ...@@ -994,7 +994,7 @@ job:
artifacts: artifacts:
name: "%CI_JOB_STAGE%-%CI_COMMIT_REF_NAME%" name: "%CI_JOB_STAGE%-%CI_COMMIT_REF_NAME%"
paths: paths:
- binaries/ - binaries/
``` ```
If you use **Windows PowerShell** to run your shell scripts you need to replace If you use **Windows PowerShell** to run your shell scripts you need to replace
...@@ -1005,7 +1005,7 @@ job: ...@@ -1005,7 +1005,7 @@ job:
artifacts: artifacts:
name: "$env:CI_JOB_STAGE-$env:CI_COMMIT_REF_NAME" name: "$env:CI_JOB_STAGE-$env:CI_COMMIT_REF_NAME"
paths: paths:
- binaries/ - binaries/
``` ```
### `artifacts:untracked` ### `artifacts:untracked`
...@@ -1030,7 +1030,7 @@ Send all Git untracked files and files in `binaries`: ...@@ -1030,7 +1030,7 @@ Send all Git untracked files and files in `binaries`:
artifacts: artifacts:
untracked: true untracked: true
paths: paths:
- binaries/ - binaries/
``` ```
### `artifacts:when` ### `artifacts:when`
...@@ -1120,26 +1120,26 @@ build:osx: ...@@ -1120,26 +1120,26 @@ build:osx:
script: make build:osx script: make build:osx
artifacts: artifacts:
paths: paths:
- binaries/ - binaries/
build:linux: build:linux:
stage: build stage: build
script: make build:linux script: make build:linux
artifacts: artifacts:
paths: paths:
- binaries/ - binaries/
test:osx: test:osx:
stage: test stage: test
script: make test:osx script: make test:osx
dependencies: dependencies:
- build:osx - build:osx
test:linux: test:linux:
stage: test stage: test
script: make test:linux script: make test:linux
dependencies: dependencies:
- build:linux - build:linux
deploy: deploy:
stage: deploy stage: deploy
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册