8000 Merge branch 'master' into Reusing-Config-Updated-021119 · stackbuilders/circleci-docs@350c239 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 350c239

Browse files
Merge branch 'master' into Reusing-Config-Updated-021119
2 parents e07f4ac + bebece6 commit 350c239

File tree

12 files changed

+423
-20
lines changed

12 files changed

+423
-20
lines changed

jekyll/_cci2/creating-orbs.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ Inline orbs can be handy during development of an orb or as a convenience for na
137137

138138
To write inline orbs, place the orb elements under that orb's key in the ```orbs``` declaration in the configuration. For example, if you want to import one orb and then author inline for another, the orb might look like the example shown below:
139139

140-
```
140+
{% raw %}
141+
```yaml
142+
version: 2.1
141143
description: # The purpose of this orb
142144

143145
orbs:
@@ -166,16 +168,17 @@ workflows:
166168
jobs:
167169
- my-orb/myjob
168170
```
171+
{% endraw %}
169172
170173
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.
171174

172175
### Example Inline Template
173176

174177
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.
175178

176-
```
179+
{% raw %}
180+
```yaml
177181
version: 2.1
178-
179182
description: This is an inline job
180183
181184
orbs:
@@ -216,6 +219,7 @@ workflows:
216219
name: mybuild2
217220
greeting_name: world
218221
```
222+
{% endraw %}
219223

220224
## Providing Usage Examples of Orbs
221225
_The `examples` stanza is available in configuration version 2.1 and later_
@@ -236,6 +240,7 @@ The top level `examples` key is optional. Example usage maps nested below it can
236240
### Simple Examples
237241
Below is an example orb you can use:
238242

243+
{% raw %}
239244
```yaml
240245
version: 2.1
241246
description: A foo orb
@@ -250,10 +255,14 @@ commands:
250255
steps:
251256
- run: "echo Hello << parameters.username >>"
252257
```
258+
{% endraw %}
253259

254260
If you would like, you may also supply an additional `examples` stanza in the orb like the example shown below:
255261

262+
{% raw %}
256263
```yaml
264+
version: 2.1
265+
257266
examples:
258267
simple_greeting:
259268
description: Greeting a user named Anna
@@ -268,14 +277,18 @@ examples:
268277
- foo/hello:
269278
username: "Anna"
270279
```
280+
{% endraw %}
271281

272282
Please note that `examples` can contain multiple keys at the same level as `simple_greeting`, allowing for multiple examples.
273283

274284
### Expected Usage Results
275285

276286
The above usage example can be optionally supplemented with a `result` key, demonstrating what the configuration will look like after expanding the orb with its parameters:
277287

288+
{% raw %}
278289
```yaml
290+
version: 2.1
291+
279292
examples:
280293
simple_greeting:
281294
description: Greeting a user named Anna
@@ -303,6 +316,7 @@ examples:
303316
jobs:
304317
- build
305318
```
319+
{% endraw %}
306320

307321
## Publishing an Orb
308322

@@ -352,20 +366,25 @@ In development orbs, the string label given by the user has the following restri
352366
Examples of valid development orb tags:
353367

