Commit 5b9f8f51 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added properties

parent 1f2b284f
...@@ -40,6 +40,8 @@ public class MongoConfig extends AbstractMongoConfiguration { ...@@ -40,6 +40,8 @@ public class MongoConfig extends AbstractMongoConfiguration {
@Value("${db.name}") @Value("${db.name}")
private String dbName; private String dbName;
@Value("${db.host}")
private String dbHost;
@Value("${db.username}") @Value("${db.username}")
private String dbUsername; private String dbUsername;
@Value("${db.password}") @Value("${db.password}")
...@@ -56,7 +58,7 @@ public class MongoConfig extends AbstractMongoConfiguration { ...@@ -56,7 +58,7 @@ public class MongoConfig extends AbstractMongoConfiguration {
@Override @Override
public Mongo mongo() throws Exception { public Mongo mongo() throws Exception {
return new MongoClient("127.0.0.1", 27017); return new MongoClient(dbHost, 27017);
} }
@Override @Override
......
message.broker.host=127.0.0.1 message.broker.host=127.0.0.1
dbHost=127.0.0.1
db.name=drip db.name=drip
db.username=drip-user db.username=drip-user
db.password=drip-pass db.password=drip-pass
...@@ -10,8 +10,14 @@ import docker_engine ...@@ -10,8 +10,14 @@ import docker_engine
import docker_swarm import docker_swarm
import control_agent import control_agent
print sys.argv
if len(sys.argv) > 1:
rabbitmq_host = sys.argv[1]
else:
rabbitmq_host = '127.0.0.1'
connection = pika.BlockingConnection(pika.ConnectionParameters(host='127.0.0.1'))
connection = pika.BlockingConnection(pika.ConnectionParameters(host=rabbitmq_host))
channel = connection.channel() channel = connection.channel()
channel.queue_declare(queue='deployer_queue') channel.queue_declare(queue='deployer_queue')
......
...@@ -15,12 +15,14 @@ import random ...@@ -15,12 +15,14 @@ import random
import time import time
import json import json
print "---------" print sys.argv
if len(sys.argv) > 1: if len(sys.argv) > 1:
rabbitmq_host = sys.argv[1] rabbitmq_host = sys.argv[1]
else: else:
rabbitmq_host = '127.0.0.1' rabbitmq_host = '127.0.0.1'
print "Trying to connect to: %s" %rabbitmq_host
connection = pika.BlockingConnection(pika.ConnectionParameters(host=rabbitmq_host)) connection = pika.BlockingConnection(pika.ConnectionParameters(host=rabbitmq_host))
channel = connection.channel() channel = connection.channel()
......
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