From a4ec7afc6340650ceb02bb02fb235e680ed14179 Mon Sep 17 00:00:00 2001 From: Joachim Hill-Grannec Date: Thu, 31 Jan 2019 18:12:43 -0500 Subject: [PATCH] update to drone 1.0 and cloud.drone.io --- .drone.yml | 169 ++++++++++++++++++++++++++++++----------------------- README.md | 3 +- 2 files changed, 97 insertions(+), 75 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3b96ff0..7e78511 100755 --- a/.drone.yml +++ b/.drone.yml @@ -1,91 +1,114 @@ +kind: pipeline +name: default + workspace: base: /go path: src/github.com/josmo/drone-rancher -pipeline: - deps: - image: golang:1.10 - pull: true - commands: - - go get -u github.com/golang/dep/cmd/dep - - dep ensure +steps: +- name: deps + image: golang:1.10 + pull: true + commands: + - go get -u github.com/golang/dep/cmd/dep + - dep ensure - test: - image: golang:1.10 - commands: - - go vet - - go test -cover -coverprofile=coverage.out +- name: test + image: golang:1.10 + depends_on: + - deps + commands: + - go vet + - go test -cover -coverprofile=coverage.out - build_linux_amd64: - image: golang:1.10 - group: build - environment: - - GOOS=linux - - GOARCH=amd64 - - CGO_ENABLED=0 - commands: - - | - if test "${DRONE_TAG}" = ""; then - go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/${DRONE_REPO_NAME} - else - go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/${DRONE_REPO_NAME} - fi +- name: build_linux_amd64 + image: golang:1.10 + depends_on: [ test] + environment: + GOOS: linux + GOARCH: amd64 + CGO_ENABLED: 0 + commands: + - | + if test "${DRONE_TAG}" = ""; then + go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/${DRONE_REPO_NAME} + else + go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/${DRONE_REPO_NAME} + fi - build_linux_arm64: - image: golang:1.10 - group: build - environment: - - GOOS=linux - - GOARCH=arm64 - - CGO_ENABLED=0 - commands: - - | - if test "${DRONE_TAG}" = ""; then - go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/${DRONE_REPO_NAME} - else - go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/${DRONE_REPO_NAME} - fi +- name: build_linux_arm64 + image: golang:1.10 + depends_on: [ test ] + environment: + GOOS: linux + GOARCH: arm64 + CGO_ENABLED: 0 + commands: + - | + if test "${DRONE_TAG}" = ""; then + go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/${DRONE_REPO_NAME} + else + go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/${DRONE_REPO_NAME} + fi - build_linux_arm: - image: golang:1.10 - group: build - environment: - - GOOS=linux - - GOARCH=arm - - CGO_ENABLED=0 - - GOARM=7 - commands: - - | - if test "${DRONE_TAG}" = ""; then - go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/${DRONE_REPO_NAME} - else - go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/${DRONE_REPO_NAME} - fi +- name: build_linux_arm + image: golang:1.10 + depends_on: [ test ] + environment: + GOOS: linux + GOARCH: arm + CGO_ENABLED: 0 + GOARM: 7 + commands: + - | + if test "${DRONE_TAG}" = ""; then + go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/${DRONE_REPO_NAME} + else + go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/${DRONE_REPO_NAME} + fi - publish_linux_amd64: - image: plugins/docker - group: publish +- name: publish_linux_amd64 + image: plugins/docker + depends_on: [ build_linux_amd64 ] + settings: auto_tag: true - secrets: [ docker_password, docker_username, plugin_repo ] + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: + from_secret: plugin_repo dockerfile: Dockerfile - when: - event: [ tag, push ] + when: + event: [ tag, push ] - publish_linux_arm64: - image: plugins/docker - group: publish +- name: publish_linux_arm64 + image: plugins/docker + depends_on: [ build_linux_arm64 ] + settings: auto_tag: true auto_tag_suffix: linux-arm64 - secrets: [ docker_password, docker_username, plugin_repo ] + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: + from_secret: plugin_repo dockerfile: Dockerfile.arm64 - when: - event: [ tag, push ] + when: + event: [ tag, push ] - publish_linux_arm: - image: plugins/docker - group: publish +- name: publish_linux_arm + image: plugins/docker + depends_on: [ build_linux_arm ] + settings: auto_tag: true auto_tag_suffix: linux-arm - secrets: [ docker_password, docker_username, plugin_repo ] + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: + from_secret: plugin_repo dockerfile: Dockerfile.arm - when: - event: [ tag, push ] + when: + event: [ tag, push ] diff --git a/README.md b/README.md index 331ce17..0ec491b 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # drone-rancher -[![Build Status](https://drone.seattleslow.com/api/badges/josmo/drone-rancher/status.svg)](https://drone.seattleslow.com/josmo/drone-rancher) +[![Build Status](https://cloud.drone.io/api/badges/josmo/drone-rancher/status.svg)](https://cloud.drone.io/josmo/drone-rancher) [![Join the chat at https://gitter.im/drone/drone](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/drone/drone) [![Go Doc](https://godoc.org/github.com/josmo/drone-rancher?status.svg)](http://godoc.org/github.com/josmo/drone-rancher) [![Go Report](https://goreportcard.com/badge/github.com/josmo/drone-rancher)](https://goreportcard.com/report/github.com/josmo/drone-rancher) @@ -41,4 +41,3 @@ This repo is setup in a way that if you enable a personal drone server to build * Build local ```DRONE_REPO_OWNER=josmo DRONE_REPO_NAME=drone-rancher drone exec``` * on your server just make sure you have DOCKER_USERNAME, DOCKER_PASSWORD, and PLUGIN_REPO set as secrets - \ No newline at end of file