nx-tools
nx-tools copied to clipboard
How you execute nx-set-shas package?
How do you execute the nx-set-shas package?
I mean you using oclif package to trigger the package from the command line as executable package.
But how do you execute the code in development mode? https://github.com/nx-tools/nx-tools/blob/main/packages/nx-set-shas/src/commands/gitlab/index.ts#L37
Do you need to run build and then execute from the dist folder or you do it with one nx command?
Hi @jon9090 this cli is intended to use in Gitlab CI pipeline, something like this
main:
stage: test
variables:
NX_BRANCH: $CI_COMMIT_BRANCH
before_script:
- apk add --no-cache git
- npm ci --cache .npm --prefer-offline
- npx nx-set-shas gitlab -t $API_TOKEN -o nx.env
- set -a
[ -f nx.env ] && . nx.env
set +a
script:
- npx nx-cloud start-ci-run
- NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx workspace-lint
- NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx format:check
- npx nx affected --target=build --parallel --max-parallel=3 &
- npx nx affected --target=lint --parallel --max-parallel=3 &
- npx nx affected --target=test --parallel --max-parallel=2 --code-coverage &
- wait
after_script:
- npx nx-cloud stop-all-agents
- sleep 5
- echo 'Done!'