From fc8d5ba828118300bf4c4927cdb7578c46b5b355 Mon Sep 17 00:00:00 2001 From: Jonathan Cammisuli Date: Thu, 4 Apr 2024 16:09:35 -0400 Subject: [PATCH] docs(core): update bitbucket ci docs (#22639) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Miroslav Jonaš --- docs/shared/monorepo-ci-bitbucket-pipelines.md | 2 +- .../ci-workflow/__snapshots__/ci-workflow.spec.ts.snap | 4 ++++ .../files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/shared/monorepo-ci-bitbucket-pipelines.md b/docs/shared/monorepo-ci-bitbucket-pipelines.md index 116ff2258c7e6..f645b6209b670 100644 --- a/docs/shared/monorepo-ci-bitbucket-pipelines.md +++ b/docs/shared/monorepo-ci-bitbucket-pipelines.md @@ -27,7 +27,7 @@ pipelines: - step: name: "Build and test affected apps on 'main' branch changes" script: - - export NX_BRANCH=$BITBUCKET_PR_ID + - export NX_BRANCH=$BITBUCKET_BRANCH # This line enables distribution # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested # - npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci" 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 dd9781fc2154e..4955da2ff4a3a 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 @@ -85,6 +85,7 @@ pipelines: - step: name: 'Build and test affected apps on "main" branch changes' script: + - export NX_BRANCH=$BITBUCKET_BRANCH # Connect your workspace on my.nx.app and uncomment this to enable task distribution. # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested # - npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci" @@ -300,6 +301,7 @@ pipelines: - step: name: 'Build and test affected apps on "main" branch changes' script: + - export NX_BRANCH=$BITBUCKET_BRANCH # Connect your workspace on my.nx.app and uncomment this to enable task distribution. # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested # - npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build" @@ -546,6 +548,7 @@ pipelines: - step: name: 'Build and test affected apps on "main" branch changes' script: + - export NX_BRANCH=$BITBUCKET_BRANCH # Connect your workspace on my.nx.app and uncomment this to enable task distribution. # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested # - pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build" @@ -801,6 +804,7 @@ pipelines: - step: name: 'Build and test affected apps on "main" branch changes' script: + - export NX_BRANCH=$BITBUCKET_BRANCH # Connect your workspace on my.nx.app and uncomment this to enable task distribution. # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested # - yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build" 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 826702e0b8be3..32e9449d79156 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__ @@ -28,6 +28,7 @@ pipelines: - step: name: 'Build and test affected apps on "<%= mainBranch %>" branch changes' script: + - export NX_BRANCH=$BITBUCKET_BRANCH # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution. # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"