Check Docker Build

This commit is contained in:
Phil 2022-12-23 23:49:03 +01:00
parent eb791428e5
commit 0939dfb70b

View file

@ -30,12 +30,53 @@ workspace:
path: src/gitea.hackmi.ch/Phil/goshorly path: src/gitea.hackmi.ch/Phil/goshorly
steps: steps:
- name: check-format - name: build
image: golang image: docker:dind
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
commands: commands:
- go fmt $(go list ./... | grep -v /vendor/) - sleep 10
- go vet $(go list ./... | grep -v /vendor/) - docker context create build
- go test -race $(go list ./... | grep -v /vendor/) - 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: depends_on:
- check - check
# ---
# kind: pipeline
# name: release
# workspace:
# base: /go
# path: src/gitea.hackmi.ch/Phil/goshorly
# depends_on:
# - check
# - build