hetzner-storagebox-exporter/.drone.yml
Varakh adff3b9820
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
Separate monthly cron and explicit promote
2023-03-24 08:43:02 +01:00

110 lines
2.2 KiB
YAML

---
kind: pipeline
type: docker
name: test
trigger:
event:
include:
- push
steps:
- name: docker build
image: plugins/docker
environment:
REVISION: ${DRONE_COMMIT_SHA}
CREATED: ${DRONE_BUILD_CREATED}
SOURCE_URL: ${DRONE_GIT_HTTP_URL}
settings:
dry_run: true
purge: true
repo: varakh/hetzner-storagebox-exporter
tags:
- ${DRONE_COMMIT_SHA}
---
kind: pipeline
type: docker
name: build and publish
trigger:
event:
- promote
target:
- production
steps:
- name: docker build
image: plugins/docker
environment:
REVISION: ${DRONE_COMMIT_SHA}
CREATED: ${DRONE_BUILD_CREATED}
SOURCE_URL: ${DRONE_GIT_HTTP_URL}
settings:
purge: true
username:
from_secret: dockerhub_user
password:
from_secret: dockerhub_key
repo: varakh/hetzner-storagebox-exporter
tags:
- latest
when:
branch:
- master
---
kind: pipeline
type: docker
name: monhtly build and publish
trigger:
event:
- cron
cron:
include:
- monthly
steps:
- name: docker build
image: plugins/docker
environment:
REVISION: ${DRONE_COMMIT_SHA}
CREATED: ${DRONE_BUILD_CREATED}
SOURCE_URL: ${DRONE_GIT_HTTP_URL}
settings:
purge: true
username:
from_secret: dockerhub_user
password:
from_secret: dockerhub_key
repo: varakh/hetzner-storagebox-exporter
tags:
- latest
- monthly
when:
branch:
- master
---
kind: pipeline
type: docker
name: result
steps:
- name: notify
image: drillster/drone-email
settings:
subject: "Build failed"
body: "URL ${DRONE_BUILD_LINK}"
host:
from_secret: mail_host
username:
from_secret: mail_user
password:
from_secret: mail_password
from:
from_secret: mail_from
when:
status:
- failure