workspace:
  base: /go
  path: src/github.com/metalmatze/alertmanager-bot

pipeline:
  dep:
    image: metalmatze/dep:1.9
    commands:
      - dep ensure -v -vendor-only

  build:
    image: golang:alpine
    pull: true
    commands:
      - apk add -U git make
      - make fmt
      - make vet
      - make lint
      - make test
      - make build
    when:
      event: [ push, tag, pull_request ]

  release:
    image: golang:alpine
    commands:
      - apk add -U git make
      - make release
    when:
      event: tag

  docker:
    image: plugins/docker
    repo: metalmatze/alertmanager-bot
    tag: [ 0.2, 0.2.0 ]
    when:
      event: tag

  github:
    image: plugins/github-release
    files: dist/*
    when:
      event: tag

workspace:
  base: /go
  path: src/github.com/metalmatze/alertmanager-bot

pipeline:
  dep:
    image: metalmatze/dep:1.9
    commands:
      - dep ensure -v -vendor-only

  build:
    image: golang:alpine
    pull: true
    commands:
      - apk add -U git make
      - make fmt
      - make vet
      - make lint
      - make test
      - make build
    when:
      event: [ push, tag, pull_request ]

  release:
    image: golang:alpine
    commands:
      - apk add -U git make
      - make release
    when:
      event: tag

  docker:
    image: plugins/docker
    repo: metalmatze/alertmanager-bot
    secrets: [ docker_username, docker_password ]
    tag: [ 0.2, 0.2.0 ]
    when:
      event: tag

  github:
    image: plugins/github-release
    files: dist/*
    when:
      event: tag

Use docker_username & docker_password when pushing docker image
Use docker_username & docker_password when pushing docker image
