drone-ci-testing/examples/golang-tests/.drone.yml
2019-07-07 23:34:37 +02:00

55 lines
1.1 KiB
YAML

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: {}