From f53c8328594345d8cedbbe014900e77885838759 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Mon, 18 Mar 2019 21:48:05 +0100 Subject: [PATCH] Cleanup .drone.yml --- .drone.yml | 65 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/.drone.yml b/.drone.yml index 37b55a6..8e24d3a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,22 +1,47 @@ -pipeline: - build: - image: golang - commands: - - go get p83.nl/go/websub-hub/cmd/hubserver - - go build p83.nl/go/websub-hub/cmd/hubserver +kind: pipeline +name: default - publish: - image: plugins/docker - repo: registry.stuifzandapp.com/websub-hub - registry: registry.stuifzandapp.com - secrets: [ docker_username, docker_password ] +workspace: + base: /go + path: src/p83.nl/go/websub-hub - deploy: - image: appleboy/drone-ssh - host: hub.stuifzandapp.com - username: hub - secrets: ['ssh_key'] - script: - - cd /home/hub/hub - - docker-compose pull - - docker-compose up -d +steps: + - name: testing + image: golang:1.12-alpine + commands: + - export GOPATH=/go + - export CGO_ENABLED=0 + - apk --no-cache add git + - go get -d -t ./... + - go build ./... + - go test ./... + + - name: publish + image: plugins/docker + settings: + repo: registry.stuifzandapp.com/websub-hub + registry: registry.stuifzandapp.com + username: + from_secret: docker_username + password: + from_secret: docker_password + + - name: deploy + image: appleboy/drone-ssh + settings: + host: hub.stuifzandapp.com + username: hub + ssh_key: + from_secret: ssh_key + script: + - cd /home/hub/hub + - docker-compose pull web + - docker-compose up -d + + - name: notify + image: plugins/webhook + settings: + debug: true + secrets: + - source: result_webhook + target: plugin_urls