This repository has been archived by the owner on Apr 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
64 lines (61 loc) · 1.65 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
kind: pipeline
name: default
steps:
- name: build staging backend Docker image
image: docker
commands:
- docker build -t fwcli-backend:latest -f backend/Dockerfile backend
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- master
event:
- push
- name: publish staging images to DockerHub
image: docker
environment:
DOCKERHUB_USERNAME:
from_secret: DOCKERHUB_USERNAME
DOCKERHUB_PASSWORD:
from_secret: DOCKERHUB_PASSWORD
DOCKERHUB_ORG_ID:
from_secret: DOCKERHUB_ORG_ID
commands:
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- docker tag fwcli-backend:latest $DOCKERHUB_ORG_ID/fwcli-backend-staging:latest
- docker push $DOCKERHUB_ORG_ID/fwcli-backend-staging:latest
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- master
event:
- push
- name: publish production images to DockerHub
image: docker
environment:
DOCKERHUB_USERNAME:
from_secret: DOCKERHUB_USERNAME
DOCKERHUB_PASSWORD:
from_secret: DOCKERHUB_PASSWORD
DOCKERHUB_ORG_ID:
from_secret: DOCKERHUB_ORG_ID
commands:
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- docker tag fwcli-backend:latest $DOCKERHUB_ORG_ID/fwcli-backend:latest
- docker push $DOCKERHUB_ORG_ID/fwcli-backend:latest
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch:
- production
event:
- push
volumes:
- name: docker
host:
path: /var/run/docker.sock