-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.drone.yml
More file actions
76 lines (68 loc) · 1.98 KB
/
.drone.yml
File metadata and controls
76 lines (68 loc) · 1.98 KB
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
kind: pipeline
type: docker
name: docker-volume-backup
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: build prod image
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/docker-volume-backup:${DRONE_COMMIT_SHA:0:7} -t adamkoro/docker-volume-backup:latest -t adamkoro/docker-volume-backup:${DRONE_TAG} . --push -f Dockerfile"
when:
branch:
include:
- "main"
event:
- tag
trigger:
event:
#- push
- tag
volumes:
- name: dockersock
temp: {}