-
Notifications
You must be signed in to change notification settings - Fork 41
/
.drone.yml
54 lines (49 loc) · 1.38 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
kind: pipeline
name: <pipeline>
trigger:
branch:
- stage
event:
- push
volumes:
- name: docker_daemon
host:
path: /var/run/docker.sock
- name: docker_cache
host:
path: /mnt/drone-docker
steps:
- name: build web
image: docker:dind
environment:
REGISTRY_USER:
from_secret: docker_username
REGISTRY_PASS:
from_secret: docker_password
volumes:
- name: docker_cache
path: /var/lib/docker
- name: docker_daemon
path: /var/run/docker.sock
commands:
- docker login -u $REGISTRY_USER -p $REGISTRY_PASS registry.vivifyideas.com
- docker build -f Dockerfile -t registry.vivifyideas.com/<namespace>/web:${DRONE_BRANCH} --build-arg REQUIREMENTS_FILE=prod.txt --pull=true .
- docker push registry.vivifyideas.com/<namespace>/web:${DRONE_BRANCH}
- docker build -f Dockerfile-static -t registry.vivifyideas.com/<namespace>/static:${DRONE_BRANCH} --pull=true .
- docker push registry.vivifyideas.com/<namespace>/static:${DRONE_BRANCH}
- docker image prune -f
- name: deploy
image: alpine
environment:
BRANCH: ${DRONE_BRANCH}
commands:
- apk add --no-cache curl
- sh deploy.sh
- name: slack
image: plugins/slack
when:
status: [ success, failure ]
settings:
webhook:
from_secret: slack_webhook
channel: <channel>