nx-tools icon indicating copy to clipboard operation
nx-tools copied to clipboard

How you execute nx-set-shas package?

Open jon9090 opened this issue 3 years ago • 1 comments

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?

jon9090 avatar Jun 11 '22 11:06 jon9090

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!'

gperdomor avatar Jun 19 '22 01:06 gperdomor