-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
67 lines (61 loc) · 1.54 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
---
kind: pipeline
type: docker
name: default
steps:
# Restore maven cache from local filesystem
- name: restoring cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
- name: maven-cache
path: /root/.m2
settings:
restore: true
mount:
- /root/.m2
# Compile artifacts with maven
- name: compiling artifacts
image: maven:3-jdk-8
volumes:
- name: maven-cache
path: /root/.m2
commands:
- for bots in images/bots/*; do mvn clean package assembly:single && mv target/ $bots; done
# Build and publish Docker images
- name: building & publishing image
image: docker:dind
network_mode: host
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- for image in images/bots/*; do docker build $image -t localhost:5000/${DRONE_BRANCH}-$(basename $image | tr '[:upper:]' '[:lower:]') && docker push localhost:5000/${DRONE_BRANCH}-$(basename $image | tr '[:upper:]' '[:lower:]'); done
- echo "[INFO]" Bot image published
# Save the cache in the local filesystem
- name: rebuilding cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
- name: maven-cache
path: /root/.m2
settings:
rebuild: true
mount:
- /root/.m2
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
- name: cache
host:
path: /tmp/
- name: maven-cache
temp: {}
trigger:
branch:
- master
event:
- push