80 lines
1.5 KiB
YAML
80 lines
1.5 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
|
|
- name: build
|
|
image: golang
|
|
environment:
|
|
CGO_ENABLED: 1
|
|
GOOS: linux
|
|
commands:
|
|
- go test ./...
|
|
- go build -a -installsuffix cgo .
|
|
|
|
- name: lint
|
|
image: golang
|
|
commands:
|
|
- go get -u golang.org/x/lint/golint
|
|
- golint -set_exit_status ./...
|
|
|
|
- name: vet
|
|
image: golang
|
|
commands:
|
|
- go vet ./...
|
|
|
|
- name: docker
|
|
image: plugins/docker
|
|
settings:
|
|
registry: reg.meutel.net
|
|
repo: reg.meutel.net/go-bouquins
|
|
build_args: "version=${DRONE_TAG}"
|
|
username:
|
|
from_secret: registry_login
|
|
password:
|
|
from_secret: registry_password
|
|
auto_tag: true
|
|
when:
|
|
event:
|
|
- tag
|
|
|
|
- name: docker-branch
|
|
image: plugins/docker
|
|
settings:
|
|
registry: reg.meutel.net
|
|
repo: reg.meutel.net/go-bouquins
|
|
tags: ${DRONE_BRANCH##feature/}
|
|
username:
|
|
from_secret: registry_login
|
|
password:
|
|
from_secret: registry_password
|
|
when:
|
|
branch:
|
|
- feature/*
|
|
|
|
- name: deploy-branch
|
|
image: plugins/ansible:1
|
|
settings:
|
|
playbook: .ansible/deploy-draft.yml
|
|
inventory: .ansible/inventory
|
|
private_key:
|
|
from_secret: drone_ssh_key
|
|
extra_vars:
|
|
- draft_name=${DRONE_BRANCH##feature/}
|
|
when:
|
|
branch:
|
|
- feature/*
|
|
|
|
trigger:
|
|
event:
|
|
- push
|
|
- tag
|
|
|
|
---
|
|
kind: signature
|
|
hmac: 6e0c0bc088332c0b5536e2ec01586d8cad12e7ecd7196c31bd0c48ae7de58c91
|
|
|
|
...
|