-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
60 lines (55 loc) · 2 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
clone:
git:
image: plugins/git
depth: 50
tags: true
pipeline:
run-tests:
image: gwiq/sbt-docker:latest
volumes:
- /var/lib/docker/sbt:/cache
commands:
- sbt -mem 1024 -Djline.terminal=off -Dcoursier.cache=/cache/.coursier -Dsbt.ivy.home=/cache/.ivy2 -Divy.home=/cache/.ivy2 -Dfile.encoding=utf-8 -Dsbt.gigahorse=false test
when:
event: [deployment, tag, push]
publish-artifacts-and-stage-image:
image: gwiq/sbt-docker:latest
volumes:
- /var/lib/docker/sbt:/cache
commands:
- sbt -mem 1024 -Djline.terminal=off -Dcoursier.cache=/cache/.coursier -Dsbt.ivy.home=/cache/.ivy2 -Divy.home=/cache/.ivy2 -Dfile.encoding=utf-8 saturator-api/publish saturator-core/publish saturator-example/docker:stage
secrets: [ bintray_user, bintray_pass ]
when:
event: [deployment, tag]
build-on-deploy:
image: docker:stable
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/.docker:/root/.docker
environment:
- IMAGE_NAME=gwiq/saturator-example
secrets: [ docker_user, docker_password ]
commands:
- docker build -t local/saturator-example:$DRONE_COMMIT_SHA example/target/docker/stage
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
- docker tag local/saturator-example:$DRONE_COMMIT_SHA $IMAGE_NAME:$DRONE_COMMIT_SHA
- docker push $IMAGE_NAME:$DRONE_COMMIT_SHA
when:
event: deployment
build-on-tag:
image: docker:stable
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/.docker:/root/.docker
environment:
- IMAGE_NAME=gwiq/saturator-example
- RELEASE=${DRONE_TAG##v}
secrets: [ docker_user, docker_password ]
commands:
- docker build -t local/saturator-example:$RELEASE example/target/docker/stage
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
- docker tag local/saturator-example:$RELEASE $IMAGE_NAME:$RELEASE
- docker push $IMAGE_NAME:$RELEASE
when:
branch: master
event: tag