Commit b215be75 authored by hengwen's avatar hengwen

Fix CI

parent 5bfa62d8
......@@ -37,14 +37,14 @@ stages:
# only:
# - master
masterJobWindows:
stage: windows
script:
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean deploy --settings settings.xml
tags:
- Windows10
only:
- master
#masterJobWindows:
# stage: windows
# script:
# - mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean deploy --settings settings.xml
# tags:
# - Windows10
# only:
# - master
#branchJobWindows:
# stage: windows
......@@ -59,17 +59,15 @@ BranchJobLinux:
tags:
- docker
stage: linux
image: maven:3-jdk-8
# image: maven:3-jdk-8
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
# - apt-get update
# - apt-get install -y openjfx
- cd rpc
- mvn clean install -s ../settings.xml -DskipTests
- cd ../restful
- cd docker
- ./build.sh
- ./run_test.sh
# - docker tag rmi-server:latest $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag rmi-server:latest $CI_REGISTRY_IMAGE:rpc
- docker tag restful-server:latest $CI_REGISTRY_IMAGE:restful
# - docker tag rmi-server:latest $CI_REGISTRY_IMAGE:latest
# - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
# - docker push $CI_REGISTRY_IMAGE:latest
......
......@@ -24,9 +24,9 @@ CURR_DIR=$(pwd)
SIMULATOR_DIR="${CURR_DIR}/../rpc"
# prepare docker image for rpc-server
cd $SIMULATOR_DIR
#cd $SIMULATOR_DIR
# mvn clean install -s ../settings.xml -DskipTests
./build.sh
#../restful/build.sh
# create network
docker network create simulation-network
......@@ -36,6 +36,7 @@ docker run \
--network="simulation-network" \
-d \
--name=zookeeper \
-e "ZOO_MAX_CLIENT_CNXNS=1024" \
zookeeper:latest
# start autopilot server(RMIServer)
......@@ -55,12 +56,12 @@ docker run \
--name=rpc-server \
rpc-server:latest
cd $CURR_DIR
docker build -t server-test-runner -f TestDockerfile ..
cd ${CURR_DIR}
#docker build -t server-test-runner -f ./docker/TestDockerfile .
docker run \
--rm --network="simulation-network" \
-e "ZOO_SERVERS=zookeeper" \
server-test-runner sh -c "cd restful && mvn test -s ../settings.xml" \
montisim-server-builder sh -c "cd restful && mvn test -s ../settings.xml" \
2>&1 | tee result.txt
tail -10 result.txt | grep "BUILD SUCCESS"
......
......@@ -30,10 +30,10 @@
<version>2.0.0</version>
<packaging>pom</packaging>
<!--<modules>-->
<!--<module>rpc</module>-->
<!--<module>restful</module>-->
<!--</modules>-->
<modules>
<module>rpc</module>
<module>restful</module>
</modules>
<properties>
......@@ -118,92 +118,75 @@
<scope>test</scope>
</dependency>
<!-- SFS -->
<dependency>
<groupId>sfs</groupId>
<artifactId>sfs2x</artifactId>
<version>${smartfox.version}</version>
</dependency>
<dependency>
<groupId>sfs</groupId>
<artifactId>sfs2x-core</artifactId>
<version>${smartfox.version}</version>
</dependency>
<!-- MontiSim -->
<dependency>
<groupId>montisim</groupId>
<artifactId>commons</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>montisim-controller</groupId>
<artifactId>library</artifactId>
<version>${montisim.version}</version>
</dependency>
<dependency>
<groupId>montisim-controller</groupId>
<artifactId>control</artifactId>
<version>${montisim.version}</version>
</dependency>
<dependency>
<groupId>montisim-controller</groupId>
<artifactId>navigation</artifactId>
<version>${montisim.version}</version>
</dependency>
<dependency>
<groupId>montisim-simulation</groupId>
<artifactId>environment</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>montisim-simulation</groupId>
<artifactId>vehicle</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>montisim-simulation</groupId>
<artifactId>sensors</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>montisim-simulation</groupId>
<artifactId>network</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>montisim-simulation</groupId>
<artifactId>simulator</artifactId>
<version>2.0.0</version>
</dependency>
<!-- RMI -->
<dependency>
<groupId>montisim</groupId>
<artifactId>rmi-model-server</artifactId>
<version>1.1.1</version>
</dependency>
<!-- Autopilot -->
<dependency>
<groupId>montisim</groupId>
<artifactId>example-autopilot-ema</artifactId>
<version>0.0.5</version>
</dependency>
<!-- SimLong -->
<dependency>
<groupId>de.monticore.lang.montisim</groupId>
<artifactId>SimLang</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.montisim</groupId>
<artifactId>Util</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.montisim</groupId>
<artifactId>Weather</artifactId>
<version>1.0.1</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>montisim</groupId>-->
<!-- <artifactId>commons</artifactId>-->
<!-- <version>1.0.6</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-controller</groupId>-->
<!-- <artifactId>library</artifactId>-->
<!-- <version>${montisim.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-controller</groupId>-->
<!-- <artifactId>control</artifactId>-->
<!-- <version>${montisim.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-controller</groupId>-->
<!-- <artifactId>navigation</artifactId>-->
<!-- <version>${montisim.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>environment</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>vehicle</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>sensors</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>network</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>simulator</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; Autopilot &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>montisim</groupId>-->
<!-- <artifactId>example-autopilot-ema</artifactId>-->
<!-- <version>0.0.5</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; SimLong &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>de.monticore.lang.montisim</groupId>-->
<!-- <artifactId>SimLang</artifactId>-->
<!-- <version>1.0.1</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>de.monticore.lang.montisim</groupId>-->
<!-- <artifactId>Util</artifactId>-->
<!-- <version>1.0.1</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>de.monticore.lang.montisim</groupId>-->
<!-- <artifactId>Weather</artifactId>-->
<!-- <version>1.0.1</version>-->
<!-- </dependency>-->
<!--Unit test-->
<dependency>
<groupId>commons-pool</groupId>
......@@ -220,61 +203,27 @@
<artifactId>sqlite-jdbc</artifactId>
<version>3.23.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
<scope>compile</scope>
</dependency>
</dependencies>
<!-- Set up profiles -->
<profiles>
<profile>
<id>Windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<script.extension>.bat</script.extension>
<sfs.directory>C:\SmartFoxServer_2X\SFS2X</sfs.directory>
<sfs.extensions>${sfs.directory}\extensions\AllInOne</sfs.extensions>
</properties>
</profile>
<profile>
<id>Unix</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<script.extension>.sh</script.extension>
<sfs.extensions>/opt/SmartFoxServer_2X/SFS2X/extensions/AllInOne</sfs.extensions>
</properties>
</profile>
</profiles>
<!-- == PROJECT BUILD SETTINGS =========================================== -->
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
</plugin>
<!-- <plugin>-->
<!-- <artifactId>maven-deploy-plugin</artifactId>-->
<!-- <version>2.8.1</version>-->
<!-- </plugin>-->
<!-- Other Configuration -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler.plugin}</version>
<configuration>
<useIncrementalCompilation>true</useIncrementalCompilation>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <version>${compiler.plugin}</version>-->
<!-- <configuration>-->
<!-- <useIncrementalCompilation>true</useIncrementalCompilation>-->
<!-- <source>${java.version}</source>-->
<!-- <target>${java.version}</target>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!--<plugin>-->
<!--<groupId>org.codehaus.mojo</groupId>-->
......@@ -294,62 +243,62 @@
<!--</configuration>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<!-- Exclude signatures -->
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-shade-plugin</artifactId>-->
<!-- <version>2.4.3</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>shade</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- &lt;!&ndash; Exclude signatures &ndash;&gt;-->
<!-- <filters>-->
<!-- <filter>-->
<!-- <artifact>*:*</artifact>-->
<!-- <excludes>-->
<!-- <exclude>META-INF/*.SF</exclude>-->
<!-- <exclude>META-INF/*.DSA</exclude>-->
<!-- <exclude>META-INF/*.RSA</exclude>-->
<!-- </excludes>-->
<!-- </filter>-->
<!-- </filters>-->
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>package rwth.server.extensions.ZoneExt</mainClass>
</transformer>
</transformers>
<outputFile>${sfs.extensions}/${project.name}.jar</outputFile>
</configuration>
</execution>
</executions>
</plugin>
<!-- <transformers>-->
<!-- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">-->
<!-- <mainClass>package rwth.server.extensions.ZoneExt</mainClass>-->
<!-- </transformer>-->
<!-- </transformers>-->
<!-- <outputFile>${sfs.extensions}/${project.name}.jar</outputFile>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- Source Jar Configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${source.plugin}</version>
<executions>
<execution>
<id>create source jar</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
<configuration>
<excludeResources>false</excludeResources>
<includes>
<include>**/*.java</include>
<include>**/*.ftl</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-source-plugin</artifactId>-->
<!-- <version>${source.plugin}</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>create source jar</id>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>jar-no-fork</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <excludeResources>false</excludeResources>-->
<!-- <includes>-->
<!-- <include>**/*.java</include>-->
<!-- <include>**/*.ftl</include>-->
<!-- </includes>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- to add copyright information automatically-->
<!--
<plugin>
......@@ -393,17 +342,17 @@
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
<!-- aggregated reports for multi-module projects -->
<aggregate>true</aggregate>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.codehaus.mojo</groupId>-->
<!-- <artifactId>cobertura-maven-plugin</artifactId>-->
<!-- <version>2.7</version>-->
<!-- <configuration>-->
<!-- <format>xml</format>-->
<!-- <maxmem>256m</maxmem>-->
<!-- &lt;!&ndash; aggregated reports for multi-module projects &ndash;&gt;-->
<!-- <aggregate>true</aggregate>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- Test coverage -->
<plugin>
......
......@@ -3,12 +3,11 @@ FROM openjdk:8-jdk
WORKDIR /app
RUN apt-get update && \
apt-get install -y openjfx && \
apt-get install -y metis && \
apt-get install -y --no-install-recommends openjfx metis && \
rm -rf /var/lib/apt/lists/* && \
cp /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jfxrt.jar /usr/local/openjdk-8/jre/lib/ext/
COPY ./app.jar ./
COPY --from=montisim-server-builder:latest /app/restful/target/restful.jar ./app.jar
COPY ./app.db ./classes/app.db
CMD java -jar app.jar
#!/usr/bin/env bash
cp ./target/classes/app.db app.db
cp ./target/restful-2.0.0.jar app.jar
docker build -t restful-server .
rm app.db
rm app.jar
......@@ -7,7 +7,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/* && \
cp /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jfxrt.jar /usr/local/openjdk-8/jre/lib/ext/
COPY simulator-rpc.jar ./
COPY --from=montisim-server-builder:latest /app/rpc/target/rpc.jar ./rpc.jar
COPY ./*.fmu ./lib/
CMD java -cp "simulator-rpc.jar:." server.rpc.RpcServer 6000
CMD java -cp "rpc.jar:." server.rpc.RpcServer 6000
#!/usr/bin/env bash
cp ../libs/fmu_for_linux/* ./
cp ./target/rpc-2.0.0-jar-with-dependencies.jar ./simulator-rpc.jar
docker build -t rpc-server .
rm ./*.fmu
rm ./simulator-rpc.jar
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment