build:
  config:
    image: node:6
    environment:
      - NPM_CONFIG_CACHE=/drone/.npm
      - NPM_CONFIG_LOGLEVEL=warn
    commands:
      - cp config-ci.json config.json
      - npm install

  lint:
    image: node:6
    commands:
      - npm run lint

publish:
  docker:
    registry: quay.io
    username: $$QUAY_USERNAME
    password: $$QUAY_PASSWORD
    email: $$QUAY_EMAIL
    repo: buildo/pledge
    force_tag: true
    tag:
      - latest
      - $$COMMIT

deploy:
  ssh:
    host: jar.srv.buildo.io
    user: root
    port: 22
    commands:
      - crane lift pledge
    when:
      branch: master

notify:
  slack:
    webhook_url: "$$BUILDO_SLACK_WEBHOOK_URL"
    channel: pledge
    username: drone
    template: |
      {{#success build.status}}
        :tada: New version of *pledge* deployed! (_commit <{{ build.link_url }}|$$COMMIT>_)
      {{else}}
        :cold_sweat: Something went wrong with the deploy!
      {{/success}}
    when:
      branch: master
      success: true
      failure: true
      change: false

build:
  config:
    image: node:6
    environment:
      - NPM_CONFIG_CACHE=/drone/.npm
      - NPM_CONFIG_LOGLEVEL=warn
    commands:
      - cp config-ci.json config.json
      - npm install -g yarn
      - yarn
      - yarn test
      - yarn run lint

publish:
  docker:
    registry: quay.io
    username: $$QUAY_USERNAME
    password: $$QUAY_PASSWORD
    email: $$QUAY_EMAIL
    repo: buildo/pledge
    force_tag: true
    tag:
      - latest
      - $$COMMIT

deploy:
  ssh:
    host: jar.srv.buildo.io
    user: root
    port: 22
    commands:
      - crane lift pledge
    when:
      branch: master

notify:
  slack:
    webhook_url: "$$BUILDO_SLACK_WEBHOOK_URL"
    channel: pledge
    username: drone
    template: |
      {{#success build.status}}
        :tada: New version of *pledge* deployed! (_commit <{{ build.link_url }}|$$COMMIT>_)
      {{else}}
        :cold_sweat: Something went wrong with the deploy!
      {{/success}}
    when:
      branch: master
      success: true
      failure: true
      change: false

Include test in CI, switch to yarn and simplify build steps
Include test in CI, switch to yarn and simplify build steps
