Skip to content

Commit c10ef98

Browse files
Improve migration docs (#220)
* Describe remaining migration work * Don't dev-publish for forked-PRs. Only pack if tests worked * Example should only dev-publish for forked-PRs and only pack if tests worked * Moved changes to test-deploy.yml and example to new PRs --------- Co-authored-by: marboledacci <mateo.arboleda@circleci.com>
1 parent fbb85ba commit c10ef98

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

MIGRATION.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ _Note: If you are upgrading from 11.x to 12.x proceed here. If you are upgrading
1010

1111
- **Removed the need for a dev publishing token**
1212
- Previously, after the orb was built, it would be published to a development tag and referenced in the test pipeline. This required a publishing token to be present in the dev pipeline.
13-
- The dynamic configuration system allows us to inject the orb directly into the pipeline as an "in-line" orb, allowing for orb testing without the need for access to a publishing token.
13+
- The dynamic configuration system allows us to inject the orb directly into the pipeline as an "in-line" orb, allowing for orb testing without the need for access to a publishing token,
14+
thus allowing forked-PR builds to "build and test" securely.
1415
- **Snake_Case Renamed Components**
1516
- To keep consistency with CircleCI's _native_ configuration schema, all components and parameters have been renamed to use snake_case.
1617
(Example: `parameter-name` -> `parameter_name`)
@@ -21,16 +22,46 @@ _Note: If you are upgrading from 11.x to 12.x proceed here. If you are upgrading
2122

2223
1. Clone your orb project locally.
2324
1. Create a new branch for upgrading your pipeline
25+
2426
```sh
2527
git checkout -b orb-tools-12-migration
2628
````
29+
2730
1. Copy the `migrate.sh` script from this repository into your project's root directory.
2831
1. Run the script
32+
2933
```sh
3034
chmod +x migrate.sh && ./migrate.sh
3135
```
3236
3337
After executing the script, your orb's component names and parameters will be converted to snake_case, and references to them within your config files will be updated. The reference to your orb in the `test-deploy` config will be removed, as the orb will now be dynamically injected into the pipeline.
38+
39+
1. Edit your project's `.circleci/config.yml` file.
40+
41+
Compare the current
42+
[v12 "step1 " lint-pack example](https://circleci.com/developer/orbs/orb/circleci/orb-tools?version=12#usage-step1_lint-pack)
43+
vs the
44+
[v11 version](https://circleci.com/developer/orbs/orb/circleci/orb-tools?version=11#usage-step1_lint-pack)
45+
to see the required changes.
46+
- Remove the old "dev publish" job (`orb-tools/publish`) from the workflow.
47+
- Fix the `requires:` specification so that the "continue" job requires everything else.
48+
49+
1. Edit your project's `.circleci/test-deploy.yml` file.
50+
51+
Compare the current
52+
[v12 "step2 " test-deploy example](https://circleci.com/developer/orbs/orb/circleci/orb-tools?version=12#usage-step2_test-deploy)
53+
vs the
54+
[v11 version](https://circleci.com/developer/orbs/orb/circleci/orb-tools?version=11#usage-step2_test-deploy)
55+
to see the required changes.
56+
57+
- Add an extra call to the "pack" job (`orb-tools/pack`) and ensure that the publish job(s) `require:` it.
58+
- Consider adding an extra call to the "publish" job to reinstate the "dev publish" removed from the `config.yml` build file.
59+
- Not all users will require this; this is only necessary if dev publishes of unreleased orbs are needed for use by other projects.
60+
- Consider setting a filter to ensure that the dev publish doesn't happen for release builds (i.e. no tags) or for external (forked) PR builds (i.e. no branches matching `/^pull/[0-9]+$/`).
61+
- Make the "pack" job `require:` all your test jobs and then have the publish job(s) `require:` the pack job.
62+
63+
---
64+
3465
## v11.0.0
3566
3667
Version 11.0.0 of orb-tools is composed of a major re-write that greatly changes and improves the way orbs are deployed, makes use of CircleCI's [dynamic configuration](https://circleci.com/docs/2.0/dynamic-config/), and can even automatically test for best practices.

0 commit comments

Comments
 (0)