diff --git a/docs/nx-cloud/intro/nx-agents.md b/docs/nx-cloud/intro/nx-agents.md index b3c6cd7662..29ba53a655 100644 --- a/docs/nx-cloud/intro/nx-agents.md +++ b/docs/nx-cloud/intro/nx-agents.md @@ -35,7 +35,7 @@ Enabling task distribution with Nx Agents can be done in a single line. Simply a ```yaml - name: Start CI run - run: 'npx nx-cloud start-ci-run --distributes-on="8 linux-medium-js"' + run: 'npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js"' ... ``` @@ -77,16 +77,16 @@ Here are the [available resource classes](https://nx.app/pricing#resource-classe Instead of defining ``` ---distributes-on="8 linux-medium-js" +--distribute-on="8 linux-medium-js" ``` ...which always runs tasks on the same amount of machines, you can also have Nx Cloud scale the number of agents based on the size of your PR. ```yaml {% fileName=".nx/workflows/dynamic-changesets.yaml" %} -distributes-on: - small-changeset: 1 linux-medium - medium-changeset: 6 linux-medium - large-changeset: 10 linux-medium +distribute-on: + small-changeset: 1 linux-medium-js + medium-changeset: 6 linux-medium-js + large-changeset: 10 linux-medium-js ``` {% callout type="note" title="How is the size of the PR determined?" %} @@ -103,7 +103,7 @@ jobs: ... steps: - checkout - - run: npx nx-cloud start-ci-run --distributes-on=".nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e-wrapper" + - run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e-wrapper" - ... ``` diff --git a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap index f5c1557b7b..d0324ac461 100644 --- a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap +++ b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap @@ -26,7 +26,7 @@ jobs: steps: - script: npm ci # uncomment to enable task distribution - # - script: npx nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - script: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - script: npx nx-cloud record -- nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t=lint,test,build --parallel=3 " @@ -49,7 +49,7 @@ pipelines: - npm ci # uncomment to enable task distribution - # - npx nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - npx nx-cloud record -- nx format:check - npx nx affected -t=lint,test,build --parallel=3 " @@ -71,7 +71,7 @@ jobs: - nx/set-shas: main-branch-name: 'main' # uncomment to enable task distribution - # - run: npx nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: npx nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD -t=lint,test,build --parallel=3 @@ -113,7 +113,7 @@ jobs: - uses: nrwl/nx-set-shas@v4 # uncomment to enable task distribution - # - run: npx nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: npx nx-cloud record -- nx format:check - run: npx nx affected -t=lint,test,build --parallel=3 @@ -149,7 +149,7 @@ jobs: - uses: nrwl/nx-set-shas@v4 # uncomment to enable task distribution - # - run: npx nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: npx nx-cloud record -- nx format:check - run: npx nx affected -t=lint,test,build --parallel=3 @@ -172,7 +172,7 @@ CI: - NX_HEAD=$CI_COMMIT_SHA - NX_BASE=\${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA} # uncomment to enable task distribution - # - npx nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - npx nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD - npx nx affected --base=$NX_BASE --head=$NX_HEAD -t=lint,test,build --parallel=3 " @@ -208,7 +208,7 @@ jobs: displayName: Install PNPM - script: pnpm install --frozen-lockfile # uncomment to enable task distribution - # - script: pnpm exec nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - script: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - script: pnpm exec nx-cloud record -- nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t=lint,test,build --parallel=3 " @@ -233,7 +233,7 @@ pipelines: - pnpm install --frozen-lockfile # uncomment to enable task distribution - # - pnpm exec nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - pnpm exec nx-cloud record -- nx format:check - pnpm exec nx affected -t=lint,test,build --parallel=3 " @@ -259,7 +259,7 @@ jobs: - nx/set-shas: main-branch-name: 'main' # uncomment to enable task distribution - # - run: pnpm exec nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: pnpm exec nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD - run: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD -t=lint,test,build --parallel=3 @@ -305,7 +305,7 @@ jobs: - uses: nrwl/nx-set-shas@v4 # uncomment to enable task distribution - # - run: pnpm exec nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: pnpm exec nx-cloud record -- nx format:check - run: pnpm exec nx affected -t=lint,test,build --parallel=3 @@ -345,7 +345,7 @@ jobs: - uses: nrwl/nx-set-shas@v4 # uncomment to enable task distribution - # - run: pnpm exec nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: pnpm exec nx-cloud record -- nx format:check - run: pnpm exec nx affected -t=lint,test,build --parallel=3 @@ -370,7 +370,7 @@ CI: - NX_HEAD=$CI_COMMIT_SHA - NX_BASE=\${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA} # uncomment to enable task distribution - # - pnpm exec nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - pnpm exec nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD - pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD -t=lint,test,build --parallel=3 " @@ -404,7 +404,7 @@ jobs: steps: - script: yarn install --frozen-lockfile # uncomment to enable task distribution - # - script: yarn nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - script: yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - script: yarn nx-cloud record -- nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) - script: yarn nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t=lint,test,build --parallel=3 " @@ -427,7 +427,7 @@ pipelines: - yarn install --frozen-lockfile # uncomment to enable task distribution - # - yarn nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - yarn nx-cloud record -- nx format:check - yarn nx affected -t=lint,test,build --parallel=3 " @@ -449,7 +449,7 @@ jobs: - nx/set-shas: main-branch-name: 'main' # uncomment to enable task distribution - # - run: yarn nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: yarn nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD - run: yarn nx affected --base=$NX_BASE --head=$NX_HEAD -t=lint,test,build --parallel=3 @@ -491,7 +491,7 @@ jobs: - uses: nrwl/nx-set-shas@v4 # uncomment to enable task distribution - # - run: yarn nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: yarn nx-cloud record -- nx format:check - run: yarn nx affected -t=lint,test,build --parallel=3 @@ -527,7 +527,7 @@ jobs: - uses: nrwl/nx-set-shas@v4 # uncomment to enable task distribution - # - run: yarn nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: yarn nx-cloud record -- nx format:check - run: yarn nx affected -t=lint,test,build --parallel=3 @@ -550,7 +550,7 @@ CI: - NX_HEAD=$CI_COMMIT_SHA - NX_BASE=\${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA} # uncomment to enable task distribution - # - yarn nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - yarn nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD - yarn nx affected --base=$NX_BASE --head=$NX_HEAD -t=lint,test,build --parallel=3 " diff --git a/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ index 6a06f06631..277862358f 100644 --- a/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ @@ -26,6 +26,6 @@ jobs: displayName: Install PNPM <% } %>- script: <%= packageManagerInstall %> # uncomment to enable task distribution - # - script: <%= packageManagerPrefix %> nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - script: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - script: <%= packageManagerPrefix %> nx-cloud record -- nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) - script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t=lint,test,build --parallel=3 diff --git a/packages/workspace/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ index 885c3a19c4..dd0bd385a3 100644 --- a/packages/workspace/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ @@ -16,6 +16,6 @@ pipelines: <% } %> - <%= packageManagerInstall %> # uncomment to enable task distribution - # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - <%= packageManagerPrefix %> nx-cloud record -- nx format:check - <%= packageManagerPrefix %> nx affected -t=lint,test,build --parallel=3 diff --git a/packages/workspace/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ index 949e0e3166..60ab73de87 100644 --- a/packages/workspace/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ @@ -17,7 +17,7 @@ jobs: - nx/set-shas: main-branch-name: '<%= mainBranch %>' # uncomment to enable task distribution - # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: <%= packageManagerPrefix %> nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD - run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t=lint,test,build --parallel=3 diff --git a/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ index 12b5b43d26..fadcd40e19 100644 --- a/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ @@ -30,7 +30,7 @@ jobs: - uses: nrwl/nx-set-shas@v4 # uncomment to enable task distribution - # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - run: <%= packageManagerPrefix %> nx-cloud record -- nx format:check - run: <%= packageManagerPrefix %> nx affected -t=lint,test,build --parallel=3 diff --git a/packages/workspace/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ index 3c004b8841..1807de16c8 100644 --- a/packages/workspace/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ @@ -16,6 +16,6 @@ variables: - NX_HEAD=$CI_COMMIT_SHA - NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA} # uncomment to enable task distribution - # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distributes-on="5 linux-medium" + # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" - <%= packageManagerPrefix %> nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD - <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t=lint,test,build --parallel=3