Skip to content

Commit

Permalink
Merge pull request #1 from researchstudio-sat/docker_fixed
Browse files Browse the repository at this point in the history
Docker fixed
  • Loading branch information
quasarchimaere authored Sep 27, 2019
2 parents ff92c90 + f3fc7a0 commit a8229c8
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN mvn -f pom.xml clean package
# fix java version here until the following issue is resolved: https://github.com/researchstudio-sat/webofneeds/issues/1229
FROM openjdk:8u121-jdk as botrun
# TODO: FIGURE OUT HOW TO USE CORRECT BUILD JAR
COPY --from=mvnbuild /build/target/debugbot-*.jar /usr/src/bots/bot.jar
COPY --from=mvnbuild /build/target/bot.jar /usr/src/bots/bot.jar
# add certificates directory
RUN mkdir -p /usr/src/bots/client-certs
# start echo bot
Expand Down
57 changes: 49 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>1.5.17.RELEASE</version>
<version>1.5.21.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>1.5.21.RELEASE</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -80,20 +85,56 @@
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.7.RELEASE</version>
<configuration>
<mainClass>won.bot.debugbot.DebugBotApp</mainClass>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>build-bot-uberjar</id>
<phase>package</phase>
<goals>
<goal>repackage</goal>
<goal>shade</goal>
</goals>
<configuration>
<finalName>bot</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<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.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>reference.conf</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>won.bot.debugbot.DebugBotApp</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.factories</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/won/bot/debugbot/DebugBotApp.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
package won.bot.debugbot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;
import won.bot.framework.bot.utils.BotUtils;

@SpringBootConfiguration
@PropertySource("classpath:application.properties")
@ImportResource("classpath:/spring/app/botApp.xml")
public class DebugBotApp {
public static void main(String[] args) {
if (!BotUtils.isValidRunConfig()) {
System.exit(1);
}
SpringApplication app = new SpringApplication("classpath:/spring/app/botApp.xml");

//SpringApplication app = new SpringApplication("classpath:/spring/app/botApp.xml");
SpringApplication app = new SpringApplication(DebugBotApp.class);
app.setWebEnvironment(false);
app.run(args);
// ConfigurableApplicationContext applicationContext = app.run(args);
Expand Down
18 changes: 7 additions & 11 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,27 @@
</appender>

<logger name="won.bot" level="INFO"/>
<logger name="won.bot.framework.bot" level="DEBUG"/>
<logger name="won.bot.framework.manager.impl" level="DEBUG"/>
<logger name="won.bot.framework.component.atomconsumer" level="DEBUG"/>
<logger name="won.bot.debugbot" level="INFO"/>
<logger name="won.bot.framework.bot" level="INFO"/>
<logger name="won.bot.framework.manager.impl" level="INFO"/>
<logger name="won.bot.framework.component.atomconsumer" level="INFO"/>
<logger name="org.springframework.aop" level="INFO"/>
<logger name="won.bot.framework.eventbot.listener" level="INFO"/>
<logger name="won.bot.framework.eventbot.action.impl.mail" level="INFO"/>
<!-- set to DEBUG to get monitoring stats in the log file -->
<logger name="won.monitoring" level="INFO"/>

<!-- START MSGTRACE: set the following to DEBUG to trace messages through the system (high level) -->
<logger name="won.node.protocol.impl.NeedProtocolNeedClient" level="INFO"/>
<logger name="won.node.protocol.impl.NeedProtocolNeedServiceImpl" level="INFO"/>
<logger name="won.node.protocol.impl.OwnerProtocolOwnerClient" level="INFO"/>
<logger name="won.owner.protocol.impl.OwnerProtocolNeedServiceClient" level="INFO"/>
<logger name="won.owner.messaging.OwnerProtocolOwnerServiceImpl" level="INFO"/>
<logger name="won.owner.service.impl" level="INFO"/>
<logger name="won.owner.camel.routes" level="INFO"/>
<logger name="won.owner.messaging" level="INFO"/>
<!-- END MSGTRACE -->

<!-- SET to DEBUG to see bot events -->
<logger name="won.bot.framework.eventbot.bus.impl.AsyncEventBusImpl" level="INFO"/>
<!-- SET to DEBUG to see bot event listeners -->
<logger name="won.bot.framework.eventbot.listener" level="INFO"/>

<!-- SET to DEBUG to see more info about atom creation -->
<logger name="won.bot.framework.component.atomproducer" level="INFO"/>

<!-- Temporal -->
<logger name="won.bot.impl.BAAtomicCCAdditionalParticipants" level="INFO" />
<logger name="won.bot.impl.BAAtomicCCActiveExitingBot" level="INFO" />
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/spring/app/botApp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<context:property-placeholder location="classpath:application.properties" ignore-unresolvable="true"/>
<!--
context that combines bot definitions with runner context
Expand Down

0 comments on commit a8229c8

Please sign in to comment.