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/configuration-cookbook.md
+20-72Lines changed: 20 additions & 72 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ This page, and its associated recipes, describes how you can perform specific co
21
21
### What Are CircleCI Orbs?
22
22
{:.no_toc}
23
23
24
-
CircleCI orbs are configuration packages that enable you to get started with the CircleCI platform. Orbs enable you to share, standardize, and simplify configurations across your projects. You may also want to use orbs as a reference for configuration best practices.
24
+
CircleCI orbs are configuration packages that enable you to get started with the CircleCI platform. Orbs enable you to share, standardize, and simplify configurations across your projects. You may also want to use orbs as a refererence for configuration best practices.
25
25
26
26
Refer to the [CircleCI Orbs Registry](https://circleci.com/orbs/registry/) for the complete list of available orbs.
27
27
@@ -42,7 +42,6 @@ workflows:
42
42
For more detailed information about CircleCI orbs, refer to the [Orbs Introduction]({{ site.baseurl }}/2.0/orb-intro/) page.
43
43
44
44
## Configure Your Environment for CircleCI Pipelines and Orbs
45
-
{:.no_toc}
46
45
47
46
Most recipes in this cookbook call for version 2.1 configuration, pipelines and often, orbs. Before using the examples provided, you should check that you are set up for these features. The following notes and steps will get you where you need to be.
48
47
@@ -52,6 +51,19 @@ Most recipes in this cookbook call for version 2.1 configuration, pipelines and
52
51
* In the examples on this page that use orbs, you will notice that the orbs are versioned with tags, for example, `aws-s3: circleci/[email protected]`. If you copy paste any examples you will need to edit `x.y.z` to specify a version. You can find the available versions listed on the individual orb pages in the [CircleCI Orbs Registry](https://circleci.com/orbs/registry/).
53
52
* Any items that appear within `< >` should be replaced with your own parameters.
54
53
54
+
## Configuration Recipes
55
+
56
+
The table below lists some recipes to help and inspire your projects.
57
+
58
+
Configuration Recipe | Description
59
+
------------|-----------
60
+
[Deploy Changes to Amazon Elastic Container Service (ECS)](#deploy-changes-to-amazon-ecs) | This section describes how you can deploy changes to the Amazon Elastic Container Service (ECS) using a CircleCI-certified ECS orb.
61
+
[Interact with Google Kubernetes Engine (GKE)](#interact-with-google-kubernetes-engine-gke) | This section describes how you can deploy changes to the Google Kubernetes Engine (GKE) using a CircleCI-certified GKE orb.
62
+
[Using Amazon Elastic Container Service for Kubernetes (Amazon EKS)](#using-amazon-elastic-container-service-for-kubernetes-amazon-eks) | This section describes how you can use the Amazon ECS service for Kubernetes for Kubernetes-related tasks and operations.
63
+
[Enabling Custom Slack Notifications in CircleCI Jobs](#enabling-custom-slack-notifications-in-circleci-jobs) | This section describes how you can enable customized Slack notifications in CircleCI jobs.
64
+
[Using Logic in Configuration](#using-logic-in-configuration) | This section describes how you can use pipeline values & parameters to select the work to perform.
65
+
{: class="table table-striped"}
66
+
55
67
## Deploy changes to Amazon ECS
56
68
57
69
The Amazon Elastic Container Service (ECS) is a scalable container orchestration service that enables you to support Docker containers and allows you to run and scale containerized applications on AWS. By using Amazon ECS, you will be able to use this service without installing and configuring your own container orchestration software, thereby eliminating the complexity of your deployment and ensuring you have a simple and optimized container deployment on the CircleCI platform. This recipe shows you how to quickly deploy software changes to Amazon ECS using CircleCI orbs, but if you would like more detailed information about the how Amazon ECS service works, and its underlying components and architecture, please refer to the [Amazon ECS]( https://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html) documentation.
@@ -452,11 +464,11 @@ Notice in the example that the job is run and a Slack status alert is sent to yo
452
464
453
465
For more detailed information about this orb and its functionality, refer to the Slack orb in the [CircleCI Orb Registry](https://circleci.com/orbs/registry/orb/circleci/slack).
454
466
455
-
## Selecting a Workflow to Run Using Pipeline Parameters
467
+
## Using Logic in Configuration
456
468
457
-
You might find that you want to be able to trigger a specific workflow to run, manually, using the API, but still run a workflow on every push to your project. To achieve this, use [pipeline parameters]({{ site.baseurl }}/2.0/pipeline-variables/#pipeline-parameters-in-configuration) to decide which workflow(s) to run.
469
+
### Selecting a Workflow With a Pipeline Parameter
458
470
459
-
The following example defaults to running the `build` workflow, but allows control of which other workflow to run using the API:
471
+
If you want to be able to trigger custom workflows manually via the API, but still run a workflow on every push, you can use pipeline parameters to decide which workflows to run. For more information see the [API Reference Documentation]({{ site.baseurl }}/2.0/configuration-cookbook/#selecting-a-workflow-with-a-pipeline-parameter) and the [API Developers Guide Example]({{ site.baseurl }}/2.0/api-developers-guide/#example-end-to-end-api-request)
460
472
461
473
```yaml
462
474
version: 2.1
@@ -494,7 +506,7 @@ workflows:
494
506
- report
495
507
```
496
508
497
-
The `action` parameter will default to `build` on pushes to the project. Below is an example of supplying a different value to `action` using the API v2 [Trigger a New Pipeline]({{ site.baseurl }}/api/v2/#trigger-a-new-pipeline) endpoint to select a different workflow to run, in this example, the workflow named `report` would run. Remember to substitute [`project-slug`]({{ site.baseurl }}/2.0/api-developers-guide/#getting-started-with-the-api) with your values.
509
+
The `action` parameter will default to `build` on pushes. Below is an example of supplying a different value using the API v2 Trigger a New Pipeline endpoint and Pipeline Parameters to select a different workflow to run, in this case, `report`. Remember to substitute [`project-slug`({{ site.baseurl }}/2.0/api-developers-guide/#getting-started-with-the-api) for your values.
498
510
499
511
```sh
500
512
curl -X POST https://circleci.com/api/v2/project/{project-slug}/pipeline \
@@ -504,13 +516,9 @@ curl -X POST https://circleci.com/api/v2/project/{project-slug}/pipeline \
504
516
-d '{ "parameters": { "action": report } }'
505
517
```
506
518
507
-
For more information on using API v2 endpoints, see the [API Reference Documentation]({{ site.baseurl }}/api/v2/) and the [API Developers Guide Worked Example]({{ site.baseurl }}/2.0/api-developers-guide/#example-end-to-end-api-request).
519
+
### Branch-filtering for Job Steps
508
520
509
-
## Branch-filtering for Job Steps
510
-
511
-
Branch filtering has previously only been available for workflows, but with compile-time logic statements, you can also implement branch filtering for job steps.
512
-
513
-
The following example shows using the [pipeline value]({{ site.baseurl }}/2.0/pipeline-variables/#pipeline-values) `pipeline.git.branch` to control `when` a step should run. In this case the step `run: echo "I am on master"` only runs when the commit is on the master branch:
521
+
Branch filtering has previously only been available for workflows, but with compile-time logic statements, you can implement it for job steps as well.
514
522
515
523
```yaml
516
524
version: 2.1
@@ -532,63 +540,3 @@ workflows:
532
540
jobs:
533
541
- my-job
534
542
```
535
-
536
-
## Use Matrix Jobs to Run Multiple OS Tests
537
-
538
-
Using matrix jobs is a good way to run a job multiple times with different arguments, using parameters. There are many uses for this, including testing on multiple operating systems and against different language/library versions.
539
-
540
-
In the following example the `test` job is run across Linux, Windows and macOS environments, using two different versions of node. On each run of the `test` job different parameters are passed to set both the OS and the node version:
windows: win/default # windows executor - uses the default executor from the windows orb
554
-
macos: # macos executor using xcode 11.6
555
-
macos:
556
-
xcode: 11.6
557
-
558
-
jobs:
559
-
test:
560
-
parameters:
561
-
os:
562
-
type: executor
563
-
node-version:
564
-
type: string
565
-
executor: << parameters.os >>
566
-
steps:
567
-
- checkout
568
-
- node/install:
569
-
node-version: << parameters.node-version >>
570
-
install-yarn: true
571
-
- run: yarn test
572
-
573
-
workflows:
574
-
all-tests:
575
-
jobs:
576
-
- test:
577
-
matrix:
578
-
parameters:
579
-
os: [linux, windows, macos]
580
-
node-version: ["13.13.0", "14.0.0"]
581
-
```
582
-
583
-
The expanded version of this matrix runs the following list of jobs under the `all-tests` workflow:
584
-
585
-
```
586
-
- test-13.13.0-linux
587
-
- test-14.0.0-linux
588
-
- test-13.13.0-windows
589
-
- test-14.0.0-windows
590
-
- test-13.13.0-macos
591
-
- test-14.0.0-macos
592
-
```
593
-
594
-
For full details of the matrix jobs specification, see the [Configuration Reference]({{ site.baseurl }}/2.0/configuration-reference/#matrix-requires-version-21).
Copy file name to clipboardExpand all lines: jekyll/_cci2/orb-author-faq.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -106,4 +106,4 @@ steps:
106
106
- Refer to [Orb Publishing Process]({{site.baseurl}}/2.0/creating-orbs/) for information about orbs that you may use in your workflows and jobs.
107
107
- Refer to [Orbs Reference]({{site.baseurl}}/2.0/reusing-config/) for examples of reusable orbs, commands, parameters, and executors.
108
108
- Refer to [Orb Testing Methodologies]({{site.baseurl}}/2.0/testing-orbs/) for information on how to test orbs you have created.
109
-
- Refer to [Configuration Cookbook]({{site.baseurl}}/2.0/configuration-cookbook/) for more detailed information about how you can use CircleCI orb recipes in your configurations.
109
+
- Refer to [Configuration Cookbook]({{site.baseurl}}/2.0/configuration-cookbook/#configuration-recipes) for more detailed information about how you can use CircleCI orb recipes in your configurations.
Copy file name to clipboardExpand all lines: jekyll/_cci2/orbs-faq.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -76,4 +76,4 @@ You attempted to run a local build with version 2.1 of configuration.
76
76
- Refer to [Orbs Concepts]({{site.baseurl}}/2.0/using-orbs/) for high-level information about CircleCI orbs.
77
77
- Refer to [Orb Publishing Process]({{site.baseurl}}/2.0/creating-orbs/) for information about orbs that you may use in your workflows and jobs.
78
78
- Refer to [Orbs Reference]({{site.baseurl}}/2.0/reusing-config/) for examples of reusable orbs, commands, parameters, and executors.
79
-
- Refer to [Configuration Cookbook]({{site.baseurl}}/2.0/configuration-cookbook/) for more detailed information about how you can use CircleCI orb recipes in your configurations.
79
+
- Refer to [Configuration Cookbook]({{site.baseurl}}/2.0/configuration-cookbook/#configuration-recipes) for more detailed information about how you can use CircleCI orb recipes in your configurations.
Copy file name to clipboardExpand all lines: jekyll/_cci2/testing-orbs.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -186,4 +186,4 @@ For advanced testing, you may also want to use a shell unit testing framework su
186
186
- Refer to [Orbs Concepts]({{site.baseurl}}/2.0/using-orbs/) for high-level information about CircleCI orbs.
187
187
- Refer to [Orb Publishing Process]({{site.baseurl}}/2.0/creating-orbs/) for information about orbs that you may use in your workflows and jobs.
188
188
- Refer to [Orbs Reference]({{site.baseurl}}/2.0/reusing-config/) for examples of reusable orbs, commands, parameters, and executors.
189
-
- Refer to [Configuration Cookbook]({{site.baseurl}}/2.0/configuration-cookbook/) for more detailed information about how you can use CircleCI orb recipes in your configurations.
189
+
- Refer to [Configuration Cookbook]({{site.baseurl}}/2.0/configuration-cookbook/#configuration-recipes) for more detailed information about how you can use CircleCI orb recipes in your configurations.
Copy file name to clipboardExpand all lines: jekyll/_cci2/using-orbs.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -232,4 +232,4 @@ If the case arises where you need to delete an orb for emergency reasons, please
232
232
233
233
- Refer to [Orb Introduction]({{site.baseurl}}/2.0/orb-intro/), for a high-level overview of using and authoring orbs.
234
234
- Refer to [Orbs Reference]({{site.baseurl}}/2.0/reusing-config/) for more detailed examples of reusable orbs, commands, parameters, and executors.
235
-
- Refer to [Configuration Cookbook]({{site.baseurl}}/2.0/configuration-cookbook/) for more detailed information about how you can use CircleCI orb recipes in your configurations.
235
+
- Refer to [Configuration Cookbook]({{site.baseurl}}/2.0/configuration-cookbook/#configuration-recipes) for more detailed information about how you can use CircleCI orb recipes in your configurations.
0 commit comments