From 18826b8afbd113b21e5d85f83935ac64031ae85f Mon Sep 17 00:00:00 2001 From: "Bo-Yi.Wu" Date: Sat, 24 Dec 2022 21:04:08 +0800 Subject: [PATCH] chore(CI): remove drone build config files https://github.com/appleboy/gorush/issues/704 Signed-off-by: Bo-Yi.Wu --- .drone.jsonnet | 16 --- .drone.yml | 150 ------------------------- pipeline.libsonnet | 273 --------------------------------------------- 3 files changed, 439 deletions(-) delete mode 100644 .drone.jsonnet delete mode 100644 .drone.yml delete mode 100644 pipeline.libsonnet diff --git a/.drone.jsonnet b/.drone.jsonnet deleted file mode 100644 index 79d2c5b..0000000 --- a/.drone.jsonnet +++ /dev/null @@ -1,16 +0,0 @@ -local pipeline = import 'pipeline.libsonnet'; -local name = 'gorush'; - -[ - 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', - ]), -] diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 45aca10..0000000 --- a/.drone.yml +++ /dev/null @@ -1,150 +0,0 @@ ---- -kind: pipeline -name: testing -platform: - arch: amd64 - os: linux -services: -- image: redis - name: redis -- commands: - - /nsqd - image: nsqio/nsq - name: nsq -steps: -- commands: - - make embedmd - image: golang:1.19 - name: embedmd - pull: always - volumes: - - name: gopath - path: /go -- commands: - - hadolint --version - - hadolint docker/Dockerfile.linux.amd64 - - hadolint docker/Dockerfile.linux.arm64 - - hadolint docker/Dockerfile.linux.arm - image: hadolint/hadolint:latest-debian - name: hadolint - pull: always - volumes: - - name: gopath - path: /go -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/gorush - 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/gorush - environment: - CGO_ENABLED: "0" - image: golang:1.19 - name: build-tag - pull: always - when: - event: - - tag -- commands: - - ./release/linux/amd64/gorush --help - image: golang:1.19 - name: executable - pull: always -- image: plugins/docker:linux-amd64 - name: publish - pull: always - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - cache_from: appleboy/gorush - daemon_off: "false" - 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 - - refs/pull/** - - refs/tags/** ---- -depends_on: -- testing -kind: pipeline -name: release-binary -platform: - arch: amd64 - os: linux -steps: -- commands: - - make release - image: golang:1.19 - 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 -- release-binary -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/** diff --git a/pipeline.libsonnet b/pipeline.libsonnet deleted file mode 100644 index a5dc0c2..0000000 --- a/pipeline.libsonnet +++ /dev/null @@ -1,273 +0,0 @@ -{ - test:: { - kind: 'pipeline', - name: 'testing', - platform: { - os: 'linux', - arch: 'amd64', - }, - steps: [ - // { - // name: 'lint', - // image: 'golangci/golangci-lint:v1.46.2', - // pull: 'always', - // commands: [ - // 'golangci-lint run -v', - // ], - // volumes: [ - // { - // name: 'gopath', - // path: '/go', - // }, - // ], - // }, - { - name: 'embedmd', - image: 'golang:1.19', - pull: 'always', - commands: [ - 'make embedmd', - ], - volumes: [ - { - name: 'gopath', - path: '/go', - }, - ], - }, - { - name: 'hadolint', - image: 'hadolint/hadolint:latest-debian', - pull: 'always', - commands: [ - 'hadolint --version', - 'hadolint docker/Dockerfile.linux.amd64', - 'hadolint docker/Dockerfile.linux.arm64', - 'hadolint docker/Dockerfile.linux.arm', - ], - volumes: [ - { - name: 'gopath', - path: '/go', - }, - ], - }, - // { - // name: 'test', - // image: 'golang:1.19', - // pull: 'always', - // environment: { - // ANDROID_API_KEY: { 'from_secret': 'android_api_key' }, - // ANDROID_TEST_TOKEN: { 'from_secret': 'android_test_token' }, - // }, - // commands: [ - // 'make test', - // ], - // volumes: [ - // { - // name: 'gopath', - // path: '/go', - // }, - // ], - // }, - // { - // name: 'codecov', - // image: 'robertstettner/drone-codecov', - // pull: 'always', - // settings: { - // token: { 'from_secret': 'codecov_token' }, - // }, - // }, - ], - volumes: [ - { - name: 'gopath', - temp: {}, - }, - ], - services: [ - { - name: 'redis', - image: 'redis', - }, - { - name: 'nsq', - image: 'nsqio/nsq', - commands: [ - "/nsqd", - ], - }, - ], - }, - - 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-push-lambda', - // image: 'golang:1.19', - // pull: 'always', - // environment: { - // CGO_ENABLED: '0', - // }, - // commands: [ - // 'go build -v -tags \'lambda\' -ldflags \'-X main.build=${DRONE_BUILD_NUMBER}\' -a -o release/' + os + '/' + arch + '/lambda/' + 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: '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: 'golang:1.19', - pull: 'always', - commands: [ - '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, - }, -}