substitutions:
  _NPM_CLI_PACKAGE: "lerna"
  _NODE_IMAGE: "node"
  _NODE_TAG: "lts"

steps:
  - name: gcr.io/cloud-builders/docker
    args:
      - "build"
      - "--build-arg"
      - "NPM_CLI_PACKAGE=${_NPM_CLI_PACKAGE}"
      - "--build-arg"
      - "NODE_IMAGE=${_NODE_IMAGE}"
      - "--build-arg"
      - "NODE_TAG=${_NODE_TAG}"
      - "-t"
      - "gcr.io/$PROJECT_ID/${_NPM_CLI_PACKAGE}"
      - "-t"
      - "gcr.io/$PROJECT_ID/${_NPM_CLI_PACKAGE}:${_NODE_IMAGE}-${_NODE_TAG}"
      - "."

images:
  - "gcr.io/$PROJECT_ID/${_NPM_CLI_PACKAGE}"
  - "gcr.io/$PROJECT_ID/${_NPM_CLI_PACKAGE}:${_NODE_IMAGE}-${_NODE_TAG}"

tags: ["cloud-builders-community"]
