Browse Source

Update drone file to build locally

master
Fábio Kaiser Rauber 2 years ago
parent
commit
981e88133c
  1. 358
      .drone.yml
  2. 2
      README.md

358
.drone.yml

@ -1,359 +1,19 @@
---
kind: pipeline
name: testing
platform:
os: linux
arch: amd64
steps:
- name: vet
pull: always
image: golang:1.16
commands:
- make vet
volumes:
- name: gopath
path: /go
- name: misspell
pull: always
image: golang:1.16
commands:
- make misspell-check
volumes:
- name: gopath
path: /go
- name: test
pull: always
image: golang:1.16
commands:
- make test
- make coverage
environment:
WEBHOOK_ID:
from_secret: webhook_id
WEBHOOK_TOKEN:
from_secret: webhook_token
volumes:
- name: gopath
path: /go
- name: codecov
pull: always
image: robertstettner/drone-codecov
settings:
token:
from_secret: codecov_token
volumes:
- name: gopath
temp: {}
--- ---
kind: pipeline kind: pipeline
name: linux-amd64 name: linux-amd64
type: kubernetes
platform:
os: linux
arch: amd64
steps: steps:
- name: build-push - name: docker
pull: always image: plugins/docker
image: golang:1.16
commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-packer"
environment:
CGO_ENABLED: 0
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.16
commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-packer"
environment:
CGO_ENABLED: 0
when:
event:
- tag
- name: executable
pull: always
image: golang:1.16
commands:
- ./release/linux/amd64/drone-packer --help
- name: dryrun
pull: always
image: plugins/docker:linux-amd64
settings:
cache_from: appleboy/drone-packer
dockerfile: docker/Dockerfile.linux.amd64
dry_run: true
repo: appleboy/drone-packer
tags: linux-amd64
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:linux-amd64
settings: settings:
repo: porto.interlegis.leg.br/library/drone-packer
registry: porto.interlegis.leg.br
mirror: https://registrycache.interlegis.leg.br
pull: if-not-exists
auto_tag: true auto_tag: true
auto_tag_suffix: linux-amd64
cache_from: appleboy/drone-packer
daemon_off: false
dockerfile: docker/Dockerfile.linux.amd64 dockerfile: docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: appleboy/drone-packer
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: linux-arm64
platform:
os: linux
arch: arm64
steps:
- name: build-push
pull: always
image: golang:1.16
commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-packer"
environment:
CGO_ENABLED: 0
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.16
commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-packer"
environment:
CGO_ENABLED: 0
when:
event:
- tag
- name: executable
pull: always
image: golang:1.16
commands:
- ./release/linux/arm64/drone-packer --help
- name: dryrun
pull: always
image: plugins/docker:linux-arm64
settings:
cache_from: appleboy/drone-packer
dockerfile: docker/Dockerfile.linux.arm64
dry_run: true
repo: appleboy/drone-packer
tags: linux-arm64
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:linux-arm64
settings:
auto_tag: true
auto_tag_suffix: linux-arm64
cache_from: appleboy/drone-packer
daemon_off: false
dockerfile: docker/Dockerfile.linux.arm64
password:
from_secret: docker_password
repo: appleboy/drone-packer
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: linux-arm
platform:
os: linux
arch: arm
steps:
- name: build-push
pull: always
image: golang:1.16
commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-packer"
environment:
CGO_ENABLED: 0
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.16
commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-packer"
environment:
CGO_ENABLED: 0
when:
event:
- tag
- name: executable
pull: always
image: golang:1.16
commands:
- ./release/linux/arm/drone-packer --help
- name: dryrun
pull: always
image: plugins/docker:linux-arm
settings:
cache_from: appleboy/drone-packer
dockerfile: docker/Dockerfile.linux.arm
dry_run: true
repo: appleboy/drone-packer
tags: linux-arm
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:linux-arm
settings:
auto_tag: true
auto_tag_suffix: linux-arm
cache_from: appleboy/drone-packer
daemon_off: false
dockerfile: docker/Dockerfile.linux.arm
password:
from_secret: docker_password
repo: appleboy/drone-packer
username: username:
from_secret: docker_username from_secret: porto_user
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- "refs/pull/**"
- "refs/tags/**"
depends_on:
- testing
---
kind: pipeline
name: release-binary
platform:
os: linux
arch: amd64
steps:
- name: build-all-binary
pull: always
image: golang:1.16
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:
- "dist/release/*"
when:
event:
- tag
trigger:
ref:
- "refs/tags/**"
depends_on:
- testing
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
ignore_missing: true
password: password:
from_secret: docker_password from_secret: porto_pw
spec: docker/manifest.tmpl
username:
from_secret: docker_username
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
depends_on:
- linux-amd64
- linux-arm64
- linux-arm
- release-binary
...

2
README.md

@ -5,7 +5,7 @@
[![codecov](https://codecov.io/gh/appleboy/drone-packer/branch/master/graph/badge.svg)](https://codecov.io/gh/appleboy/drone-packer) [![codecov](https://codecov.io/gh/appleboy/drone-packer/branch/master/graph/badge.svg)](https://codecov.io/gh/appleboy/drone-packer)
[![Go Report Card](https://goreportcard.com/badge/github.com/appleboy/drone-packer)](https://goreportcard.com/report/github.com/appleboy/drone-packer) [![Go Report Card](https://goreportcard.com/badge/github.com/appleboy/drone-packer)](https://goreportcard.com/report/github.com/appleboy/drone-packer)
[![Docker Pulls](https://img.shields.io/docker/pulls/appleboy/drone-packer.svg)](https://hub.docker.com/r/appleboy/drone-packer/) [![Docker Pulls](https://img.shields.io/docker/pulls/appleboy/drone-packer.svg)](https://hub.docker.com/r/appleboy/drone-packer/)
[![Build status](https://ci.appveyor.com/api/projects/status/pmkfbnwtlf1fm45l/branch/master?svg=true)](https://ci.appveyor.com/project/appleboy/drone-packer/branch/master) [![Build Status](https://drone.interlegis.leg.br/api/badges/SEIT/drone-packer/status.svg)](https://drone.interlegis.leg.br/SEIT/drone-packer)
Drone plugin for build Automated machine images with [Packer](https://www.packer.io/). For the usage information and a listing of the available options please take a look at [the docs](http://plugins.drone.io/appleboy/drone-packer/). Drone plugin for build Automated machine images with [Packer](https://www.packer.io/). For the usage information and a listing of the available options please take a look at [the docs](http://plugins.drone.io/appleboy/drone-packer/).

Loading…
Cancel
Save