-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
136 lines (131 loc) · 5.59 KB
/
docker-compose.yml
File metadata and controls
136 lines (131 loc) · 5.59 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
version: '2.1'
services:
maven-base:
# 1.) Do not use the alpine image as it fails frontend-maven-plugin:install-node-and-yarn
# https://github.com/eirslett/frontend-maven-plugin/issues/743
# 2.) Avoid 3.5.4 or higher for now, surefire fails due to a broken openjdk package
# https://github.com/carlossg/docker-maven/issues/90
# 3.) Using > 3.5.0 because of timestamp issues with -SNAPSHOT dependencies
# https://issues.apache.org/jira/browse/MDEPLOY-221
image: 'ax-maven-with-build-tools:3.5.2-jdk-8'
build:
context: .
dockerfile: 'docker-build-files/Dockerfile'
working_dir: '${WORKING_DIR:-/usr/src/app}'
volumes:
- '../:/usr/src/app:delegated'
- './docker-build-files/wait-for-it.sh:/root/wait-for-it.sh'
- './docker-build-files/wait-for-datasource.jar:/root/wait-for-datasource.jar'
# TODO: should we map the dev-configs volume or just include it in our repo?
- './docker-build-files/dev-configs:/root/dev-configs'
# Reuse the maven repository from the host, we could omit it, but it would fetch at each build
- '${HOME}/.m2:/root/.m2:delegated'
# Reuse embedded mongo db downloads
- '${HOME}/.embedmongo:/root/.embedmongo:delegated'
# Share our GPG keys with underlying container
- '${HOME}/.gnupg:/root/.gnupg:delegated'
- '/var/run/docker.sock:/var/run/docker.sock'
# WINDOWS USERS using cmd.exe:
#- '${USERPROFILE}/.m2:/root/.m2'
environment:
# Specify the timezone - used by date tests
TZ: "Europe/Brussels"
# Specify a language - used by LocaleContextHolder
LANG: "en_US.UTF-8"
# Required by embedded mongo db - across-autoconfigure/test-projects
LC_ALL: "C"
# Faster maven startup https://jrebel.com/rebellabs/your-maven-build-is-slow-speed-it-up/
MAVEN_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
### Sonar ########
#
# docker-compose up --exit-code-from sonar --abort-on-container-exit sonar
# docker-compose rm -f -s -v sonar
#
####################
sonar:
extends:
service: 'maven-base'
command: sh -c "mvn -U --batch-mode org.jacoco:jacoco-maven-plugin:prepare-agent clean install -Dmaven.javadoc.skip=true -Pcoverage-per-test && mvn --batch-mode sonar:sonar -P!sonar,ax-sonarcloud -Dsonar.projectKey=$ACROSS_PLAN_KEY -Dsonar.branch.name=$bamboo_planRepository_branchName"
### H2 ########
#
# docker-compose up --exit-code-from crossdb-test-h2 --abort-on-container-exit crossdb-test-h2
# docker-compose rm -s -f -v crossdb-test-h2
#
####################
crossdb-test-h2:
extends:
service: 'maven-base'
command: sh -c "mvn --batch-mode clean test-compile failsafe:integration-test failsafe:verify -Dmaven.javadoc.skip=true -DacrossTest.datasource=h2"
### MySQL ########
#
# docker-compose up --exit-code-from crossdb-test-mysql --abort-on-container-exit mysql crossdb-test-mysql
# docker-compose rm -s -f -v mysql crossdb-test-mysql
#
####################
crossdb-test-mysql:
extends:
service: 'maven-base'
#command: 'mvn clean test-compile failsafe:integration-test failsafe:verify -Dmaven.javadoc.skip=true -DacrossTest.datasource=mysql'
command: sh -c "java -Ddatasource=mysql -jar /root/wait-for-datasource.jar && mvn --batch-mode clean test-compile failsafe:integration-test failsafe:verify -Dmaven.javadoc.skip=true -DacrossTest.datasource=mysql"
depends_on:
- 'mysql'
mysql:
image: 'mysql:5.5'
restart: 'always'
ports:
- "3306:3306"
tmpfs:
- /var/lib/mysql:rw
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_DATABASE=axt
- MYSQL_USER=axt
- MYSQL_PASSWORD=across_test
- MYSQL_ALLOW_EMPTY_PASSWORD=true
### PostgreSQL ########
#
# docker-compose up --exit-code-from crossdb-test-postgres --abort-on-container-exit postgres crossdb-test-postgres
# docker-compose rm -s -f -v postgres crossdb-test-postgres
#
####################
crossdb-test-postgres:
extends:
service: 'maven-base'
command: sh -c "java -Ddatasource=postgres -jar /root/wait-for-datasource.jar && mvn --batch-mode clean test-compile failsafe:integration-test failsafe:verify -Dmaven.javadoc.skip=true -DacrossTest.datasource=postgres"
#command: 'mvn clean test-compile failsafe:integration-test failsafe:verify -Dmaven.javadoc.skip=true -DacrossTest.datasource=postgres'
depends_on:
- 'postgres'
postgres:
image: 'postgres:9.6.11'
restart: 'always'
ports:
- "5432:5432"
tmpfs:
- /var/lib/postgresql/data:rw
environment:
- POSTGRES_DB=axt
- POSTGRES_USER=axt
- POSTGRES_PASSWORD=across_test
### Microsoft SQL Server ########
#
# docker-compose up --exit-code-from crossdb-test-mssql --abort-on-container-exit mssql crossdb-test-mssql
# docker-compose rm -s -f -v mssql crossdb-test-mssql
#
#################################
crossdb-test-mssql:
extends:
service: 'maven-base'
#command: 'mvn clean test-compile failsafe:integration-test failsafe:verify -Dmaven.javadoc.skip=true -DacrossTest.datasource=mssql'
command: sh -c "java -Ddatasource=mssql -jar /root/wait-for-datasource.jar && mvn --batch-mode clean test-compile failsafe:integration-test failsafe:verify -Dmaven.javadoc.skip=true -DacrossTest.datasource=mssql"
depends_on:
- 'mssql'
mssql:
image: microsoft/mssql-server-linux:2017-latest
hostname: 'sqlserver'
environment:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: across_tEst
MSSQL_PID: Developer
# TODO: https://github.com/Microsoft/mssql-docker/issues/11
ports:
- '1433:1433'