Commit b88334e8 authored by Spiros Koulouzis's avatar Spiros Koulouzis

change tosca example & added docker for manager

parent b8dc2f77
...@@ -25,16 +25,16 @@ topology_template: ...@@ -25,16 +25,16 @@ topology_template:
volumes: volumes:
- db_data:/var/lib/mongo - db_data:/var/lib/mongo
environment: environment:
MONGO_INITDB_ROOT_USERNAME: rootUser
MONGO_INITDB_ROOT_PASSWORD: rootPassword MONGO_INITDB_ROOT_PASSWORD: rootPassword
MONGO_INITDB_DATABASE: databaseName MONGO_INITDB_DATABASE: databaseName
MONGO_INITDB_ROOT_USERNAME: rootUser
MONGO_USERNAME: databaseUser MONGO_USERNAME: databaseUser
MONGO_PASSWORD:password MONGO_PASSWORD: password
artifacts: artifacts:
image: image:
type: tosca.artifacts.Deployment.Image.Container.Docker type: tosca.artifacts.Deployment.Image.Container.Docker
file: lakshminp/mongo:4.2.1 file: lakshminp/mongo:4.2.1
repository: docker_hub repository: docker_hub
logspout: logspout:
...@@ -51,7 +51,7 @@ topology_template: ...@@ -51,7 +51,7 @@ topology_template:
image: image:
type: tosca.artifacts.Deployment.Image.Container.Docker type: tosca.artifacts.Deployment.Image.Container.Docker
file: gliderlabs/logspout:latest file: gliderlabs/logspout:latest
repository: docker_hub repository: docker_hub
policies: policies:
- scalability: - scalability:
......
FROM openjdk:11
COPY target/drip-manager-3.0.0.jar drip-manager-3.0.0.jar
CMD jar -xf drip-manager-3.0.0.jar BOOT-INF/classes/application.properties && \
sed -ie "s/^message.broker.host=.*/message.broker.host=$RABBITMQ_HOST/" BOOT-INF/classes/application.properties && \
sed -ie "s/^db.host=.*/db.host=$MONOG_HOST/" BOOT-INF/classes/application.properties && \
sed -ie "s/^sure-tosca.base.path=.*/sure-tosca.base.path=$SURE_TOSCA_BASE_PATH/" BOOT-INF/classes/application.properties && \
cat BOOT-INF/classes/application.properties && \
jar -uf drip-manager-3.0.0.jar BOOT-INF/classes/application.properties && \
java -jar drip-manager-3.0.0.jar
...@@ -9,6 +9,8 @@ import com.rabbitmq.client.ConnectionFactory; ...@@ -9,6 +9,8 @@ import com.rabbitmq.client.ConnectionFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.util.logging.Level;
import java.util.logging.Logger;
/** /**
* *
...@@ -30,6 +32,7 @@ public class RabbitMQConfig { ...@@ -30,6 +32,7 @@ public class RabbitMQConfig {
connectionFactory.setHost(messageBrokerHost); connectionFactory.setHost(messageBrokerHost);
connectionFactory.setUsername(messageBrokerUsername); connectionFactory.setUsername(messageBrokerUsername);
connectionFactory.setPassword(messageBrokerPassword); connectionFactory.setPassword(messageBrokerPassword);
Logger.getLogger(RabbitMQConfig.class.getName()).log(Level.INFO, "ConnectionFactory host: {0}", connectionFactory.getHost());
return connectionFactory; return connectionFactory;
} }
......
...@@ -51,6 +51,7 @@ public class DRIPCaller implements AutoCloseable { ...@@ -51,6 +51,7 @@ public class DRIPCaller implements AutoCloseable {
public DRIPCaller(ConnectionFactory factory) throws IOException, TimeoutException { public DRIPCaller(ConnectionFactory factory) throws IOException, TimeoutException {
this.factory = factory; this.factory = factory;
Logger.getLogger(DRIPCaller.class.getName()).log(Level.INFO, "ConnectionFactory host: {0}", factory.getHost());
// factory.setHost(messageBrokerHost); // factory.setHost(messageBrokerHost);
// factory.setPort(AMQP.PROTOCOL.PORT); // factory.setPort(AMQP.PROTOCOL.PORT);
// factory.setUsername(username); // factory.setUsername(username);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<properties> <properties>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<docker.image.prefix>deth53</docker.image.prefix>
</properties> </properties>
...@@ -101,6 +102,15 @@ ...@@ -101,6 +102,15 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.13</version>
<configuration>
<repository>${docker.image.prefix}/${project.artifactId}</repository>
<tag>${project.version}</tag>
</configuration>
</plugin>
</plugins> </plugins>
......
#!/bin/bash #!/bin/bash
cd drip-manager && mvn -Dmaven.test.skip=true install dockerfile:build cd drip-manager && mvn -Dmaven.test.skip=true dockerfile:build
cd ../
cd drip-planner && mvn -Dmaven.test.skip=true dockerfile:build
cd ../ cd ../
cd sure_tosca-flask-server && docker build -t sure-tosca:3.0.0 . cd sure_tosca-flask-server && docker build -t sure-tosca:3.0.0 .
......
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