Skip to content

Commit c4eb6ff

Browse files
Merge branch 'master' into Updated-Reusing-Config
2 parents a99e7a2 + c5e39d1 commit c4eb6ff

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

jekyll/_cci2/creating-orbs.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ workflows:
133133

134134
In the example above, note that the contents of ```my-orb``` are resolved as an inline orb because the contents of ```my-orb``` are a map; whereas the contents of ```codecov``` are a scalar value, and thus assumed to be an orb URI.
135135

136-
137136
### Example Inline Template
138137

139138
When you want to author an orb, you may wish to use this example template to quickly and easily create a new orb with all of the required components. This example includes each of the three top-level concepts of orbs. While any orb can be equally expressed as an inline orb definition, it will generally be simpler to iterate on an inline orb and use ```circleci config process .circleci/config.yml``` to check whether your orb usage matches your expectation.
@@ -256,7 +255,6 @@ While not strictly enforced, it is best practice when versioning your production
256255
* MINOR: when you add functionality in a backwards-compatible manner
257256
* PATCH: when you make backwards-compatible bug fixes
258257

259-
260258
#### Using Orbs Within Your Orb and Register-Time Resolution
261259

262260
You may use an ```orbs``` stanza inside an orb.
@@ -267,6 +265,26 @@ For example, orb ```foo/bar``` is published at version ```1.2.3``` with an ```or
267265

268266
If ```biz/baz``` is updated to ```3.0.0```, anyone using ```foo/[email protected]``` will not see the change in ```biz/[email protected]``` until ```foo/bar``` is published at a higher version than `1.2.3`.
269267

268+
**Note:** Orb elements may be composed directly with elements of other orbs. For example, you may have an orb that looks like the example below.
269+
270+
{% raw %}
271+
```
272+
orbs:
273+
some-orb: some-ns/some-orb@volatile
274+
executors:
275+
my-executor: some-orb/their-executor
276+
commands:
277+
my-command: some-orb/their-command
278+
jobs:
279+
my-job: some-orb/their-job
280+
another-job:
281+
executor: my-executor
282+
steps:
283+
- my-command
284+
param1: "hello"
285+
```
286+
{% endraw %}
287+
270288
### Deleting Production Orbs
271289

272290
In general, CircleCI prefers to never delete production orbs that were published as world-readable because it harms the reliability of the orb registry as a source of configuration and the trust of all orb users.
@@ -519,4 +537,3 @@ The animation shows snippets to give you an overview of the following steps for
519537
9. Replacing the inline executor and job definitions in the `.circleci/config.yml` with the reference to the published `ndintenfass/orb-utils@dev:test` orb.
520538
10. Running `circleci-config-validate .circleci/config.yml` to validate it is well-formed.
521539
11. Committing the change and checking that the build succeeds when using the imported orb. The processed config appears on the Configuration tab of the CircleCI Jobs page.
522-

jekyll/_cci2/orbs-faq.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ only certified orbs are permitted in this project.
6060

6161
* Answer: Try making a whitespace change or similar. Your config won't recompile until you've made a change. Config processing happens before the compiled code is passed into the workflows conductor. Because of that, the workflows conductor (where you trigger the rebuild) knows nothing of the original 2.1 config.
6262

63-
6463
<!---
6564
### Environment Variables Not Being Passed at Runtime
6665
@@ -108,7 +107,6 @@ yourusername/circle-autoAdded by GitHub
108107
```
109108
--->
110109

111-
112110
### Logging Outputs
113111

114112
* Question: Is there a standard way to to log output? For example, Jenkins plugins provide console links to show the log output and provides hooks to log those messages. It is possible to log to stdout, but is there a better way to log those log messages.
@@ -117,14 +115,36 @@ yourusername/circle-autoAdded by GitHub
117115

118116
### Failing Builds
119117

120-
Question: How can I intentionally fail a job that invokes an orb from within an orb?
118+
* Question: How can I intentionally fail a job that invokes an orb from within an orb?
119+
120+
* Answer: You can always return a non-zero status code from the shell to fail the job. You can also use `run: circleci-agent step halt` as a step to exit the job without failing.
121121

122-
Answer: You can always return a non-zero status code from the shell to fail the job. You can also use `run: circleci-agent step halt` as a step to exit the job without failing.
122+
### Using Orb Elements For Other Orbs
123123

124+
* Question: May I use elements from a different orb when creating my own orb?
125+
126+
* Answer: Yes, orbs may be composed directly using elements of other orbs. For example:
127+
128+
{% raw %}
129+
```
130+
orbs:
131+
some-orb: some-ns/some-orb@volatile
132+
executors:
133+
my-executor: some-orb/their-executor
134+
commands:
135+
my-command: some-orb/their-command
136+
jobs:
137+
my-job: some-orb/their-job
138+
another-job:
139+
executor: my-executor
140+
steps:
141+
- my-command
142+
param1: "hello"
143+
```
144+
{% endraw %}
124145

125146
## See Also
126147
- Refer to [Orb Introduction]({{site.baseurl}}/2.0/orb-intro/), for a high-level overview.
127148
- Refer to [Using Orbs]({{site.baseurl}}/2.0/using-orbs/), for more about how to use existing orbs.
128149
- Refer to [Creating Orbs]({{site.baseurl}}/2.0/creating-orbs/), where you will find step-by-step instructions on how to create your own orb.
129150
- Refer to [Reusing Config]({{site.baseurl}}/2.0/reusing-config/) for more detailed examples of reusable orbs, commands, parameters, and executors.
130-

0 commit comments

Comments
 (0)