354368
* Valid:
369+
370+
{% raw %}
355371
```
356372
"dev:mybranch"
357373
"dev:2018_09_01"
358374
"dev:1.2.3-rc1"
359375
"dev:myinitials/mybranch"
360376
"dev:myVERYIMPORTANTbranch"
361377
```
378+
{% endraw %}
362379
363380
* Invalid
364381
382+
{% raw %}
365383
```
366384
"dev: 1" (No spaces allowed)
367385
"1.2.3-rc1" (No leading "dev:")
368386
```
387+
{% endraw %}
369388
370389
In production orbs, use the form ```X.Y.Z``` where ```X``` is a "major" version, ```Y``` is a "minor" version, and ```Z``` is a "patch" version. For example, 2.4.0 implies the major version 2, minor version 4, and the patch version of 0.
371390
@@ -388,7 +407,9 @@ If ```biz/baz``` is updated to ```3.0.0```, anyone using ```foo/bar@1.2.3``` wil
388407
**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.
389408
390409
{% raw %}
391-
```
410+
```yaml
411+
version: 2.1
412+
392413
orbs:
393414
some-orb: some-ns/some-orb@volatile
394415
executors:
@@ -400,7 +421,7 @@ jobs:
400421
another-job:
401422
executor: my-executor
402423
steps:
403-
- my-command
424+
- my-command:
404425
param1: "hello"
405426
```
406427
{% endraw %}
@@ -586,7 +607,8 @@ This command is used to publish an orb. The following parameters may be passed w
586607

587608
Below is an example of how to use the `orb-tools` orb to validate and publish an orb.
588609

589-
```
610+
{% raw %}
611+
```yaml
590612
version: 2.1
591613

592614
orbs:
@@ -601,5 +623,13 @@ workflows:
601623
publish-token-variable: "$CIRCLECI_DEV_API_TOKEN"
602624
validate: true
603625
```
626+
{% endraw %}
604627
605628
In this example, the `btd` workflow runs the `orb-tools/validate` job first. If the orb is indeed valid, the next step will execute, and `orb-tools/publish` will execute. When `orb-tools/publish` succeeds, the job input will contain a success message that the new orb has been published.
629+
630+
## See Also
631+
- Refer to [Using Orbs]({{site.baseurl}}/2.0/using-orbs/), for more about how to use existing orbs.
632+
- Refer to [Orbs FAQ]({{site.baseurl}}/2.0/orbs-faq/), where you will find answers to common questions.
633+
- Refer to [Reusing Config]({{site.baseurl}}/2.0/reusing-config/) for more detailed examples of reusable orbs, commands, parameters, and executors.
634+
- Refer to [Testing Orbs]({{site.baseurl}}/2.0/testing-orbs/) for information about how to test the orbs you have created.
635+
- Refer to [Orbs Registry](https://circleci.com/orbs/registry/licensing) for more detailed information about legal terms and conditions when using orbs.

jekyll/_cci2/google-auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
- image: google/cloud-sdk
112112
steps:
113113
- run: |
114-
echo $GCLOUD_SERVICE_KEY | sudo gcloud auth activate-service-account --key-file=-
114+
echo $GCLOUD_SERVICE_KEY | gcloud auth activate-service-account --key-file=-
115115
gcloud --quiet config set project ${GOOGLE_PROJECT_ID}
116116
gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE}
117117
```

jekyll/_cci2/nomad-metrics.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ echo "--------------------------------------"
161161
docker pull $CONTAINER_IMAGE
162162
docker rm -f $CONTAINER_NAME || true
163163

164-
# Not using --detach so that upstart can perform log management and process
165-
# monitoring
166164
docker run -d --name $CONTAINER_NAME \
167165
--rm \
168166
--net=host \

jekyll/_cci2/orb-intro.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CircleCI Orbs are shareable packages of configuration elements, including jobs,
1313

1414
To import an existing orb, add a single line to to your version 2.1 [.circleci/config.yml]({{ site.baseurl }}/2.0/configuration-reference/) file for each orb, for example:
1515

16-
```
16+
```yaml
1717
version: 2.1
1818

1919
orbs:
@@ -29,11 +29,11 @@ In the above exampl F438 e, two orbs are imported into your config, the [Slack orb](ht
2929

3030
If you find that there are no existing orbs that meet your needs, you may author your own orb to meet your specific environment or configuration requirements by using the [CircleCI CLI]({{ site.baseurl }}/2.0/local-cli/) as shown in the `circleci orb help` output below. Although this is more time-consuming than using the import feature, authoring your own orb enables you to create a world-readable orb for sharing your configuration.
3131

32-
```nohighlight
32+
```
33+
nohighlight
3334
$ circleci orb help
3435
Operate on orbs
3536

36-
3737
Usage:
3838
circleci orb [command]
3939

@@ -52,7 +52,7 @@ Available Commands:
5252
5353
Import the following Partner Orbs by using the `orbs` key in your `.circleci.yml/config.yml` file and replacing `<orb reference string>` with one from the table.
5454
55-
```
55+
```yaml
5656
version: 2.1
5757
5858
orbs:
@@ -93,4 +93,3 @@ Partner Orb Registry Link | Orb Reference String
9393
- Refer to [Reusing Config]({{site.baseurl}}/2.0/reusing-config/) for more detailed examples of reusable orbs, commands, parameters, and executors.
9494
- Refer to [Testing Orbs]({{site.baseurl}}/2.0/testing-orbs/) for information about how to test the orbs you have created.
9595
- Refer to [Orbs Registry](https://circleci.com/orbs/registry/licensing) for more detailed information about legal terms and conditions when using orbs.
96-

jekyll/_cci2/orbs-faq.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ To resolve this issue, go to "Settings -> Security -> Allow uncertified orbs" an
163163
**Note:** CircleCI does not require this for certified orbs (orbs that have been reviewed and approved by CircleCI prior to publishing). At this time, the certification program for orbs authored by third parties is not yet available, though will be available in the near future.
164164

165165
## See Also
166-
- Refer to [Orb Introduction]({{site.baseurl}}/2.0/orb-intro/), for a high-level overview.
167166
- Refer to [Using Orbs]({{site.baseurl}}/2.0/using-orbs/), for more about how to use existing orbs.
168167
- 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.
169168
- Refer to [Reusing Config]({{site.baseurl}}/2.0/reusing-config/) for more detailed examples of reusable orbs, commands, parameters, and executors.
169+
- Refer to [Testing Orbs]({{site.baseurl}}/2.0/testing-orbs/) for information about how to test the orbs you have created.
170+
- Refer to [Orbs Registry](https://circleci.com/orbs/registry/licensing) for more detailed information about legal terms and conditions when using orbs.

jekyll/_cci2/single-box.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ this access with `iptables` rules in a production setup, [contact support](https
4343
"sa-east-1": "ami-70026d1c",
4444
"us-east-1": "ami-cb6f1add",
4545
"us-east-2": "ami-57c7e032",
46-
"us-west-1": "ami-4fc8ee2f",
46+
"us-west-1": "ami-059b818564104e5c6",
4747
"us-west-2": "ami-c24a2fa2"
4848
};
4949

jekyll/_cci2/testing-orbs.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ In all cases, CircleCI recommends that you make use of the CircleCI CLI to valid
182182
For advanced testing, you may also want to use a shell unit testing framework such as BATS.
183183

184184
## See Also
185-
186-
* Refer to [Creating Orbs]({{site.baseurl}}//2.0/creating-orbs/#creating-inline-orbs) for more information on how to test your inline orbs.
187-
* Refer to [CircleCI CLI]({{ site.baseurl }}/2.0/local-cli/) for more detailed information on the CircleCI CLI and how to use the CLI for orb testing.
185+
- Refer to [Using Orbs]({{site.baseurl}}/2.0/using-orbs/), for more about how to use existing orbs.
186+
- 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.
187+
- Refer to the [Orbs FAQ]({{site.baseurl}}/2.0/orbs-faq/), where you will find answers to common questions.
188+
- Refer to [Reusing Config]({{site.baseurl}}/2.0/reusing-config/) for more detailed examples of reusable orbs, commands, parameters, and executors.
189+
- Refer to [Orbs Registry](https://circleci.com/orbs/registry/licensing) for more detailed information about legal terms and conditions when using orbs.

jekyll/_cci2/workflows.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,11 @@ When you use workflows, you increase your ability to rapidly respond to failures
545545

546546
This section describes common problems and solutions for Workflows.
547547

548+
### Rerunning Workflows Fails
549+
{:.no_toc}
550+
551+
It has been observed that in some case, a failure happens before the workflow runs (during build processing). In this case, rerunning the workflow will fail even though it was succeeding before the outage. To workaround this, push a change to the project's repository. This will re-run build processing first and then run the workflow.
552+
548553
### Workflows Not Starting
549554
{:.no_toc}
550555

jekyll/_cci2_ja/caching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ CircleCI 2.0 で利用できる、強力でカスタマイズ性の高い依存
186186
{% raw %}`{{ .Environment.variableName }}`{% endraw %} | `variableName` で示される環境変数 ([定義済み環境変数]({{ site.baseurl }}/ja/2.0/env-vars/)、もしくは[コンテキスト]({{ site.baseurl }}/ja/2.0/contexts)を指定できますが、ユーザー定義の環境変数は使えません)。
187187
{% raw %}`{{ checksum "filename" }}`{% endraw %} | filename で指定したファイル内容の SHA256 ハッシュを Base64 エンコードしたもの。ファイル内容に変更があるとキャッシュキーも新たに生成されます。 ここで指定できるのはリポジトリでコミットされているファイルに限られるため、 `package-lock.json` や `pom.xml`、もしくは `project.clj` などの依存関係を定義しているマニフェストファイルを使うことも検討してください。 また、`restore_cache` から `save_cache` までの処理でファイル内容が変わらないようにします。そうしないと `restore_cache` のタイミングで使われるファイルとは異なるキャッシュキーを元にキャッシュが保存されることになります。
188188
{% raw %}`{{ epoch }}`{% endraw %} | 協定世界時 (UTC) における 1970 年 1 月 1 日午前 0 時 0 分 0 秒からの経過秒数。POSIX 時間や UNIX 時間と同じです。
189-
{% raw %}`{{ arch }}`{% endraw %} | OS と CPU の種類。 OS や CPU アーキテクチャに合わせてコンパイル済みバイナリをキャッシュするような場合に用います。`darwin amd64` あるいは `linux amd64` のような文字列になります。 CircleCI で利用可能な CPU については[こちら]({{ site.baseurl }}/ja/2.0/faq/#which-cpu-architectures-does-circleci-support)を参照してください
189+
{% raw %}`{{ arch }}`{% endraw %} | OS と CPU の種類。 OS や CPU アーキテクチャに合わせてコンパイル済みバイナリをキャッシュするような場合に用います。`darwin amd64` あるいは `linux amd64` のような文字列になります。 CircleCI で利用可能な CPU については[こちら]({{ site.baseurl }}/ja/2.0/faq/#circleci-がサポートしている-cpu-アーキテクチャは)を参照してください
190190
{: class="table table-striped"}
191191

192192
**注:** キャッシュに対してユニークな識別子を定義する際には、{% raw %}`{{ epoch }}`{% endraw %} のような厳密すぎる値になるテンプレートをむやみに使わないよう注意してください。 {% raw %}`{{ .Branch }}`{% endraw %} や {% raw %}`{{ checksum "filename" }}`{% endraw %} といった汎用性の高い値になるテンプレートを使うと、使われるキャッシュの数は増えます。 これについては、以降で説明するようにトレードオフの関係にあると言えます。

0 commit comments

Comments
 (0)
0