Skip to content

Commit 40c0bea

Browse files
Merge pull request circleci#1150 from circleci/migrating-format-and-toc
Migrating format and toc
2 parents c0734b2 + 2f537d0 commit 40c0bea

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

jekyll/_cci2/migrating-from-1-2.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ order: 15
99

1010
CircleCI 2.0 introduces the requirement that you create a configuration file (`.circleci/config.yml`), and it adds new required keys for which values must be defined. This release also allows you to use multiple jobs in your configuration. **Note:** If you configure multiple jobs, it is important to have parallelism set to `1` to prevent duplication of job runs.
1111

12-
If you already have a `circle.yml` file, this article will help you add the new required keys and values and then search and replace your 1.0 keys with 2.0 keys. If you do not have a `circle.yml` file, refer to the [Sample 2.0 `config.yml` File]({{ site.baseurl }}/2.0/sample-config) to get started from scratch.
12+
If you already have a `circle.yml` file, this article will help you make a copy your exisiting file, create the new required keys, and then search and replace your 1.0 keys with 2.0 keys. If you do not have a `circle.yml` file, refer to the [Sample 2.0 `config.yml` File]({{ site.baseurl }}/2.0/sample-config) to get started from scratch.
13+
14+
* Contents
15+
{:toc}
1316

1417
## Steps to Configure Required 2.0 Keys
1518

@@ -55,13 +58,13 @@ Optionally configure workflows, using the following instructions:
5558
5659
2. To persist a job artifact, add the `persist_to_workspace:<directory>` key at the end of the job, under `steps:`. Then, to get the saved artifact for use by another job, add the `attach_workspace:` key with a nested `at:<directory>` key, ideally defined as the directory where the artifact was saved.
5760
58-
3. Add lines for `workflows:`, `version: 2` and *<workflow_name>* at the *end* of the master `.circle/config.yml` file, replacing *<workflow_name>* with a unique name for your workflow. **Note:** The Workflows section of the `config.yml` file is not nested in the config. It is best to put the Workflows at the end of the file because the Workflows `version: 2` is in addition to the `version:` key at the top of the `config.yml` file during Beta.
61+
3. As a best practice, add lines for `workflows:`, `version: 2` and `<workflow_name>` at the *end* of the master `.circle/config.yml` file, replacing `<workflow_name>` with a unique name for your workflow. **Note:** The Workflows section of the `config.yml` file is not nested in the config. It is best to put the Workflows at the end of the file because the Workflows `version: 2` is in addition to the `version:` key at the top of the `config.yml` file during Beta.
5962
```
6063
workflows:
6164
version: 2
6265
<workflow_name>:
6366
```
64-
4. Add a line for the `jobs:` key under <workflow_name> and add a list of all of the job names you want to orchestrate. In this example, `build` and `test` will run in parallel.
67+
4. Add a line for the `jobs:` key under `<workflow_name>` and add a list of all of the job names you want to orchestrate. In this example, `build` and `test` will run in parallel.
6568
6669
```
6770
workflows:
@@ -71,14 +74,26 @@ Optionally configure workflows, using the following instructions:
7174
- build
7275
- test
7376
```
74-
5. For Jobs which must run sequentially depending on success of another job, add the `requires:` key with a nested list of Jobs that must succeed for it to start. If you were using a `curl` command to start a Job, Workflows enable you to remove the command and start the job by using Workflows with the `requires:` key.
77+
5. For jobs which must run sequentially depending on success of another job, add the `requires:` key with a nested list of jobs that must succeed for it to start. If you were using a `curl` command to start a job, Workflows enable you to remove the command and start the job by using the `requires:` key.
7578
7679
```
77-
- <job_name>
78-
requires:
79-
- <job_name>
80+
- <job_name>
81+
requires:
82+
- <job_name>
83+
```
84+
6. For jobs which must run on a particular branch, add the `filters:` key with a nested `branches` and `only` key. For jobs which must not run on a particular branch, add the `filters:` key with a nested `branches` and `ignore` key.
85+
8086
```
81-
6. Validate your YAML again at <http://codebeautify.org/yaml-validator> to check the changes.
87+
- <job_name>
88+
filters:
89+
branches:
90+
only: master
91+
- <job_name>
92+
filters:
93+
branches:
94+
ignore: master
95+
```
96+
7. Validate your YAML again at <http://codebeautify.org/yaml-validator> to check the changes.
8297
8398
## Search and Replace Deprecated 2.0 Keys
8499

0 commit comments

Comments
 (0)