8000 Merge pull request #3642 from circleci/michelle-luna-patch-5 · adicoderanger/circleci-docs@9664795 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9664795

Browse files
Merge pull request circleci#3642 from circleci/michelle-luna-patch-5
Michelle luna patch 5
2 parents 3740290 + 6d8ffdf commit 9664795

File tree

1 file changed

+63
-34
lines changed

1 file changed

+63
-34
lines changed

jekyll/_cci2/hello-world.md

Lines changed: 63 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,89 @@ categories: [getting-started]
77
order: 4
88
---
99

10-
This document describes how to get started with a basic build of your Linux, Android, or macOS project on CircleCI 2.x after you [sign up]({{ site.baseurl }}/2.0/first-steps/).
10+
This document describes how to get started with a basic build of your Linux, Android, Windows, or macOS project on CircleCI 2.x after you [sign up]({{ site.baseurl }}/2.0/first-steps/).
1111

12-
## Use the Hello-Build Orb
12+
## Echo Hello World on Linux
13+
14+
This example adds a job called `build` that spins up a container running a the [pre-built CircleCI Docker image for Node]({{ site.baseurl }}/2.0/circleci-images/#nodejs). Then, it runs a simple `echo` command. To get started, complete the following steps:
1315

1416
1. Create a directory called `.circleci` in the root directory of your local GitHub or Bitbucket code repository.
1517

16-
2. Add a [`config.yml`]({{ site.baseurl }}/2.0/configuration-reference/) file in the `.circleci` directory with the following lines that import the [`hello-build` orb](https://circleci.com/orbs/registry/orb/circleci/hello-build).
18+
1. Create a [`config.yml`]({{ site.baseurl }}/2.0/configuration-reference/) file with the following lines:
1719

18-
```yaml
19-
version: 2.1
20+
```yaml
21+
version: 2
22+
jobs:
23+
10000 build-linux:
24+
docker: # use the docker executor type; machine and macos executors are also supported
25+
- image: circleci/node:4.8.2 # the primary container, where your job's commands are run
26+
steps:
27+
- checkout # check out the code in the project directory
28+
- run: echo "hello world" # run the `echo` command
29+
```
2030
21-
orbs:
22-
hello: circleci/hello-build@0.0.7 # uses the circleci/buildpack-deps Docker image
31+
1. Commit and push the changes.
32+
33+
1. Go to the Projects page in the CircleCI app, click the **Add Projects** button, then click
34+
the **Set Up Project** button next to your project. If you don't see your project, make sure you have selected the associated Org. See the Org Switching section below for tips.
35+
36+
3. Click the **Start Building** button to trigger your first build.
37+
38+
The Workflows page appears with your `build` job and prints `Hello World` to the console.
39+
40+
**Note:** If you get a `No Config Found` error, it may be that you used `.yaml` file extension. Be sure to use `.yml` file extension to resolve this error.
41+
42+
CircleCI runs each [job]({{site.baseurl}}/2.0/glossary/#job) in a separate [container]({{site.baseurl}}/2.0/glossary/#container) or VM. That is, each time your job runs, CircleCI spins up a container or VM to run the job in.
43+
44+
Refer to the [Node.js - JavaScript Tutorial]({{site.baseurl}}/2.0/language-javascript/) for a sample project.
45+
46+
## Hello World for Android
47+
48+
Using the basic ideas from the Linux example above, you can add a job that uses the `docker` executor with a pre-built Android image in the same `config.yml` file as follows:
2349

24-
workflows:
25-
"Hello Workflow":
26-
jobs:
27-
- hello/hello-build
2850
```
51+
jobs:
52+
build-android:
53+
docker:
54+
- image: circleci/android:api-25-alpha
55+
```
56+
57+
See the [Android Language Guide]({{site.baseurl}}/2.0/language-android/) for details and a sample project.
58+
59+
## Hello World for macOS
60+
61+
Using the basics from the Linux and Android examples above, you can add a job that uses the `macos` executor and a supported version of Xcode as follows:
62+< 8000 /span>
63+
```
64+
jobs: # a basic unit of work in a run
65+
build-macos: # runs not using `Workflows` must have a `build` job as entry point
66+
macos: # indicate that we are using the macOS executor
67+
xcode: "10.0.0" # indicate our selected version of Xcode
68+
```
2969
30-
Commit and push the changes to trigger a build. If this is your first project on
31-
CircleCI, go to the Projects page, click the **Add Projects** button, then click
32-
the **Set Up Project** button next to your project. You may also click **Start
33-
Building** to manually trigger your first build.
70+
Refer to the [Hello World on MacOS]({{site.baseurl}}/2.0/hello-world-macos) document for more information and a sample project.
3471
35-
## Echo Hello World with a `build` Job
72+
## Hello World for Windows
3673
37-
Add a job called `build` that uses the Docker executor to spin up a Node container and runs a simple `echo` command:
74+
Using the basics from the Linux, Android, and macOS examples above, you can add a job that uses the `win/vs2019` executor (Windows Server 2019) by adding the `orb:` key in the same `.circleci/config.yml` file as follows:
3875

39-
1. Add following lines to your `.circleci/config.yml` file. For Docker executors, replace `node:4.8.2` with any [Docker image]({{ site.baseurl }}/2.0/circleci-images/) you want:
76+
```
77+
orbs:
78+
win: circleci/windows@1.0.0
4079

41-
```yaml
42-
version: 2
4380
jobs:
4481
build:
45-
docker: # use the docker executor type; machine and macos executors are also supported
46-
- image: circleci/node:4.8.2 # the primary container, where your job's commands are run
82+
executor: win/vs2019
4783
steps:
48-
- checkout # check out the code in the project directory
49-
- run: echo "hello world" # run the `echo` command
84+
- checkout
85+
- run: Write-Host 'Hello, Windows'
5086
```
5187
52-
CircleCI runs each [job]({{site.baseurl}}/2.0/glossary/#job) in a separate [container]({{site.baseurl}}/2.0/glossary/#container) or VM. That is, each time your job runs, CircleCI spins up a container or VM to run the job in.
53-
54-
**Note**: For `macos` and `windows` executors, some setup is different. Please refer to our [Hello World on Windows]({{site.baseurl}}/2.0/hello-world-windows) and [Hello World on MacOS]({{site.baseurl}}/2.0/hello-world-macos) documents for more information.
55-
56-
Commit and push the changes to trigger a build. If this is your first project on
57-
CircleCI, go to the Projects page, click the **Add Projects** button, then click
58-
the **Set Up Project** button next to your project. You may also click **Start
59-
Building** to manually trigger your first build.
88+
**Note**: For Windows builds, some setup and prerequisites are different. Please refer to our [Hello World on Windows]({{site.baseurl}}/2.0/hello-world-windows).
6089
61-
CircleCI checks out your code, prints "Hello World", and posts a green build to the Job page, adding a green checkmark on your commit in GitHub or Bitbucket.
90+
### More About Using and Authoring Orbs
6291
63-
**Note:** If you get a `No Config Found` error, it may be that you used `.yaml` file extension. Be sure to use `.yml` file extension to resolve this error.
92+
Orbs are a great way to simplify your config or re-use config across your projects, by referencing packages of config in the [CircleCI Orbs Registry](https://circleci.com/orbs/registry).
6493
6594
## Following Projects
6695

0 commit comments

Comments
 (0)
0