-
Notifications
You must be signed in to change notification settings - Fork 32
/
.drone.yml
119 lines (109 loc) · 2.74 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
kind: pipeline
name: default
steps:
# build the project with gradle
- name: gradle-build-war
image: openjdk:11-jdk
commands:
- ./gradlew --no-daemon -b build.gradle clean war
- ls -lisa ./build/libs/
environment:
ORG_GRADLE_PROJECT_githubRepositoryUsername : geopossachs
ORG_GRADLE_PROJECT_githubRepositoryPassword :
from_secret: github_access_token
volumes:
- name: maven-cache
path: /root/.m2
# build the project with maven
- name: maven-package-war
image: maven:3.6-jdk-11
commands:
- mvn -s ./.drone_maven_settings.xml clean package -P geopossachs #-P MavenCentral
- cd ./target/
- ls -lisa
environment:
GITHUB_USERNAME: geopossachs
GITHUB_ACCESS_TOKEN:
from_secret: github_access_token
volumes:
- name: maven-cache
path: /root/.m2
# deploy to 'GitHub Packages'
- name: mirror__maven-deploy-war
when:
repo:
- geopossachs/BootsFacesWeb
image: maven:3.6-jdk-11
commands:
- mvn -s ./.drone_maven_settings.xml clean deploy -P geopossachs -P bootable
environment:
GITHUB_USERNAME: geopossachs
GITHUB_ACCESS_TOKEN:
from_secret: github_access_token
volumes:
- name: maven-cache
path: /root/.m2
# push an image to geopossachs/bootsfaces_showcase:{environment}
- name: mirror__docker-publish
when:
repo:
- geopossachs/BootsFacesWeb
branch:
- system/production
- system/stage
image: plugins/docker
settings:
repo: geopossachs/bootsfaces_showcase
tags: ${DRONE_BRANCH##system/}
dockerfile: Dockerfile-wildfly
username:
from_secret: docker_username
password:
from_secret: docker_password
# boot the app on a docker based runtime
- name: mirror__container-reboot
when:
repo:
- geopossachs/BootsFacesWeb
branch:
- system/production
- system/stage
image: appleboy/drone-ssh
settings:
host:
- showcase.bootsfaces.de
username:
from_secret: rsync_user
key:
from_secret: rsync_key
port:
from_secret: rsync_port
script:
- cd /srv/IaC/bootsfaces-showcase__${DRONE_BRANCH/\//-}/
- docker compose pull
- docker compose up -d --remove-orphans
#
- name: mirror__publish
when:
repo:
- geopossachs/BootsFacesWeb
branch:
- system/production
- system/stage
image: appleboy/drone-scp
settings:
host: showcase.bootsfaces.net
username:
from_secret: master_rsync_user
key:
from_secret: master_rsync_key
port:
from_secret: master_rsync_port
target: /home/tclxd/geopossachs/bootsfaces-showcase__${DRONE_BRANCH/\//-}/
source:
- target/BootsFacesWeb.war
- target/BootsFacesWeb-bootable.jar
volumes:
- name: maven-cache
host:
path: /temp/drone/m2cache