From 31ea44b53ac8d8c38788bfed4f9f63227a1d140d Mon Sep 17 00:00:00 2001 From: Ruan Bekker Date: Sun, 7 Jul 2019 23:34:37 +0200 Subject: [PATCH] Create .drone.yml --- examples/golang-tests/.drone.yml | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 examples/golang-tests/.drone.yml diff --git a/examples/golang-tests/.drone.yml b/examples/golang-tests/.drone.yml new file mode 100644 index 0000000..297e702 --- /dev/null +++ b/examples/golang-tests/.drone.yml @@ -0,0 +1,55 @@ +kind: pipeline +name: default + +steps: + - name: test + image: golang:alpine + volumes: + - name: cache + path: /tmp/cache + commands: + - go test -cover -v + - echo $$HOSTNAME >> /tmp/cache/hostname.txt + - env + + - name: build + image: golang:alpine + volumes: + - name: cache + path: /tmp/cache + commands: + - go build -o app . + - echo $$HOSTNAME >> /tmp/cache/hostname.txt + + - name: run + image: golang:alpine + volumes: + - name: cache + path: /tmp/cache + commands: + - ./app + - echo $$HOSTNAME >> /tmp/cache/hostname.txt + + - name: docker-build + image: docker:dind + volumes: + - name: docker-socket + path: /var/run/docker.sock + commands: + - docker build -t ruanbekker/golang:$$DRONE_COMMIT_SHA . + + - name: docker-deploy + image: docker:dind + volumes: + - name: docker-socket + path: /var/run/docker.sock + commands: + - docker run ruanbekker/golang:$$DRONE_COMMIT_SHA + - docker ps + +volumes: + - name: docker-socket + host: + path: /var/run/docker.sock + - name: cache + temp: {}