-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
96 lines (87 loc) · 2.35 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
kind: pipeline
type: docker
name: ts3 exporter
platform:
os: linux
arch: amd64
node:
type: hosted-amd64
services:
- name: docker service
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run/
steps:
- name: wait for docker service
image: docker:dind
volumes:
- name: dockersock
path: /var/run/
commands:
- while true; do docker info > /dev/null 2>&1 && echo "Docker server up" && break || (echo "Docker server down. Retrying..." && sleep 1); done
# - name: build dev image
# image: docker:dind
# environment:
# REGISTRY_USER:
# from_secret: registry_user
# REGISTRY_PASSWORD:
# from_secret: registry_password
# volumes:
# - name: dockersock
# path: /var/run/
# commands:
# - docker login -u $REGISTRY_USER -p $REGISTRY_PASSWORD registry.adamkoro.com
# - docker buildx create --use --name mybuilder
# - docker buildx build --platform linux/amd64 -t registry.adamkoro.com/docker-volume-backup/${DRONE_BRANCH}/docker-volume-backup:${DRONE_COMMIT_SHA:0:7} -t registry.adamkoro.com/docker-volume-backup/${DRONE_BRANCH}/docker-volume-backup:latest . --push -f Dockerfile
# when:
# branch:
# exclude:
# - "main"
- name: prod image build
image: docker:dind
environment:
REGISTRY_USER:
from_secret: docker_user
REGISTRY_PASSWORD:
from_secret: docker_pass
volumes:
- name: dockersock
path: /var/run/
commands:
- "docker login -u $REGISTRY_USER -p $REGISTRY_PASSWORD"
- "docker buildx create --use --name mybuilder"
- "docker buildx build --platform linux/amd64 -t adamkoro/ts3exporter:latest -t adamkoro/ts3exporter:${DRONE_TAG} . --push -f Dockerfile --build-arg TS3EXPORTER_VERSION=$(cat ./VERSION)"
when:
branch:
include:
- "main"
event:
- tag
#- name: combustion release
# image: plugins/github-release
# pull: always
# settings:
# api_key:
# from_secret: github_token
# files:
# - Dockerfile.combustion
# title: VERSION
# checksum:
# - sha512
# note: CHANGELOG.md
# overwrite: true
# when:
# branch:
# include:
# - "main"
# event:
# - tag
trigger:
event:
#- push
- tag
volumes:
- name: dockersock
temp: {}