iwilldie/.drone.yml
Janic Voser b9ba6cfdb9
Some checks failed
continuous-integration/drone/push Build is failing
debug
2023-03-11 00:07:44 +01:00

89 lines
1.4 KiB
YAML

kind: pipeline
type: docker
name: default
trigger:
branch:
- main
platform:
os: linux
arch: amd64
steps:
# Run go tests
- name: go-test
image: golang
volumes:
- name: deps
path: /go
commands:
- cd src
- go test
# Build go binaries
- name: go-build-bin-amd64
image: golang
volumes:
- name: deps
path: /go
- name: bin
path: /binaries
commands:
- cd src
- go build -o /binaries/app
depends_on:
- go-test
# Build Containers for each architecture
- name: docker-build-image-amd64
image: plugins/docker # Check Entrypoint
volumes:
- name: docker_socket
path: /var/run/docker.sock
- name: bin
path: /binaries
privileged: true
settings:
username:
from_secret: gitea_username
password:
from_secret: gitea_password
repo: gitea.voser.cloud/container/iwilldie
registry: https://gitea.voser.cloud
tags:
- ${DRONE_COMMIT_BRANCH}
- latest
platforms: linux/amd64
context: ./Docker
dockerfile: ./Dockerfile
depends_on:
- "go-build-bin-amd64"
# Run go tests
- name: binary-cleanup
image: alpine:latest
volumes:
- name: bin
path: /binaries
commands:
- rm -rf /binaries/*
when:
status:
- failure
- success
depends_on:
- "go-build-bin-amd64"
- docker-build-image-amd64
# Volumes to mount between steps
volumes:
- name: deps
temp: {}
- name: bin
temp: {}
- name: docker_socket
host:
path: /var/run/docker.sock