fix(nx-cloud): ensure generated ci workflows use dlx for nx-cloud (#23333)
This commit is contained in:
parent
4f316085d8
commit
8cda56ed36
@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"root": true,
|
|
||||||
"ignorePatterns": ["**/*"],
|
|
||||||
"plugins": ["@nx"],
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
||||||
"rules": {
|
|
||||||
"@nx/enforce-module-boundaries": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"enforceBuildableLibDependency": true,
|
|
||||||
"allow": [],
|
|
||||||
"depConstraints": [
|
|
||||||
{
|
|
||||||
"sourceTag": "*",
|
|
||||||
"onlyDependOnLibsWithTags": ["*"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["*.ts", "*.tsx"],
|
|
||||||
"extends": ["plugin:@nx/typescript"],
|
|
||||||
"rules": {}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["*.js", "*.jsx"],
|
|
||||||
"extends": ["plugin:@nx/javascript"],
|
|
||||||
"rules": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": ["../../.eslintrc.base.json"],
|
"extends": ["../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*"],
|
"ignorePatterns": ["!**/*"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -502,7 +502,7 @@ jobs:
|
|||||||
|
|
||||||
# Connect your workspace on nx.app and uncomment this to enable task distribution.
|
# Connect your workspace on 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
|
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||||
# - script: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
# - script: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||||
|
|
||||||
- script: pnpm install --frozen-lockfile
|
- script: pnpm install --frozen-lockfile
|
||||||
- script: git branch --track main origin/main
|
- script: git branch --track main origin/main
|
||||||
@ -532,7 +532,7 @@ pipelines:
|
|||||||
|
|
||||||
# Connect your workspace on nx.app and uncomment this to enable task distribution.
|
# Connect your workspace on 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
|
# 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"
|
# - pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||||
|
|
||||||
- pnpm install --frozen-lockfile
|
- pnpm install --frozen-lockfile
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ pipelines:
|
|||||||
- export NX_BRANCH=$BITBUCKET_BRANCH
|
- export NX_BRANCH=$BITBUCKET_BRANCH
|
||||||
# Connect your workspace on nx.app and uncomment this to enable task distribution.
|
# Connect your workspace on 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
|
# 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"
|
# - pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||||
|
|
||||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||||
|
|
||||||
@ -578,7 +578,7 @@ jobs:
|
|||||||
|
|
||||||
# Connect your workspace on nx.app and uncomment this to enable task distribution.
|
# Connect your workspace on 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
|
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||||
# - run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
# - run: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||||
|
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
- nx/set-shas:
|
- nx/set-shas:
|
||||||
@ -624,7 +624,7 @@ jobs:
|
|||||||
|
|
||||||
# Connect your workspace on nx.app and uncomment this to enable task distribution.
|
# Connect your workspace on 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
|
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||||
# - run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
# - run: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||||
|
|
||||||
# Cache node_modules
|
# Cache node_modules
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
@ -667,7 +667,7 @@ jobs:
|
|||||||
|
|
||||||
# Connect your workspace on nx.app and uncomment this to enable task distribution.
|
# Connect your workspace on 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
|
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||||
# - run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
# - run: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||||
|
|
||||||
# Cache node_modules
|
# Cache node_modules
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
@ -699,7 +699,7 @@ CI:
|
|||||||
|
|
||||||
# Connect your workspace on nx.app and uncomment this to enable task distribution.
|
# Connect your workspace on 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
|
# 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"
|
# - pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||||
|
|
||||||
- pnpm install --frozen-lockfile
|
- pnpm install --frozen-lockfile
|
||||||
- NX_HEAD=$CI_COMMIT_SHA
|
- NX_HEAD=$CI_COMMIT_SHA
|
||||||
|
|||||||
@ -38,6 +38,7 @@ interface Substitutes {
|
|||||||
packageManager: string;
|
packageManager: string;
|
||||||
packageManagerInstall: string;
|
packageManagerInstall: string;
|
||||||
packageManagerPrefix: string;
|
packageManagerPrefix: string;
|
||||||
|
packageManagerPreInstallPrefix: string;
|
||||||
nxCloudHost: string;
|
nxCloudHost: string;
|
||||||
hasE2E: boolean;
|
hasE2E: boolean;
|
||||||
tmpl: '';
|
tmpl: '';
|
||||||
@ -48,8 +49,11 @@ function normalizeOptions(options: Schema, tree: Tree): Substitutes {
|
|||||||
options.name
|
options.name
|
||||||
);
|
);
|
||||||
const packageManager = detectPackageManager();
|
const packageManager = detectPackageManager();
|
||||||
const { exec: packageManagerPrefix, ciInstall: packageManagerInstall } =
|
const {
|
||||||
getPackageManagerCommand(packageManager);
|
exec: packageManagerPrefix,
|
||||||
|
ciInstall: packageManagerInstall,
|
||||||
|
dlx: packageManagerPreInstallPrefix,
|
||||||
|
} = getPackageManagerCommand(packageManager);
|
||||||
|
|
||||||
let nxCloudHost: string = 'nx.app';
|
let nxCloudHost: string = 'nx.app';
|
||||||
try {
|
try {
|
||||||
@ -72,6 +76,7 @@ function normalizeOptions(options: Schema, tree: Tree): Substitutes {
|
|||||||
packageManager,
|
packageManager,
|
||||||
packageManagerInstall,
|
packageManagerInstall,
|
||||||
packageManagerPrefix,
|
packageManagerPrefix,
|
||||||
|
packageManagerPreInstallPrefix,
|
||||||
mainBranch: deduceDefaultBase(),
|
mainBranch: deduceDefaultBase(),
|
||||||
hasE2E,
|
hasE2E,
|
||||||
nxCloudHost,
|
nxCloudHost,
|
||||||
|
|||||||
@ -48,7 +48,7 @@ jobs:
|
|||||||
<% } %>
|
<% } %>
|
||||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
# 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
|
# 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
|
||||||
# - script: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
# - script: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||||
|
|
||||||
- script: <%= packageManagerInstall %>
|
- script: <%= packageManagerInstall %>
|
||||||
- script: git branch --track <%= mainBranch %> origin/<%= mainBranch %>
|
- script: git branch --track <%= mainBranch %> origin/<%= mainBranch %>
|
||||||
|
|||||||
@ -17,7 +17,7 @@ pipelines:
|
|||||||
<% } %>
|
<% } %>
|
||||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
# 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
|
# 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<% } %>"
|
# - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||||
|
|
||||||
- <%= packageManagerInstall %>
|
- <%= packageManagerInstall %>
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ pipelines:
|
|||||||
- export NX_BRANCH=$BITBUCKET_BRANCH
|
- export NX_BRANCH=$BITBUCKET_BRANCH
|
||||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
# 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
|
# 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<% } %>"
|
# - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||||
|
|
||||||
<% if(packageManager == 'pnpm'){ %>
|
<% if(packageManager == 'pnpm'){ %>
|
||||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||||
|
|||||||
@ -17,7 +17,7 @@ jobs:
|
|||||||
|
|
||||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
# 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
|
# 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
|
||||||
# - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
# - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||||
|
|
||||||
- run: <%= packageManagerInstall %>
|
- run: <%= packageManagerInstall %>
|
||||||
- nx/set-shas:
|
- nx/set-shas:
|
||||||
|
|||||||
@ -25,7 +25,7 @@ jobs:
|
|||||||
|
|
||||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
# 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
|
# 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
|
||||||
# - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
# - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||||
|
|
||||||
# Cache node_modules
|
# Cache node_modules
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
|
|||||||
@ -14,7 +14,7 @@ variables:
|
|||||||
<% } %>
|
<% } %>
|
||||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
# 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
|
# 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<% } %>"
|
# - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||||
|
|
||||||
- <%= packageManagerInstall %>
|
- <%= packageManagerInstall %>
|
||||||
- NX_HEAD=$CI_COMMIT_SHA
|
- NX_HEAD=$CI_COMMIT_SHA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user