goshorly/.drone.yml

64 lines
1.3 KiB
YAML
Raw Normal View History

2022-12-23 22:20:22 +00:00
---
2022-12-23 22:02:20 +00:00
kind: pipeline
2022-12-23 22:20:22 +00:00
name: check
2022-12-23 22:02:20 +00:00
2022-12-23 22:18:11 +00:00
workspace:
base: /go
path: src/gitea.hackmi.ch/Phil/goshorly
steps:
- name: check-format
image: golang
commands:
- go fmt $(go list ./... | grep -v /vendor/)
- go vet $(go list ./... | grep -v /vendor/)
- go test -race $(go list ./... | grep -v /vendor/)
- name: check-sec
image: golang
commands:
- go install github.com/securego/gosec/v2/cmd/gosec@latest
- go get -v -d .
- gosec ./...
2022-12-23 22:20:22 +00:00
---
2022-12-23 22:18:11 +00:00
kind: pipeline
2022-12-23 22:20:22 +00:00
name: build
2022-12-23 22:18:11 +00:00
2022-12-23 22:02:20 +00:00
steps:
2022-12-23 23:02:06 +00:00
- name: build-docker
image: docker:dind
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
commands:
2022-12-23 23:09:02 +00:00
- sleep 30
2022-12-23 23:02:06 +00:00
- docker ps -a
2022-12-23 22:49:03 +00:00
- docker context create build
- docker buildx create build --use
- echo $DOCKER_PASSWORD | docker login --username Phil --password-stdin gitea.hackmi.ch
2022-12-23 23:15:17 +00:00
- docker buildx build
--platform linux/amd64
--no-cache
--build-arg CI_COMMIT_BRANCH=$DRONE_COMMIT_BRANCH
--build-arg CI_COMMIT_SHORT_SHA=$DRONE_COMMIT_SHA
--build-arg CI_COMMIT_TAG=latest
--push
--tag gitea.hackmi.ch/Phil/goshorly:latest
2022-12-23 22:50:04 +00:00
.
2022-12-23 22:49:03 +00:00
services:
2022-12-23 23:02:06 +00:00
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
2022-12-23 22:49:03 +00:00
volumes:
2022-12-23 23:02:06 +00:00
- name: dockersock
temp: {}