-
Notifications
You must be signed in to change notification settings - Fork 6
/
.drone.yml
71 lines (64 loc) · 1.77 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
kind: pipeline
name: {PROJECT_NAME}
trigger:
branch:
- {BRANCH}
event:
- push
volumes:
- name: docker_daemon
host:
path: /var/run/docker.sock
- name: docker_cache
host:
path: /mnt/drone-docker
steps:
- name: build laravel
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 -t registry.vivifyideas.com/{NAMESPACE}/laravel:${DRONE_BRANCH} --pull=true .
- docker push registry.vivifyideas.com/{NAMESPACE}/laravel:${DRONE_BRANCH}
- docker image prune -f
- 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-web -t registry.vivifyideas.com/{NAMESPACE}/web:${DRONE_BRANCH} --pull=true .
- docker push registry.vivifyideas.com/{NAMESPACE}/web:${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: {SLACK_CHANNEL}