chore(CI): remove drone CI config

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu 2022-12-24 21:31:52 +08:00
parent 598a11a626
commit 058dcd40d8
3 changed files with 0 additions and 396 deletions

View File

@ -1,16 +0,0 @@
local pipeline = import 'pipeline.libsonnet';
local name = 'drone-ssh';
[
pipeline.test,
pipeline.build(name, 'linux', 'amd64'),
// pipeline.build(name, 'linux', 'arm64'),
// pipeline.build(name, 'linux', 'arm'),
pipeline.release,
pipeline.notifications(depends_on=[
'linux-amd64',
// 'linux-arm64',
// 'linux-arm',
// 'release-binary',
]),
]

View File

@ -1,151 +0,0 @@
---
kind: pipeline
name: testing
platform:
arch: amd64
os: linux
steps:
- commands:
- make vet
image: golang:1.19
name: vet
pull: always
volumes:
- name: gopath
path: /go
- image: robertstettner/drone-codecov
name: codecov
pull: always
settings:
token:
from_secret: codecov_token
volumes:
- name: gopath
temp: {}
---
depends_on:
- testing
kind: pipeline
name: linux-amd64
platform:
arch: amd64
os: linux
steps:
- commands:
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-ssh
environment:
CGO_ENABLED: "0"
image: golang:1.19
name: build-push
pull: always
when:
event:
exclude:
- tag
- commands:
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}'
-a -o release/linux/amd64/drone-ssh
environment:
CGO_ENABLED: "0"
image: golang:1.19
name: build-tag
pull: always
when:
event:
- tag
- commands:
- ./release/linux/amd64/drone-ssh --help
image: golang:1.19
name: executable
pull: always
- image: plugins/docker:linux-amd64
name: dryrun
pull: always
settings:
cache_from: appleboy/drone-ssh
daemon_off: false
dockerfile: docker/Dockerfile.linux.amd64
dry_run: true
repo: appleboy/drone-ssh
tags: linux-amd64
when:
event:
- pull_request
- image: plugins/docker:linux-amd64
name: publish
pull: always
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
cache_from: appleboy/drone-ssh
daemon_off: "false"
dockerfile: docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: appleboy/drone-ssh
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/pull/**
- refs/tags/**
---
depends_on:
- testing
kind: pipeline
name: release-binary
platform:
arch: amd64
os: linux
steps:
- commands:
- export PATH=$PATH:$GOPATH/bin
- make release
image: techknowlogick/xgo:go-1.19.x
name: build-all-binary
pull: always
when:
event:
- tag
- image: plugins/github-release
name: deploy-all-binary
pull: always
settings:
api_key:
from_secret: github_release_api_key
files:
- dist/release/*
when:
event:
- tag
trigger:
ref:
- refs/tags/**
---
depends_on:
- linux-amd64
kind: pipeline
name: notifications
platform:
arch: amd64
os: linux
steps:
- image: plugins/manifest
name: manifest
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
- refs/tags/**

View File

@ -1,229 +0,0 @@
{
test:: {
kind: 'pipeline',
name: 'testing',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'vet',
image: 'golang:1.19',
pull: 'always',
commands: [
'make vet',
],
volumes: [
{
name: 'gopath',
path: '/go',
},
],
},
// {
// name: 'test',
// image: 'golang:1.19-alpine',
// pull: 'always',
// commands: [
// 'apk add git make curl perl bash build-base zlib-dev ucl-dev',
// 'make ssh-server',
// 'make test',
// 'make coverage',
// ],
// volumes: [
// {
// name: 'gopath',
// path: '/go',
// },
// ],
// },
{
name: 'codecov',
image: 'robertstettner/drone-codecov',
pull: 'always',
settings: {
token: { 'from_secret': 'codecov_token' },
},
},
],
volumes: [
{
name: 'gopath',
temp: {},
},
],
},
build(name, os='linux', arch='amd64'):: {
kind: 'pipeline',
name: os + '-' + arch,
platform: {
os: os,
arch: arch,
},
steps: [
{
name: 'build-push',
image: 'golang:1.19',
pull: 'always',
environment: {
CGO_ENABLED: '0',
},
commands: [
'go build -v -ldflags \'-X main.build=${DRONE_BUILD_NUMBER}\' -a -o release/' + os + '/' + arch + '/' + name,
],
when: {
event: {
exclude: [ 'tag' ],
},
},
},
{
name: 'build-tag',
image: 'golang:1.19',
pull: 'always',
environment: {
CGO_ENABLED: '0',
},
commands: [
'go build -v -ldflags \'-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\' -a -o release/' + os + '/' + arch + '/' + name,
],
when: {
event: [ 'tag' ],
},
},
{
name: 'executable',
image: 'golang:1.19',
pull: 'always',
commands: [
'./release/' + os + '/' + arch + '/' + name + ' --help',
],
},
{
name: 'dryrun',
image: 'plugins/docker:' + os + '-' + arch,
pull: 'always',
settings: {
daemon_off: false,
dry_run: true,
tags: os + '-' + arch,
dockerfile: 'docker/Dockerfile.' + os + '.' + arch,
repo: 'appleboy/' + name,
cache_from: 'appleboy/' + name,
},
when: {
event: [ 'pull_request' ],
},
},
{
name: 'publish',
image: 'plugins/docker:' + os + '-' + arch,
pull: 'always',
settings: {
daemon_off: 'false',
auto_tag: true,
auto_tag_suffix: os + '-' + arch,
dockerfile: 'docker/Dockerfile.' + os + '.' + arch,
repo: 'appleboy/' + name,
cache_from: 'appleboy/' + name,
username: { 'from_secret': 'docker_username' },
password: { 'from_secret': 'docker_password' },
},
when: {
event: {
exclude: [ 'pull_request' ],
},
},
},
],
depends_on: [
'testing',
],
trigger: {
ref: [
'refs/heads/master',
'refs/pull/**',
'refs/tags/**',
],
},
},
release:: {
kind: 'pipeline',
name: 'release-binary',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'build-all-binary',
image: 'techknowlogick/xgo:go-1.19.x',
pull: 'always',
commands: [
'export PATH=$PATH:$GOPATH/bin',
'make release'
],
when: {
event: [ 'tag' ],
},
},
{
name: 'deploy-all-binary',
image: 'plugins/github-release',
pull: 'always',
settings: {
files: [ 'dist/release/*' ],
api_key: { 'from_secret': 'github_release_api_key' },
},
when: {
event: [ 'tag' ],
},
},
],
depends_on: [
'testing',
],
trigger: {
ref: [
'refs/tags/**',
],
},
},
notifications(os='linux', arch='amd64', depends_on=[]):: {
kind: 'pipeline',
name: 'notifications',
platform: {
os: os,
arch: arch,
},
steps: [
{
name: 'manifest',
image: 'plugins/manifest',
pull: 'always',
settings: {
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
spec: 'docker/manifest.tmpl',
ignore_missing: true,
},
},
],
depends_on: depends_on,
trigger: {
ref: [
'refs/heads/master',
'refs/tags/**',
],
},
},
signature(key):: {
kind: 'signature',
hmac: key,
}
}