-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
84 lines (69 loc) · 5.89 KB
/
Dockerfile
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
#
# Copyright (c) 2022 TerraFrame, Inc. All rights reserved.
#
# This file is part of Runway SDK(tm).
#
# Runway SDK(tm) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Runway SDK(tm) is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with Runway SDK(tm). If not, see <http://www.gnu.org/licenses/>.
#
FROM maven:3-openjdk-11
ENV DATA_ACCESS=true
ENV BUSINESS=true
ENV FACADE=true
ENV VAULT=true
ENV QUERY=true
ENV MULTITHREADED=false
ENV ONTOLOGY=true
ENV SESSION=true
ENV GRAPH=true
ENV SCHEDULER=true
ENV LOG_LEVEL=warning
ENV POSTGRES_HOST=localhost
ENV POSTGRES_PORT=5432
ENV ORIENTDB_HOST="remote:localhost"
ENV RUNWAY_WORKSPACE=/runwaysdk
ENV MAVEN_OPTS="-Xmx3500M -Xms256M -XX:+HeapDumpOnOutOfMemoryError"
ENV MAVEN_TEST_FORK_COUNT=0
ENV RUNWAY_TEST_IGNORE_DIMENSION_TESTS=true
RUN mkdir $RUNWAY_WORKSPACE
WORKDIR $RUNWAY_WORKSPACE
# Copy the source in
COPY . $RUNWAY_WORKSPACE
# Log4j properties
RUN wget -nv -O $RUNWAY_WORKSPACE/runwaysdk-test/src/main/resources/log4j2.xml https://raw.githubusercontent.com/terraframe/geoprism-cloud/dev/ansible/roles/webserver/files/log4j2.xml
RUN sed -i -e "s/<Root level=\"error\">/<Root level=\"$LOG_LEVEL\">/g" $RUNWAY_WORKSPACE/runwaysdk-test/src/main/resources/log4j2.xml
# Configure properties files
RUN echo "appcfg=dev\nproject.basedir=$RUNWAY_WORKSPACE\nmaven.m2=/root/.m2" > $RUNWAY_WORKSPACE/envcfg/envcfg.properties
# Generate class files
RUN mvn clean install
# Set the local classpath
WORKDIR $RUNWAY_WORKSPACE/runwaysdk-test
RUN mvn dependency:build-classpath -Dmdep.pathSeparator=";" -Dmdep.outputFile=$RUNWAY_WORKSPACE/runwaysdk-test/target/build-classpath.out
RUN LOCAL_CLASSPATH=$(cat $RUNWAY_WORKSPACE/runwaysdk-test/target/build-classpath.out) && ESCAPED_LOCAL_CLASSPATH=$(printf '%s\n' "$LOCAL_CLASSPATH" | sed -e 's/[]\/$*.^[]/\\&/g') && sed -i -e "s|local\.classpath=.*|local.classpath=$ESCAPED_LOCAL_CLASSPATH|g" $RUNWAY_WORKSPACE/envcfg/dev/runwaysdk/common.properties
WORKDIR $RUNWAY_WORKSPACE
RUN mkdir $RUNWAY_WORKSPACE/bin
RUN wget -nv -O $RUNWAY_WORKSPACE/bin/wait-for-it.sh https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
RUN chmod +x $RUNWAY_WORKSPACE/bin/wait-for-it.sh
# The tests are split up like this because otherwise it runs out of memory (memory leak?)
CMD $RUNWAY_WORKSPACE/bin/wait-for-it.sh -t 60 $POSTGRES_HOST:$POSTGRES_PORT -- \
&& cd runwaysdk-test && mvn process-resources -P build-database -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Droot.clean=true -Dpatch=false \
&& ($DATA_ACCESS && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/DataAccessTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true); \
($BUSINESS && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/BusinessTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true); \
($FACADE && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/FacadeTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true); \
($VAULT && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/VaultTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true); \
($QUERY && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/QueryTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true); \
($MULTITHREADED && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/MultiThreadTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true); \
($ONTOLOGY && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/OntologyTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true); \
($SESSION && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/SessionTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true); \
($SCHEDULER && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/SchedulerTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true); \
($GRAPH && mvn test -DforkCount=$MAVEN_TEST_FORK_COUNT -Dtest="com/runwaysdk/test/GraphTS.java" -Dorientdb.db.url=$ORIENTDB_HOST -Ddatabase.hostURL=$POSTGRES_HOST -Ddatabase.port=$POSTGRES_PORT -Drunway.keepSource=false -Drunway.keepBaseSource=false -Drunway.session.allowSystemLogin=true)