drone-telegram/.drone.yml

383 lines
6.8 KiB
YAML
Raw Permalink Normal View History

2019-02-16 18:33:00 +03:00
---
kind: pipeline
2019-02-16 18:39:20 +03:00
name: testing
2019-02-16 18:33:00 +03:00
platform:
os: linux
arch: amd64
steps:
2019-02-16 18:39:20 +03:00
- name: vet
2019-02-16 18:33:00 +03:00
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:33:00 +03:00
commands:
- make vet
2019-02-16 18:39:20 +03:00
volumes:
- name: gopath
path: /go
- name: lint
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:39:20 +03:00
commands:
2019-02-16 18:33:00 +03:00
- make lint
2019-02-16 18:39:20 +03:00
volumes:
- name: gopath
path: /go
- name: misspell
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:39:20 +03:00
commands:
2019-02-16 18:33:00 +03:00
- make misspell-check
2019-02-16 18:39:20 +03:00
volumes:
- name: gopath
path: /go
- name: test
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:39:20 +03:00
commands:
2019-02-16 18:33:00 +03:00
- make test
- make coverage
environment:
TELEGRAM_TO:
from_secret: telegram_to
TELEGRAM_TOKEN:
from_secret: telegram_token
2019-02-16 18:39:20 +03:00
volumes:
- name: gopath
path: /go
2019-02-16 18:33:00 +03:00
2019-02-16 18:39:20 +03:00
- name: codecov
2019-02-16 18:33:00 +03:00
pull: always
2019-02-16 18:39:20 +03:00
image: robertstettner/drone-codecov
2019-02-16 18:33:00 +03:00
settings:
2019-02-16 18:39:20 +03:00
token:
from_secret: codecov_token
volumes:
- name: gopath
temp: {}
---
kind: pipeline
name: linux-amd64
platform:
os: linux
arch: amd64
2019-02-16 18:39:20 +03:00
steps:
- name: build-push
2019-02-16 18:33:00 +03:00
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:33:00 +03:00
commands:
2021-04-03 01:39:46 +03:00
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram
2019-02-16 18:39:20 +03:00
environment:
CGO_ENABLED: 0
when:
event:
exclude:
- tag
2019-02-16 18:39:20 +03:00
- name: build-tag
2019-02-16 18:33:00 +03:00
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:33:00 +03:00
commands:
2021-04-03 01:39:46 +03:00
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram
2019-02-16 18:39:20 +03:00
environment:
CGO_ENABLED: 0
when:
event:
- tag
2019-02-16 18:39:20 +03:00
- name: executable
2019-02-16 18:33:00 +03:00
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:33:00 +03:00
commands:
2019-02-16 18:39:20 +03:00
- ./release/linux/amd64/drone-telegram --help
- name: dryrun
pull: always
image: plugins/docker:linux-amd64
2019-02-16 18:33:00 +03:00
settings:
cache_from: appleboy/drone-telegram
2019-02-16 18:39:20 +03:00
dockerfile: docker/Dockerfile.linux.amd64
dry_run: true
repo: appleboy/drone-telegram
tags: linux-amd64
when:
event:
- pull_request
2019-02-16 18:39:20 +03:00
- name: publish
pull: always
image: plugins/docker:linux-amd64
2019-02-16 18:33:00 +03:00
settings:
2019-02-16 18:39:20 +03:00
auto_tag: true
auto_tag_suffix: linux-amd64
cache_from: appleboy/drone-telegram
2019-02-16 18:39:20 +03:00
daemon_off: false
dockerfile: docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: appleboy/drone-telegram
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
2021-04-03 01:39:46 +03:00
- refs/pull/**
- refs/tags/**
2019-02-16 18:39:20 +03:00
depends_on:
- testing
---
kind: pipeline
name: linux-arm64
platform:
os: linux
arch: arm64
steps:
- name: build-push
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:39:20 +03:00
commands:
2021-04-03 01:39:46 +03:00
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram
2019-02-16 18:33:00 +03:00
environment:
2019-02-16 18:39:20 +03:00
CGO_ENABLED: 0
2019-02-16 18:33:00 +03:00
when:
event:
2019-02-16 18:39:20 +03:00
exclude:
- tag
2019-02-16 18:33:00 +03:00
2019-02-16 18:39:20 +03:00
- name: build-tag
2019-02-16 18:33:00 +03:00
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:33:00 +03:00
commands:
2021-04-03 01:39:46 +03:00
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram
2019-02-16 18:39:20 +03:00
environment:
CGO_ENABLED: 0
2019-02-16 18:33:00 +03:00
when:
event:
- tag
2019-02-16 18:39:20 +03:00
- name: executable
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:39:20 +03:00
commands:
- ./release/linux/arm64/drone-telegram --help
- name: dryrun
2019-02-16 18:33:00 +03:00
pull: always
2019-02-16 18:39:20 +03:00
image: plugins/docker:linux-arm64
2019-02-16 18:33:00 +03:00
settings:
cache_from: appleboy/drone-telegram
2019-02-16 18:39:20 +03:00
dockerfile: docker/Dockerfile.linux.arm64
dry_run: true
repo: appleboy/drone-telegram
tags: linux-arm64
2019-02-16 18:33:00 +03:00
when:
event:
2019-02-16 18:39:20 +03:00
- pull_request
2019-02-16 18:33:00 +03:00
2019-02-16 18:39:20 +03:00
- name: publish
2019-02-16 18:33:00 +03:00
pull: always
2019-02-16 18:39:20 +03:00
image: plugins/docker:linux-arm64
2019-02-16 18:33:00 +03:00
settings:
auto_tag: true
2019-02-16 18:39:20 +03:00
auto_tag_suffix: linux-arm64
cache_from: appleboy/drone-telegram
2019-02-16 18:39:20 +03:00
daemon_off: false
dockerfile: docker/Dockerfile.linux.arm64
password:
2019-02-16 18:33:00 +03:00
from_secret: docker_password
2019-02-16 18:39:20 +03:00
repo: appleboy/drone-telegram
username:
2019-02-16 18:33:00 +03:00
from_secret: docker_username
when:
event:
2019-02-16 18:39:20 +03:00
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
2021-04-03 01:39:46 +03:00
- refs/pull/**
- refs/tags/**
2019-02-16 18:39:20 +03:00
depends_on:
- testing
2019-02-16 18:33:00 +03:00
2019-02-16 18:39:20 +03:00
---
kind: pipeline
name: linux-arm
platform:
os: linux
arch: arm
steps:
- name: build-push
2019-02-16 18:33:00 +03:00
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:39:20 +03:00
commands:
2021-04-03 01:39:46 +03:00
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram
2019-02-16 18:33:00 +03:00
environment:
2019-02-16 18:39:20 +03:00
CGO_ENABLED: 0
2019-02-16 18:33:00 +03:00
when:
event:
2019-02-16 18:39:20 +03:00
exclude:
- tag
2019-02-16 18:33:00 +03:00
2019-02-16 18:39:20 +03:00
- name: build-tag
2019-02-16 18:33:00 +03:00
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:39:20 +03:00
commands:
2021-04-03 01:39:46 +03:00
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram
2019-02-16 18:33:00 +03:00
environment:
2019-02-16 18:39:20 +03:00
CGO_ENABLED: 0
2019-02-16 18:33:00 +03:00
when:
event:
- tag
2019-02-16 18:39:20 +03:00
- name: executable
2019-02-16 18:33:00 +03:00
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-16 18:39:20 +03:00
commands:
- ./release/linux/arm/drone-telegram --help
- name: dryrun
pull: always
image: plugins/docker:linux-arm
2019-02-16 18:33:00 +03:00
settings:
cache_from: appleboy/drone-telegram
2019-02-16 18:39:20 +03:00
dockerfile: docker/Dockerfile.linux.arm
dry_run: true
repo: appleboy/drone-telegram
tags: linux-arm
2019-02-16 18:33:00 +03:00
when:
event:
2019-02-16 18:39:20 +03:00
- pull_request
2019-02-16 18:33:00 +03:00
2019-02-16 18:39:20 +03:00
- name: publish
2019-02-16 18:33:00 +03:00
pull: always
2019-02-16 18:39:20 +03:00
image: plugins/docker:linux-arm
2019-02-16 18:33:00 +03:00
settings:
2019-02-16 18:39:20 +03:00
auto_tag: true
auto_tag_suffix: linux-arm
cache_from: appleboy/drone-telegram
2019-02-16 18:39:20 +03:00
daemon_off: false
dockerfile: docker/Dockerfile.linux.arm
password:
from_secret: docker_password
repo: appleboy/drone-telegram
username:
from_secret: docker_username
2019-02-16 18:33:00 +03:00
when:
event:
2019-02-16 18:39:20 +03:00
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
2021-04-03 01:39:46 +03:00
- refs/pull/**
- refs/tags/**
2019-02-16 18:33:00 +03:00
2019-02-16 18:39:20 +03:00
depends_on:
- testing
2019-02-17 05:33:38 +03:00
---
kind: pipeline
name: release-binary
platform:
os: linux
arch: amd64
steps:
- name: build-all-binary
pull: always
2021-04-03 02:08:13 +03:00
image: golang:1.15
2019-02-17 05:33:38 +03:00
commands:
- make release
when:
event:
- tag
- name: deploy-all-binary
pull: always
image: plugins/github-release
settings:
api_key:
from_secret: github_release_api_key
files:
2021-04-03 01:39:46 +03:00
- dist/release/*
2019-02-17 05:33:38 +03:00
when:
event:
- tag
trigger:
ref:
2021-04-03 01:39:46 +03:00
- refs/tags/**
2019-02-17 05:33:38 +03:00
depends_on:
- testing
2019-02-16 18:39:20 +03:00
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
steps:
2019-09-25 19:39:41 +03:00
- name: telegram
pull: always
image: appleboy/drone-telegram:linux-amd64
2019-09-25 19:39:41 +03:00
settings:
message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{/success}}\n\n timecost: {{since build.started}}\n"
2019-09-25 19:39:41 +03:00
to:
from_secret: telegram_to
token:
from_secret: telegram_token
2019-02-17 15:32:59 +03:00
- name: manifest
pull: always
image: plugins/manifest
settings:
ignore_missing: true
password:
from_secret: docker_password
spec: docker/manifest.tmpl
username:
from_secret: docker_username
2019-02-16 18:39:20 +03:00
trigger:
2019-02-17 08:37:26 +03:00
ref:
- refs/heads/master
2021-04-03 01:39:46 +03:00
- refs/tags/**
2019-02-16 18:39:20 +03:00
depends_on:
- linux-amd64
- linux-arm64
- linux-arm
2019-02-17 05:33:38 +03:00
- release-binary
2019-02-16 18:33:00 +03:00
2019-02-17 15:29:22 +03:00
---
kind: signature
hmac: 9a4dcc3659b6f2cb98486e40e4cb0c16d6fc19ad783d3bca13d30c476daf8213
2019-02-16 18:33:00 +03:00
...