
pipeline:
  compile:
    image: docker.stackdot.com/lib/node:9.2.0
    commands:
      - npm install


<% if(dockerRepoName != ''){ %>
  # Publish to Docker
  docker:
    image: plugins/docker:1.13
    repo: docker.stackdot.com/<%=dockerRepoName%>
    tag:
      - '${DRONE_BRANCH/master/latest}'
      - '${DRONE_BRANCH}.build-${DRONE_BUILD_NUMBER}'
    storage_driver: overlay
    when:
      branch: master
<% } %>
<% if(publishNPM == true){ %>
  # Publish NPM package
  npm:
    image: plugins/npm
<% } %>

  # deploy:
  #   image: vallard/drone-kube
  #   template: kube.yml
  #   namespace: polygon
  #   when:
  #     branch: master
