workflows:
  node-multi-build:
    jobs:
      - ${jobName}: ${jobOptions}

jobs:
  ${jobName}:
    docker:
      - image: '${dockerImage}'
        environment:
          opensearchEndpoint: localhost:9200
      - image: opensearchproject/opensearch:2.13.0
        environment:
          - discovery.type=single-node
          - DISABLE_SECURITY_PLUGIN=true
    <<<:
      - steps:
          - run:
              command: >
                until $(curl --output /dev/null --silent --head --fail
                http://localhost:9200); do
                    sleep 5
                done
      - ${file(^/meta/yarn-setup.yml)}
      - steps:
          - run: yarn test
          - run: (git add . && git diff-index --quiet HEAD --) || (git status && exit 1);
