0
0
mirror of https://github.com/thegeeklab/wp-ansible.git synced 2024-09-19 15:02:47 +02:00
wp-ansible/.drone.yml
Bo-Yi Wu 368c0c6232 upgrade go version.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-01-09 01:06:40 +08:00

148 lines
3.9 KiB
YAML

workspace:
base: /go
path: src/github.com/drone-plugins/drone-ansible
pipeline:
test:
image: golang:1.11
pull: true
environment:
- GO111MODULE=on
commands:
- go vet ./...
- go test -cover ./...
build_linux_amd64:
image: golang:1.11
pull: true
group: build
environment:
- GOOS=linux
- GOARCH=amd64
- CGO_ENABLED=0
- GO111MODULE=on
commands:
- |
if test "${DRONE_TAG}" = ""; then
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-ansible
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-ansible
fi
# build_linux_i386:
# image: golang:1.11
# pull: true
# group: build
# environment:
# - GOOS=linux
# - GOARCH=386
# - CGO_ENABLED=0
# - GO111MODULE=on
# commands:
# - |
# if test "${DRONE_TAG}" = ""; then
# go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-ansible
# else
# go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-ansible
# fi
# build_linux_arm64:
# image: golang:1.11
# pull: true
# group: build
# environment:
# - GOOS=linux
# - GOARCH=arm64
# - CGO_ENABLED=0
# - GO111MODULE=on
# commands:
# - |
# if test "${DRONE_TAG}" = ""; then
# go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-ansible
# else
# go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-ansible
# fi
# build_linux_arm:
# image: golang:1.11
# pull: true
# group: build
# environment:
# - GOOS=linux
# - GOARCH=arm
# - CGO_ENABLED=0
# - GOARM=7
# - GO111MODULE=on
# commands:
# - |
# if test "${DRONE_TAG}" = ""; then
# go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-ansible
# else
# go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-ansible
# fi
publish_linux_amd64:
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
group: docker
repo: plugins/ansible
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: Dockerfile
when:
event: [ push, tag ]
# publish_linux_i386:
# image: plugins/docker:17.12
# pull: true
# secrets: [ docker_username, docker_password ]
# group: docker
# repo: plugins/ansible
# auto_tag: true
# auto_tag_suffix: linux-i386
# dockerfile: Dockerfile.i386
# when:
# event: [ push, tag ]
# publish_linux_arm64:
# image: plugins/docker:17.12
# pull: true
# secrets: [ docker_username, docker_password ]
# group: docker
# repo: plugins/ansible
# auto_tag: true
# auto_tag_suffix: linux-arm64
# dockerfile: Dockerfile.arm64
# when:
# event: [ push, tag ]
# publish_linux_arm:
# image: plugins/docker:17.12
# pull: true
# secrets: [ docker_username, docker_password ]
# group: docker
# repo: plugins/ansible
# auto_tag: true
# auto_tag_suffix: linux-arm
# dockerfile: Dockerfile.arm
# when:
# event: [ push, tag ]
manifests:
image: plugins/manifest:1
pull: true
secrets: [ docker_username, docker_password ]
spec: manifest.tmpl
auto_tag: true
ignore_missing: true
when:
event: [ push, tag ]
microbadger:
image: plugins/webhook:1
pull: true
secrets: [ webhook_url ]
when:
status: [ success ]