2019-03-16 03:37:01 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: testing
|
|
|
|
platform:
|
|
|
|
arch: amd64
|
2022-06-30 13:41:49 +00:00
|
|
|
os: linux
|
|
|
|
services:
|
|
|
|
- image: redis
|
|
|
|
name: redis
|
|
|
|
- commands:
|
|
|
|
- /nsqd
|
|
|
|
image: nsqio/nsq
|
|
|
|
name: nsq
|
2019-03-16 03:37:01 +00:00
|
|
|
steps:
|
2022-06-30 13:41:49 +00:00
|
|
|
- commands:
|
2019-03-16 03:37:01 +00:00
|
|
|
- make embedmd
|
2022-12-11 03:27:08 +00:00
|
|
|
image: golang:1.19
|
2022-06-30 13:41:49 +00:00
|
|
|
name: embedmd
|
|
|
|
pull: always
|
2019-03-16 03:37:01 +00:00
|
|
|
volumes:
|
|
|
|
- name: gopath
|
|
|
|
path: /go
|
2022-06-30 13:41:49 +00:00
|
|
|
- commands:
|
2020-03-01 12:31:28 +00:00
|
|
|
- hadolint --version
|
|
|
|
- hadolint docker/Dockerfile.linux.amd64
|
|
|
|
- hadolint docker/Dockerfile.linux.arm64
|
|
|
|
- hadolint docker/Dockerfile.linux.arm
|
2022-06-30 13:41:49 +00:00
|
|
|
image: hadolint/hadolint:latest-debian
|
|
|
|
name: hadolint
|
2019-03-16 03:37:01 +00:00
|
|
|
pull: always
|
|
|
|
volumes:
|
|
|
|
- name: gopath
|
|
|
|
path: /go
|
|
|
|
volumes:
|
|
|
|
- name: gopath
|
|
|
|
temp: {}
|
|
|
|
---
|
2022-06-30 13:41:49 +00:00
|
|
|
depends_on:
|
|
|
|
- testing
|
2019-03-16 03:37:01 +00:00
|
|
|
kind: pipeline
|
|
|
|
name: linux-amd64
|
|
|
|
platform:
|
|
|
|
arch: amd64
|
2022-06-30 13:41:49 +00:00
|
|
|
os: linux
|
2019-03-16 03:37:01 +00:00
|
|
|
steps:
|
2022-06-30 13:41:49 +00:00
|
|
|
- commands:
|
2021-03-27 02:00:32 +00:00
|
|
|
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/gorush
|
2019-03-16 03:37:01 +00:00
|
|
|
environment:
|
2022-06-30 13:41:49 +00:00
|
|
|
CGO_ENABLED: "0"
|
2022-12-11 03:27:08 +00:00
|
|
|
image: golang:1.19
|
2022-06-30 13:41:49 +00:00
|
|
|
name: build-push
|
|
|
|
pull: always
|
2019-03-16 03:37:01 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- tag
|
2022-06-30 13:41:49 +00:00
|
|
|
- commands:
|
|
|
|
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}'
|
|
|
|
-a -o release/linux/amd64/gorush
|
2019-03-16 03:37:01 +00:00
|
|
|
environment:
|
2022-06-30 13:41:49 +00:00
|
|
|
CGO_ENABLED: "0"
|
2022-12-11 03:27:08 +00:00
|
|
|
image: golang:1.19
|
2022-06-30 13:41:49 +00:00
|
|
|
name: build-tag
|
|
|
|
pull: always
|
2019-03-16 03:37:01 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
2022-06-30 13:41:49 +00:00
|
|
|
- commands:
|
2019-03-16 03:37:01 +00:00
|
|
|
- ./release/linux/amd64/gorush --help
|
2022-12-11 03:27:08 +00:00
|
|
|
image: golang:1.19
|
2022-06-30 13:41:49 +00:00
|
|
|
name: executable
|
|
|
|
pull: always
|
|
|
|
- image: plugins/docker:linux-amd64
|
|
|
|
name: publish
|
2019-03-16 03:37:01 +00:00
|
|
|
pull: always
|
|
|
|
settings:
|
|
|
|
auto_tag: true
|
|
|
|
auto_tag_suffix: linux-amd64
|
|
|
|
cache_from: appleboy/gorush
|
2022-06-30 13:41:49 +00:00
|
|
|
daemon_off: "false"
|
2019-03-16 03:37:01 +00:00
|
|
|
dockerfile: docker/Dockerfile.linux.amd64
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
|
|
|
repo: appleboy/gorush
|
|
|
|
username:
|
|
|
|
from_secret: docker_username
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- pull_request
|
|
|
|
trigger:
|
|
|
|
ref:
|
|
|
|
- refs/heads/master
|
2021-03-27 02:00:32 +00:00
|
|
|
- refs/pull/**
|
|
|
|
- refs/tags/**
|
2022-06-30 13:41:49 +00:00
|
|
|
---
|
2019-03-16 03:37:01 +00:00
|
|
|
depends_on:
|
|
|
|
- testing
|
|
|
|
kind: pipeline
|
|
|
|
name: release-binary
|
|
|
|
platform:
|
|
|
|
arch: amd64
|
2022-06-30 13:41:49 +00:00
|
|
|
os: linux
|
2019-03-16 03:37:01 +00:00
|
|
|
steps:
|
2022-06-30 13:41:49 +00:00
|
|
|
- commands:
|
2019-03-16 03:37:01 +00:00
|
|
|
- make release
|
2022-12-11 03:27:08 +00:00
|
|
|
image: golang:1.19
|
2022-06-30 13:41:49 +00:00
|
|
|
name: build-all-binary
|
|
|
|
pull: always
|
2019-03-16 03:37:01 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
2022-06-30 13:41:49 +00:00
|
|
|
- image: plugins/github-release
|
|
|
|
name: deploy-all-binary
|
2019-03-16 03:37:01 +00:00
|
|
|
pull: always
|
|
|
|
settings:
|
|
|
|
api_key:
|
|
|
|
from_secret: github_release_api_key
|
|
|
|
files:
|
2021-03-27 02:00:32 +00:00
|
|
|
- dist/release/*
|
2019-03-16 03:37:01 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
trigger:
|
|
|
|
ref:
|
2021-03-27 02:00:32 +00:00
|
|
|
- refs/tags/**
|
2019-03-16 03:37:01 +00:00
|
|
|
---
|
2022-06-30 13:41:49 +00:00
|
|
|
depends_on:
|
|
|
|
- linux-amd64
|
|
|
|
- release-binary
|
2019-03-16 03:37:01 +00:00
|
|
|
kind: pipeline
|
|
|
|
name: notifications
|
|
|
|
platform:
|
|
|
|
arch: amd64
|
2022-06-30 13:41:49 +00:00
|
|
|
os: linux
|
2019-03-16 03:37:01 +00:00
|
|
|
steps:
|
2022-06-30 13:41:49 +00:00
|
|
|
- image: plugins/manifest
|
|
|
|
name: manifest
|
2019-03-16 03:37:01 +00:00
|
|
|
pull: always
|
|
|
|
settings:
|
|
|
|
ignore_missing: true
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
|
|
|
spec: docker/manifest.tmpl
|
|
|
|
username:
|
|
|
|
from_secret: docker_username
|
|
|
|
trigger:
|
|
|
|
ref:
|
|
|
|
- refs/heads/master
|
2021-03-27 02:00:32 +00:00
|
|
|
- refs/tags/**
|