You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jekyll/_cci2/creating-orbs.md
+20-3Lines changed: 20 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,6 @@ workflows:
133
133
134
134
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.
135
135
136
-
137
136
### Example Inline Template
138
137
139
138
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
256
255
* MINOR: when you add functionality in a backwards-compatible manner
257
256
* PATCH: when you make backwards-compatible bug fixes
258
257
259
-
260
258
#### Using Orbs Within Your Orb and Register-Time Resolution
261
259
262
260
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
267
265
268
266
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`.
269
267
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
+
270
288
### Deleting Production Orbs
271
289
272
290
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
519
537
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.
520
538
10. Running `circleci-config-validate .circleci/config.yml` to validate it is well-formed.
521
539
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.
Copy file name to clipboardExpand all lines: jekyll/_cci2/orbs-faq.md
+25-5Lines changed: 25 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,6 @@ only certified orbs are permitted in this project.
60
60
61
61
* 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.
62
62
63
-
64
63
<!---
65
64
### Environment Variables Not Being Passed at Runtime
66
65
@@ -108,7 +107,6 @@ yourusername/circle-autoAdded by GitHub
108
107
```
109
108
--->
110
109
111
-
112
110
### Logging Outputs
113
111
114
112
* 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
117
115
118
116
### Failing Builds
119
117
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.
121
121
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
123
123
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 %}
124
145
125
146
## See Also
126
147
- Refer to [Orb Introduction]({{site.baseurl}}/2.0/orb-intro/), for a high-level overview.
127
148
- Refer to [Using Orbs]({{site.baseurl}}/2.0/using-orbs/), for more about how to use existing orbs.
128
149
- 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.
129
150
- Refer to [Reusing Config]({{site.baseurl}}/2.0/reusing-config/) for more detailed examples of reusable orbs, commands, parameters, and executors.
0 commit comments