Check Docker Build
This commit is contained in:
parent
eb791428e5
commit
0939dfb70b
1 changed files with 48 additions and 7 deletions
55
.drone.yml
55
.drone.yml
|
@ -30,12 +30,53 @@ workspace:
|
|||
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: build
|
||||
image: docker:dind
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: DOCKER_PASSWORD
|
||||
commands:
|
||||
- sleep 10
|
||||
- docker context create build
|
||||
- docker buildx create build --use
|
||||
- echo $DOCKER_PASSWORD | docker login --username Phil --password-stdin gitea.hackmi.ch
|
||||
- |
|
||||
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 \
|
||||
.
|
||||
|
||||
services:
|
||||
- name: docker
|
||||
image: docker:dind
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
temp: {}
|
||||
|
||||
depends_on:
|
||||
- check
|
||||
- check
|
||||
|
||||
# ---
|
||||
# kind: pipeline
|
||||
# name: release
|
||||
|
||||
# workspace:
|
||||
# base: /go
|
||||
# path: src/gitea.hackmi.ch/Phil/goshorly
|
||||
|
||||
# depends_on:
|
||||
# - check
|
||||
# - build
|
Loading…
Reference in a new issue