Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(nx-cloud): update onboarding flow to use "nx connect" #26842

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 22 additions & 33 deletions docs/generated/manifests/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
"path": "/ci/intro/why-nx-cloud",
"tags": []
},
{
"id": "connect-to-cloud",
"name": "Connect Nx Cloud",
"description": "",
"mediaImage": "",
"file": "nx-cloud/intro/connect-to-cloud",
"itemList": [],
"isExternal": false,
"path": "/ci/intro/connect-to-cloud",
"tags": []
},
{
"id": "tutorials",
"name": "Tutorials",
Expand Down Expand Up @@ -89,6 +100,17 @@
"path": "/ci/intro/why-nx-cloud",
"tags": []
},
"/ci/intro/connect-to-cloud": {
"id": "connect-to-cloud",
"name": "Connect Nx Cloud",
"description": "",
"mediaImage": "",
"file": "nx-cloud/intro/connect-to-cloud",
"itemList": [],
"isExternal": false,
"path": "/ci/intro/connect-to-cloud",
"tags": []
},
"/ci/intro/tutorials": {
"id": "tutorials",
"name": "Tutorials",
Expand Down Expand Up @@ -403,17 +425,6 @@
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "connect-to-cloud",
"name": "Connect Nx Cloud",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/connect-to-cloud",
"itemList": [],
"isExternal": false,
"path": "/ci/recipes/set-up/connect-to-cloud",
"tags": []
},
{
"id": "monorepo-ci-azure",
"name": "Setting up Azure Pipelines",
Expand Down Expand Up @@ -844,17 +855,6 @@
"mediaImage": "",
"file": "",
"itemList": [
{
"id": "connect-to-cloud",
"name": "Connect Nx Cloud",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/connect-to-cloud",
"itemList": [],
"isExternal": false,
"path": "/ci/recipes/set-up/connect-to-cloud",
"tags": []
},
{
"id": "monorepo-ci-azure",
"name": "Setting up Azure Pipelines",
Expand Down Expand Up @@ -926,17 +926,6 @@
"path": "/ci/recipes/set-up",
"tags": ["distribute-task-execution"]
},
"/ci/recipes/set-up/connect-to-cloud": {
"id": "connect-to-cloud",
"name": "Connect Nx Cloud",
"description": "",
"mediaImage": "",
"file": "nx-cloud/recipes/connect-to-cloud",
"itemList": [],
"isExternal": false,
"path": "/ci/recipes/set-up/connect-to-cloud",
"tags": []
},
"/ci/recipes/set-up/monorepo-ci-azure": {
"id": "monorepo-ci-azure",
"name": "Setting up Azure Pipelines",
Expand Down
40 changes: 16 additions & 24 deletions docs/generated/manifests/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -5169,6 +5169,14 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Connect Nx Cloud",
"path": "/ci/intro/connect-to-cloud",
"id": "connect-to-cloud",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Tutorials",
"path": "/ci/intro/tutorials",
Expand Down Expand Up @@ -5213,6 +5221,14 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Connect Nx Cloud",
"path": "/ci/intro/connect-to-cloud",
"id": "connect-to-cloud",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Tutorials",
"path": "/ci/intro/tutorials",
Expand Down Expand Up @@ -5444,14 +5460,6 @@
"id": "set-up",
"isExternal": false,
"children": [
{
"name": "Connect Nx Cloud",
"path": "/ci/recipes/set-up/connect-to-cloud",
"id": "connect-to-cloud",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Setting up Azure Pipelines",
"path": "/ci/recipes/set-up/monorepo-ci-azure",
Expand Down Expand Up @@ -5766,14 +5774,6 @@
"id": "set-up",
"isExternal": false,
"children": [
{
"name": "Connect Nx Cloud",
"path": "/ci/recipes/set-up/connect-to-cloud",
"id": "connect-to-cloud",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Setting up Azure Pipelines",
"path": "/ci/recipes/set-up/monorepo-ci-azure",
Expand Down Expand Up @@ -5825,14 +5825,6 @@
],
"disableCollapsible": false
},
{
"name": "Connect Nx Cloud",
"path": "/ci/recipes/set-up/connect-to-cloud",
"id": "connect-to-cloud",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Setting up Azure Pipelines",
"path": "/ci/recipes/set-up/monorepo-ci-azure",
Expand Down
10 changes: 5 additions & 5 deletions docs/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,11 @@
"id": "why-nx-cloud",
"file": "nx-cloud/intro/why-nx-cloud"
},
{
"name": "Connect Nx Cloud",
"id": "connect-to-cloud",
"file": "nx-cloud/intro/connect-to-cloud"
},
{
"name": "Tutorials",
"id": "tutorials",
Expand Down Expand Up @@ -1674,11 +1679,6 @@
"description": "Learn how to set up Nx Cloud for your workspace.",
"tags": ["distribute-task-execution"],
"itemList": [
{
"name": "Connect Nx Cloud",
"id": "connect-to-cloud",
"file": "nx-cloud/recipes/connect-to-cloud"
},
{
"name": "Setting up Azure Pipelines",
"id": "monorepo-ci-azure",
Expand Down
4 changes: 4 additions & 0 deletions docs/nx-cloud/intro/ci-with-nx.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Implementing an efficient CI setup for monorepos - while crucial - can be challe

[Create an account on Nx Cloud](https://cloud.nx.app) and connect your repository.

```shell
npx nx connect
```

## Learn about Nx on CI

{% cards cols="2" lgCols="4" mdCols="4" smCols="2" %}
Expand Down
44 changes: 44 additions & 0 deletions docs/nx-cloud/intro/connect-to-cloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Connect to Nx Cloud

Nx Cloud directly integrates with your existing CI setup.

![Nx Cloud Overview](/shared/images/nx-cloud/nx-cloud-overview.webp)

In a nutshell, here's how this works:

**Step 1: Connect your workspace to Nx Cloud**

This can be done by signing up on [nx.app](https://nx.app) and then connecting to your git repository.

```shell
npx nx connect
```

**Step 2: Your CI script triggers Nx Cloud**

```yml
- name: Start CI run
run: 'npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js"'
```

Let us generate the workflow file for you, if you don't already have one.

```shell
npx nx g ci-workflow
```

Or, check out our [recipes for the various CI providers](/ci/recipes/set-up).

**Step 3: Run your Nx commands as usual**

```yml
- run: npx nx-cloud record -- nx format:check
- run: npx nx affected -t lint test build
- run: npx nx affected -t e2e-ci --parallel 1
```

All these commands are automatically picked up by Nx Cloud, split up into smaller tasks and distributed across the specified number of machines.

**Step 4: All results are played back automatically**

Nx Cloud automatically plays back all results to your CI system, as if distribution never happened. You can continue doing post-processing on the results, like uploading test reports, deploying artifacts etc.
34 changes: 2 additions & 32 deletions docs/nx-cloud/intro/why-nx-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,9 @@ All this is possible because Nx Cloud directly integrates with Nx and has knowle

Read more about individual features of Nx Cloud in the [features section](/ci/features).

## How does Nx Cloud integrate into my existing CI setup
## Integrate Nx Cloud into my CI setup

Nx Cloud directly integrates with your existing CI setup.

![Nx Cloud Overview](/shared/images/nx-cloud/nx-cloud-overview.webp)

In a nutshell, here's how this works:

**Step 1: Connect your workspace to Nx Cloud**

This can be done by signing up on [nx.app](https://nx.app) and then connecting to your git repository. Read more about all the details [on this doc page](/ci/recipes/set-up/connect-to-cloud).

**Step 2: Your CI script triggers Nx Cloud**

```yml
- name: Start CI run
run: 'npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js"'
```

Check out our [recipes for the various CI providers](/ci/recipes/set-up).

**Step 3: Run your Nx command as usual**

```yml
- run: npx nx-cloud record -- nx format:check
- run: npx nx affected -t lint test build e2e-ci
```

All these commands are automatically picked up by Nx Cloud, split up into smaller tasks and distributed across the specified number of machines.

**Step 4: All results are played back automatically**

Nx Cloud automatically plays back all results to your CI system, as if distribution never happened. You can continue doing post-processing on the results, like uploading test reports, deploying artifacts etc.
Ready to experience fast CI? Read the [connect to Nx Cloud](/ci/intro/connect-to-cloud) page for more details.

## Learn more

Expand Down
33 changes: 0 additions & 33 deletions docs/nx-cloud/recipes/connect-to-cloud.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/shared/features/remote-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In this diagram, Teika runs the build once on his machine, then CI, Kimiko and J

## Setting Up Nx Cloud

To use **Nx Replay** you need to connect your workspace to Nx Cloud. See the [connect to Nx Cloud recipe](/ci/recipes/set-up/connect-to-cloud).
To use **Nx Replay** you need to connect your workspace to Nx Cloud. See the [connect to Nx Cloud recipe](/ci/intro/connect-to-cloud).

## See Remote Caching in Action

Expand Down
2 changes: 1 addition & 1 deletion docs/shared/reference/sitemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
- [Intro](/ci/intro)
- [CI with Nx](/ci/intro/ci-with-nx)
- [Why Nx Cloud?](/ci/intro/why-nx-cloud)
- [Connect Nx Cloud](/ci/intro/connect-to-cloud)
- [Tutorials](/ci/intro/tutorials)
- [Circle CI with Nx](/ci/intro/tutorials/circle)
- [GitHub Actions with Nx](/ci/intro/tutorials/github-actions)
Expand All @@ -263,7 +264,6 @@
- [Cache Security](/ci/concepts/cache-security)
- [Recipes](/ci/recipes)
- [Set Up CI](/ci/recipes/set-up)
- [Connect Nx Cloud](/ci/recipes/set-up/connect-to-cloud)
- [Setting up Azure Pipelines](/ci/recipes/set-up/monorepo-ci-azure)
- [Setting up CircleCI](/ci/recipes/set-up/monorepo-ci-circle-ci)
- [Setting up GitHub Actions](/ci/recipes/set-up/monorepo-ci-github-actions)
Expand Down
1 change: 1 addition & 0 deletions nx-dev/nx-dev/redirect-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ const nxCloudUrls = {
'/ci/concepts/parallelization-distribution',
'/nx-cloud/:path*': '/ci/:path*',
'/core-features/:path*': '/features/:path*',
'/ci/recipes/set-up/connect-to-cloud': '/ci/intro/connect-to-cloud',
};

/**
Expand Down