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/api-job-trigger.md
+10-9Lines changed: 10 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -45,15 +45,16 @@ and refers to the name of your branch.
45
45
For a complete reference of the API,
46
46
see the [CircleCI API Documentation]({{ site.baseurl }}/api/v1-reference/).
47
47
48
-
**Note:**
49
-
It is possible to trigger [workflows]({{ site.baseurl }}/2.0/workflows/) with the CircleCI API, using a new endpoint, see the Trigger a Build by Project section of the [CircleCI API Projects Documentation]({{ site.baseurl }}/api/v1-reference/#new-project-build).
50
-
51
-
Jobs triggered with the API may contain a `workflows` section.
52
-
These workflows do **not** have to reference the job
53
-
you trigger with the API.
54
-
Jobs triggered with the API do **not** have access to environment variables
55
-
created for [a CircleCI Context]({{ site.baseurl }}/2.0/contexts/).
56
-
Instead, define these variables at the [Project level]({{ site.baseurl }}/2.0/env-vars/#setting-an-environment-variable-in-a-project).
48
+
**Import Considerations When Triggering A Job Via The API**
49
+
50
+
- Jobs triggered with the API may contain a `workflows` section
51
+
- Your workflow does **not** have to reference the job you triggered with the API
52
+
- Jobs that are triggered via the API do **not** have access to environment
53
+
variables created for [a CircleCI Context]({{ site.baseurl }}/2.0/contexts/)
54
+
- If you wish to use environment variables they have to be defined at the [Project level]({{ site.baseurl }}/2.0/env-vars/#setting-an-environment-variable-in-a-project)
55
+
- It is currently not possible to trigger a single job if you are using CircleCI 2.1 and Workflows
56
+
- It is possible to trigger [workflows]({{ site.baseurl }}/2.0/workflows/) with the CircleCI API, using the [Trigger a Build by Project]({{ site.baseurl}}/api/v1-reference/#new-project-build) endpoint
Copy file name to clipboardExpand all lines: jekyll/_cci2/config-intro.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -50,9 +50,9 @@ The CircleCI config syntax is very straight forward. The trickiest part is typi
50
50
51
51
- Line 1: This indicates the version of the CircleCI platform you are using. 2.0 is the most recent version.
52
52
- Line 2-3: The `jobs` level contains a collection of arbitrarily named children. `build` is the first named child in the `jobs` collection. In this case `build` is also the only job.
53
-
- Line 4-5: The `steps` collection is an ordered list of `run` directives. Each `run` directive is executed in the order in which it was declared.
54
-
- Line 6: The `name` attribute provides useful organizational information when returning warnings, errors, and output. The `name` should be meaningful to you as an action within your build process
55
-
- Line 7-9: This is the magic. The `command` attribute is a list of shell commands that represent the work you want done. The initial pipe, `|`, indicates that there will be more than one line of shell commands. Here line 8 will print out `Hello World` in your build shell and line 9 will print out `I’m the new delivery pipeline`
53
+
- Line 6-7: The `steps` collection is an ordered list of `run` directives. Each `run` directive is executed in the order in which it was declared.
54
+
- Line 8: The `name` attribute provides useful organizational information when returning warnings, errors, and output. The `name` should be meaningful to you as an action within your build process
55
+
- Line 9-11: This is the magic. The `command` attribute is a list of shell commands that represent the work you want done. The initial pipe, `|`, indicates that there will be more than one line of shell commands. Here line 10 will print out `Hello World!` in your build shell and line 11 will print out `This is the delivery pipeline`
56
56
57
57
## Part Two: Info and Preparing to Build
58
58
That was nice but let’s get real. Delivery graphs start with code. In this example we will add a few lines that will get your code and then list it. We will also do this in a second run.
@@ -131,11 +131,11 @@ The above two changes to the config significantly affect how you get work done.
131
131
132
132
- Line 4: Here we see a comment in-line in yml. Like any other unit of code, comments are a useful tool as config gets complicated.
133
133
- Line 5-6: These lines indicate that docker image to use for the job. Because you can have more than one job in your config (as we will see next) you can also run different parts of your config in different environments. For example, you could perform a build job in a thin java container and then perform a test job using a container with browsers pre-installed. In this case, it uses a [pre-built container from CircleCI]({{ site.baseurl }}/2.0/circleci-images/) that already has a browser and other useful tools built in.
134
-
- Line 9-12: These lines add a run step that returns the version of node available in the container. Try experimenting with different containers from CircleCI’s pre-built convenience images or even public containers from Docker hub.
134
+
- Line 19-22: These lines add a run step that returns the version of node available in the container. Try experimenting with different containers from CircleCI’s pre-built convenience images or even public containers from Docker hub.
135
135
136
136
## Part Four: Approved to Start
137
137
So far so good? Let’s spend a moment on orchestration. In this example, we will spend more time doing analysis than step-by-step modification.
138
-
The CircleCI workflow model is based on the orchestration of predecessor jobs. This is why the reserved word used for workflow definition is `requires.` Jobs initiation is always defined in terms of the successful completion of prior jobs. For example, a job vector such as [A, B, C] would be implemented with jobs B and C each requiring the job prior. Job A would not have a requires block because it starts immediately. For example, job A starts immediately; B requires A; C requires B.
138
+
The CircleCI workflow model is based on the orchestration of predecessor jobs. This is why the reserved word used for workflow definition is `requires`. Jobs initiation is always defined in terms of the successful completion of prior jobs. For example, a job vector such as [A, B, C] would be implemented with jobs B and C each requiring the job prior. Job A would not have a requires block because it starts immediately. For example, job A starts immediately; B requires A; C requires B.
139
139
140
140
In the example below, an event triggering a build will cause `Hello-World` to start immediately. The remainder of the jobs will wait. When `Hello-World` completes, both `I-Have-Code` and `Run-With-Node` will start. That is because both `I-Have-Code` and `Run-With-Node` require `Hello-World` to complete successfully before they can start. Next, the approval job called `Hold-For-Approval` will become available when both `I-Have-Code` and `Run-With-Node` complete. The `Hold-For-Approval` job is slightly different from the others. It represents a manual intervention to allow the workflow to continue. While the workflow is waiting for a user (through the CircleCI UI or API) to approve the job, all state is preserved based on the original triggering event. CircleCI understands that Approval jobs may take hours or even days before completing - although we suggest hours over days. Once `Hold-For-Approval` completes through a manual intervention, the final job `Now-Complete` will run.
141
141
@@ -211,8 +211,8 @@ We now know how to create a workflow including a manual gate that you can use to
211
211
- Line 12: The commands to get code are now in a job named `I-Have-Code`
212
212
- Line 22: The Node example using the CircleCI pre-built image is now called `Run-With-Node`
213
213
- Line 30: There is an additional job that operates similarly to `Hello-World` but it won’t run until the approval is complete - see line 57 in the workflow stanza.
214
-
- Line 39-57: The config now has a workflow. In the prior examples the CircleCI engine interpreted the config as having had a single-job workflow. Here we are staying clear and spelling out the workflow we want to execute. This workflow demonstrates several useful capabilities. The `requires` statement represents a list of prior jobs that must complete successfully prior to the job in question starting. In this example, both `I-Have-Code` and `Run-With-Node` must complete before `Hold-For-Approval` becomes active. In addition, both `I-Have-Code` and `Run-With-Node` are dependent on `Hello-World` but not on each other. . This means that those two jobs will run in parallel as soon as `Hello-World` is complete. This is useful if you have multiple jobs that are not directly dependent on one another and you want to improve wall-clock time.
215
-
- Line 50-51: Most of the jobs are generic. However, this job has a type. In this case the type is `Approval` and requires a person through the CircleCI API or UI to take an action for the build to complete. Interleaving Approval jobs allows you to create gates that must be approved or managed prior to downstream jobs executing.
214
+
- Line 39-57: The config now has a workflow. In the prior examples the CircleCI engine interpreted the config as having had a single-job workflow. Here we are staying clear and spelling out the workflow we want to execute. This workflow demonstrates several useful capabilities. The `requires` statement represents a list of prior jobs that must complete successfully prior to the job in question starting. In this example, both `I-Have-Code` and `Run-With-Node` must complete before `Hold-For-Approval` becomes active. In addition, both `I-Have-Code` and `Run-With-Node` are dependent on `Hello-World` but not on each other. This means that those two jobs will run in parallel as soon as `Hello-World` is complete. This is useful if you have multiple jobs that are not directly dependent on one another and you want to improve wall-clock time.
215
+
- Line 50-51: Most of the jobs are generic. However, this job has a type. In this case the type is `approval` and requires a person through the CircleCI API or UI to take an action for the build to complete. Interleaving approval jobs allows you to create gates that must be approved or managed prior to downstream jobs executing.
216
216
217
217
218
218
The examples above were designed to provide a quick starter to the areas of functionality available through CircleCI config. There remains a lot more. Take a look at the rest of the documentation. You will find that scheduled jobs, workspaces, artifacts, and more are all simple variations on the concepts you’ve learned here. Now go forth and automate your CI/CD world!
Copy file name to clipboardExpand all lines: jekyll/_cci2/contexts.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ Environment variables are used according to a specific precedence order, as foll
65
65
2. Environment variables declared with the `environment` key for a `run` step.
66
66
3. Environment variables set with the `environment` key for a job.
67
67
4. Environment variables set with the `environment` key for a container.
68
-
5. Context environment variables (assuming the user has access to the Context). See the [Contexts]( {{ site.baseurl }}/2.0/contexts/) documentation for instructions.
68
+
5. Context environment variables (assuming the user has access to the Context).
69
69
6. Project-level environment variables set on the Project Settings page.
70
70
7. Special CircleCI environment variables defined in the [CircleCI Environment Variable Descriptions]({{ site.baseurl }}/2.0/env-vars/#built-in-environment-variables) section of this document.
@@ -509,7 +509,10 @@ The animation shows snippets to give you an overview of the following steps for
509
509
2. Running `circleci config process .circleci/config.yml` to process the config.
510
510
3. Committing the change and checking that the build succeeds in the CircleCI app.
511
511
4. Enabling orbs use under Settings > Security in the CircleCI app.
512
-
5. Running `circleci namespace create ndintenfass` to create a namespace in which to publish to the [CircleCI Orb Registry](https://circleci.com/orbs/registry/).
512
+
5. Running `circleci namespace create ndintenfass github ndintenfass_org` to create
513
+
a namespace in which to publish to the [CircleCI Orb
514
+
Registry](https://circleci.com/orbs/registry/), using Github as a VCS with
515
+
`ndintenfass` as the namespace and `ndintenfass_org` as the org-name. The org-name must exist already as an organization on CircleCI.
513
516
6. Creating and committing an `orb.yml` file in a `.circleci/orbs/orb-utils` directory of the project repo with the content of a reusable executor and the `orb-doc-generation` job.
514
517
7. Running `circleci orb create ndintenfass orb-utils` to create the orb in the namespace.
515
518
8. Running `circleci orb publish dev .circleci/orbs/orb-utils/@orb.yml ndintenfass orb-utils test` to publish the dev:test orb.
Copy file name to clipboardExpand all lines: jekyll/_cci2/workflows.md
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -587,8 +587,6 @@ Go to Settings > Branches in GitHub and click the Edit button on the protected b
587
587
588
588
- For demonstration apps configured with Workflows, see the [CircleCI Demo Workflows](https://github.com/CircleCI-Public/circleci-demo-workflows) on GitHub.
589
589
590
-
- For troubleshooting a workflow with Waiting for Status in GitHub, see [Workflows Waiting for Status in GitHub]({{ site.baseurl }}/2.0/workflows-waiting-status).
0 commit comments