Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham149 committed Mar 15, 2023
1 parent 11c7f46 commit 3872daf
Showing 1 changed file with 29 additions and 306 deletions.
335 changes: 29 additions & 306 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,309 +1,32 @@
---
kind: pipeline
name: testing

platform:
os: linux
arch: amd64

steps:
- name: vet
pull: always
image: golang:1.11
commands:
- go vet ./...
environment:
GO111MODULE: on

- name: test
pull: always
image: golang:1.11
commands:
- go test -cover ./...
environment:
GO111MODULE: on

trigger:
branch:
- master

---
kind: pipeline
name: linux-amd64

platform:
os: linux
arch: amd64
type: vm

pool:
use: ubuntu

steps:
- name: build-push
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/amd64/drone-s3"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- push
- pull_request

- name: build-tag
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/amd64/drone-s3"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag

- name: executable
pull: always
image: golang:1.11
commands:
- ./release/linux/amd64/drone-s3 --help

- name: dryrun
pull: always
image: plugins/docker:linux-amd64
settings:
dockerfile: docker/Dockerfile.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/s3
tags: linux-amd64
username:
from_secret: docker_username
when:
event:
- pull_request

- name: publish
pull: always
image: plugins/docker:linux-amd64
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: plugins/s3
username:
from_secret: docker_username
when:
event:
- push
- tag

trigger:
branch:
- master

depends_on:
- testing

---
kind: pipeline
name: linux-arm64

platform:
os: linux
arch: arm64

steps:
- name: build-push
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm64/drone-s3"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- push
- pull_request

- name: build-tag
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm64/drone-s3"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag

- name: executable
pull: always
image: golang:1.11
commands:
- ./release/linux/arm64/drone-s3 --help

- name: dryrun
pull: always
image: plugins/docker:linux-arm64
settings:
dockerfile: docker/Dockerfile.linux.arm64
dry_run: true
password:
from_secret: docker_password
repo: plugins/s3
tags: linux-arm64
username:
from_secret: docker_username
when:
event:
- pull_request

- name: publish
pull: always
image: plugins/docker:linux-arm64
settings:
auto_tag: true
auto_tag_suffix: linux-arm64
dockerfile: docker/Dockerfile.linux.arm64
password:
from_secret: docker_password
repo: plugins/s3
username:
from_secret: docker_username
when:
event:
- push
- tag

trigger:
branch:
- master

depends_on:
- testing

---
kind: pipeline
name: linux-arm

platform:
os: linux
arch: arm

steps:
- name: build-push
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm/drone-s3"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- push
- pull_request

- name: build-tag
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm/drone-s3"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag

- name: executable
pull: always
image: golang:1.11
commands:
- ./release/linux/arm/drone-s3 --help

- name: dryrun
pull: always
image: plugins/docker:linux-arm
settings:
dockerfile: docker/Dockerfile.linux.arm
dry_run: true
password:
from_secret: docker_password
repo: plugins/s3
tags: linux-arm
username:
from_secret: docker_username
when:
event:
- pull_request

- name: publish
pull: always
image: plugins/docker:linux-arm
settings:
auto_tag: true
auto_tag_suffix: linux-arm
dockerfile: docker/Dockerfile.linux.arm
password:
from_secret: docker_password
repo: plugins/s3
username:
from_secret: docker_username
when:
event:
- push
- tag

trigger:
branch:
- master

depends_on:
- testing

---
kind: pipeline
name: notifications

platform:
os: linux
arch: amd64

steps:
- name: manifest
pull: always
image: plugins/manifest:1
settings:
ignore_missing: true
password:
from_secret: docker_password
spec: docker/manifest.tmpl
username:
from_secret: docker_username

- name: microbadger
pull: always
image: plugins/webhook:1
settings:
url:
from_secret: microbadger_url

trigger:
branch:
- master
event:
- push
- tag

depends_on:
- linux-amd64
- linux-arm64
- linux-arm

...
- name: build-push
pull: always
image: golang:1.19
commands:
- "go build -v -ldflags \"-s -w\" -a -o release/linux/amd64/drone-s3"
environment:
CGO_ENABLED: 0
GO111MODULE: on

- name: zstd-compress
commands:
- "sudo apt-get update -y"
- "sudo apt-get install -y zstd"
- "zstd release/linux/amd64/drone-s3"

- name: release
image: plugins/github-release
settings:
files:
- release/linux/amd64/drone-s3.zst
api_key:
from_secret: github_token
when:
event:
- tag

0 comments on commit 3872daf

Please sign in to comment.