pipeline:
  setup:
    image: node:8
    when:
      event: [push, pull_request]
    commands:
      - yarn
  test:
    image: node:8
    when:
      event: [push, pull_request]
    group: testing
    commands:
      - yarn test
  lint:
    image: node:8
    when:
      event: [push, pull_request]
    group: testing
    commands:
      - yarn lint
  flow:
    image: node:8
    when:
      event: [push, pull_request]
    group: testing
    commands:
      - yarn flow --quiet
  build:
    image: node:8
    when:
      event: [push, pull_request]
      branch:
        exclude: [ prod ]
    group: testing
    commands:
      - yarn build
  docker:
    image: plugins/docker
    when:
      branch:
        - prod
      event: push
      status: success
    registry: https://registry.abakus.no
    repo: registry.abakus.no/webkom/lego-webapp
    secrets: [ docker_username, docker_password, sentry_auth_key ]
    tags:
      - ${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:7}
    build_args_from_env:
      - sentry_auth_key
    build_args:
      - RELEASE=${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:7}
      - SENTRY_ORG=webkom
      - SENTRY_PROJECT=lego-webapp
      - SENTRY_URL=https://sentry.abakus.no/

pipeline:
  setup:
    image: node:8
    when:
      event: [push, pull_request]
    commands:
      - yarn
  test:
    image: node:8
    when:
      event: [push, pull_request]
    group: testing
    commands:
      - yarn test
  lint:
    image: node:8
    when:
      event: [push, pull_request]
    group: testing
    commands:
      - yarn lint
  flow:
    image: node:8
    when:
      event: [push, pull_request]
    group: testing
    commands:
      - yarn flow --quiet
  build:
    image: node:8
    when:
      event: [push, pull_request]
      branch:
        exclude: [ prod ]
    group: testing
    commands:
      - yarn build
  docker:
    image: plugins/docker
    when:
      branch:
        - prod
      event: push
      status: success
    registry: https://registry.abakus.no
    repo: registry.abakus.no/webkom/lego-webapp
    secrets: [ docker_username, docker_password, sentry_auth_key ]
    tags:
      - ${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:7}
    build_args:
      - RELEASE=${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:7}
      - SENTRY_AUTH_KEY
      - SENTRY_ORG=webkom
      - SENTRY_PROJECT=lego-webapp
      - SENTRY_URL=https://sentry.abakus.no/

Fix CI docker build args
Fix CI docker build args

This fixes #1378.
