hello-ci/.drone.yml

40 lines
1.3 KiB
YAML
Raw Normal View History

2020-02-13 09:31:49 +00:00
kind: pipeline
2020-02-13 17:31:37 +00:00
name: default
2020-02-13 17:07:19 +00:00
2020-02-13 22:15:56 +00:00
volumes:
- name: docker_socket
host:
path: /var/run/docker.sock
2020-02-13 17:34:10 +00:00
2020-02-13 09:31:49 +00:00
steps:
2020-02-14 18:03:04 +00:00
- name: build
2020-02-13 22:23:15 +00:00
image: alexviscreanu/buildx
2020-02-13 17:22:43 +00:00
commands:
2020-02-13 18:34:59 +00:00
- docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
2020-02-14 17:36:46 +00:00
- export BUILDER_ID="crosscomp-$(cat /proc/self/cgroup | head -1 | cut -d '/' -f 3)"
2020-02-18 22:39:40 +00:00
- docker buildx create --use --name $BUILDER_ID --driver-opt image=stargate01/buildkit
2020-02-14 06:05:52 +00:00
- docker buildx inspect --bootstrap
2020-02-14 06:58:44 +00:00
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD registry.chrz.de
2020-02-15 11:24:10 +00:00
- docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --output=type=image,push=true --progress tty
--cache-to=type=registry,ref=registry.chrz.de/cache/hello-ci,mode=max
--cache-from=type=registry,ref=registry.chrz.de/cache/hello-ci
-t registry.chrz.de/public/hello-ci .
2020-02-14 17:36:46 +00:00
- docker buildx rm $BUILDER_ID
2020-02-13 22:15:56 +00:00
volumes:
- name: docker_socket
path: /var/run/docker.sock
2020-02-14 05:09:13 +00:00
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
2020-02-13 09:31:49 +00:00
- name: notify
image: drillster/drone-email
2020-02-13 09:35:25 +00:00
settings:
2020-02-13 10:01:45 +00:00
host: smtp
port: 25
skip_verify: true
2020-02-13 09:58:50 +00:00
from: drone@chrz.de
2020-02-13 09:31:49 +00:00
when:
status: [ success, failure ]