Packer plugin for Drone CI
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

62 lines
1.2 KiB

---
kind: pipeline
name: linux-amd64
type: kubernetes
platform:
os: linux
arch: amd64
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/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: publish
image: plugins/docker
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
dockerfile: docker/Dockerfile.linux.amd64
username:
from_secret: porto_user
password:
from_secret: porto_pw
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- "refs/pull/**"
- "refs/tags/**"