From d31d30117ff6cd3189c8cfa64d44ee8660b59ab9 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Thu, 6 Oct 2022 21:43:11 +0200 Subject: [PATCH] ci/cd fix --- .drone.yml | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..d90244b --- /dev/null +++ b/.drone.yml @@ -0,0 +1,62 @@ +kind: pipeline +type: docker +name: default + +steps: +- name: static_check + image: golang:latest + commands: + - go install honnef.co/go/tools/cmd/staticcheck@latest + - staticcheck ./src/internal/... + volumes: + - name: gopath + path: /go + +- name: lint + image: golang:latest + commands: + - go install golang.org/x/lint/golint@latest + - golint ./src/internal/... + volumes: + - name: gopath + path: /go + +- name: analyze + image: golang:latest + commands: + - go vet ./src/internal/... + volumes: + - name: gopath + path: /go + +- name: publish_image + image: plugins/docker + environment: + DOCKER_USERNAME: + from_secret: registry_username + DOCKER_PASSWORD: + from_secret: registry_password + commands: + - sleep 5 + - ./deploy/image-build.sh + - ./deploy/image-push.sh + volumes: + - name: docker-sock + path: /var/run + when: + branch: + - main + +services: +- name: docker + image: docker:dind + privileged: true + volumes: + - name: docker-sock + path: /var/run + +volumes: +- name: gopath + temp: {} +- name: docker-sock + temp: {}