-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
82 lines (75 loc) · 2.01 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
kind: pipeline
type: docker
name: default
environment:
DATABASE_HOST: &database_host postgres-1
DATABASE_NAME: opertusmundi
DATABASE_USER: opertusmundi
steps:
- name: setup-database
image: postgres:10.14-alpine
when:
event:
- push
environment:
DATABASE_POSTGRES_PASSWORD:
from_secret: database_postgres_password
DATABASE_PASSWORD:
from_secret: database_password
PGHOST: *database_host
commands:
- touch ~/.pgpass
- chmod og-rwx ~/.pgpass
- ./.bin/generate-pgpass.sh >~/.pgpass
- (t=30; while ! pg_isready -U postgres -t 5; do t=$((t - 1)); test $${t} -ne 0; sleep 3s; echo '.'; done)
- ./.bin/generate-database-setup.sh | psql -U postgres
- psql -U postgres -l -A -t
- psql -U $${DATABASE_USER} -d $${DATABASE_NAME} -A -t -c '\d'
- name: surefire-tests
image: maven:3.6.3-openjdk-11
when:
event:
- push
environment:
_TEST_QUARKUS_DATASOURCE_PASSWORD:
from_secret: database_password
volumes:
- name: maven-repo
path: /root/.m2
commands:
- >-
export _TEST_QUARKUS_DATASOURCE_USERNAME=$${DATABASE_USER}
export _TEST_QUARKUS_DATASOURCE_REACTIVE_URL=vertx-reactive:postgresql://$${DATABASE_HOST}:5432/$${DATABASE_NAME}
export _TEST_QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION=create
export _TEST_QUARKUS_HIBERNATE_ORM_LOG_SQL=true
- mvn -version
- mvn test -B
- name: publish-image
image: plugins/docker
when:
event:
- tag
settings:
debug: true
context: .
dockerfile: auth_subrequest.dockerfile
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: opertusmundi/auth-subrequest
tags:
- "${DRONE_SEMVER_SHORT}"
- "${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}"
mirror: http://registry-mirror:5000
build_args:
- git_commit=${DRONE_COMMIT}
services:
- name: postgres-1
image: postgis/postgis:10-3.0-alpine
environment:
POSTGRES_PASSWORD:
from_secret: database_postgres_password
volumes:
- name: maven-repo
temp: {}