lunch-go/.drone.yml

77 lines
1.3 KiB
YAML
Raw Normal View History

2023-08-25 11:04:22 +00:00
---
kind: pipeline
type: kubernetes
2023-08-25 11:52:42 +00:00
name: build
2023-08-25 11:04:22 +00:00
platform:
os: linux
arch: amd64
steps:
2023-08-25 11:52:42 +00:00
- name: formatting-check
image: golang
commands:
- test -z $(gofmt -l .)
2023-08-25 11:04:22 +00:00
- name: build
2023-08-25 11:52:42 +00:00
image: docker:dind
volumes:
- name: dockersock
path: /var/run
commands:
2023-08-25 11:57:51 +00:00
- while [ ! -S "/var/run/docker.sock" ] ; do sleep 1s ; done
2023-08-25 11:52:42 +00:00
- docker build -f Dockerfile .
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
2023-08-25 12:03:39 +00:00
trigger:
event:
- push
2023-08-25 11:52:42 +00:00
---
kind: pipeline
type: kubernetes
name: deploy
platform:
os: linux
arch: amd64
steps:
- name: deploy
image: docker:dind
2023-08-25 11:48:54 +00:00
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
2023-08-25 11:52:42 +00:00
volumes:
- name: dockersock
path: /var/run
2023-08-25 11:04:22 +00:00
commands:
2023-08-25 12:03:39 +00:00
- while [ ! -S "/var/run/docker.sock" ] ; do sleep 1s ; done
2023-08-25 11:52:42 +00:00
- docker login "docker.zvon.tech" --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- docker buildx create --use
- docker buildx build -f Dockerfile -t "docker.zvon.tech/lunch-go:${DRONE_TAG}" --platform linux/amd64,linux/arm64 --push .
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
trigger:
event:
- tag