yaml
version: 2.1
jobs:
  build:
    docker:
      - image: cimg/node:lts # select appropriate runtime for pipeline
    // highlight-start
    environment: # for GitHub, GitLab, BitBucket only
      CIRCLE_PIPELINE_NUMBER: << pipeline.number >> # for GitHub, GitLab, BitBucket only
      CIRCLE_PIPELINE_TRIGGER_LOGIN: << pipeline.trigger_parameters.gitlab.user_username >> # for GitLab only
      CIRCLE_PIPELINE_REPO_URL: << pipeline.trigger_parameters.gitlab.repo_url >> # for GitLab only
      CIRCLE_PIPELINE_REPO_FULL_NAME: << pipeline.trigger_parameters.gitlab.repo_name >> # for GitLab only
    // highlight-end
    steps:
      - checkout
      - setup_remote_docker
      - run:
          name: Install deps
          command: npm ci
      - run:
          name: Install Dagger CLI
         command: cd /usr/local && { curl -L https://dl.dagger.io/dagger/install.sh | sh; cd -; }
      - run:
          name: Run Dagger pipeline
          command: dagger run node index.mjs
      # for ephemeral runners only: override the default docker stop timeout and
      # give the Dagger Engine more time to push cache data to Dagger Cloud
      // highlight-start
      - run:
          name: Stop Dagger Engine
          command: docker stop -t 300 $(docker ps --filter name="dagger-engine-*" -q)
          when: always
workflows:
      // highlight-end
  dagger:
    jobs:
      - build
