workspace:
  path: /src

clone:
  git:
    image: plugins/git
    depth: 50
    tags: true

pipeline:
  docker:
    image: plugins/docker
    pull: true
    secrets: [ docker_username, docker_password ]
    repo: vikunja/website
    tags: [ 'latest' ]
    auto_tag: true
    when:
      event: [ push, tag ]
      branch: [ master ]
  
  rancher:
    image: peloton/drone-rancher
    url: http://server01.kolaente.de:8080/v1
    secrets: [ RANCHER_ACCESS_KEY, RANCHER_SECRET_KEY ]
    service: vikunja-website/web
    docker_image: vikunja/website
    confirm: true
    when:
      event: [ push, tag ]
# Tell people vikunja web was updated
  telegram:
    image: appleboy/drone-telegram
    secrets: [ TELEGRAM_TOKEN, TELEGRAM_TO, ]
    message: >
      {{repo.owner}}/{{repo.name}}: \[{{build.status}}] Build {{build.number}}
      {{commit.author}} pushed to {{commit.branch}} {{commit.sha}}: `{{commit.message}}`
      Build started at {{datetime build.started "2006-Jan-02T15:04:05Z" "GMT+2"}} finished at {{datetime build.finished "2006-Jan-02T15:04:05Z" "GMT+2"}}.
