Commit 7045ab35 authored by Daniel Seybold's avatar Daniel Seybold

refactored entrypoint

parent 5cb11484
Pipeline #46263 passed with stage
in 6 minutes and 34 seconds
......@@ -41,6 +41,22 @@ function writeConfigOptions(){
cat /etc/docker-config/application.conf | envsubst > /opt/cloudiator/colosseum-0.2.0-SNAPSHOT/conf/application.conf
cp /etc/docker-config/logback.xml /opt/cloudiator/colosseum-0.2.0-SNAPSHOT/conf/
}
function addCertificate(){
CERT_FILE="/tmp/mowgli.crt"
if [ -f "$CERT_FILE" ];
then
echo "Found certificate file! Adding certificate to java keystore!"
keytool -import -trustcacerts -keystore /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/security/cacerts -storepass changeit -noprompt -alias mycert -file $CERT_FILE
else
echo "Found no certificate file under $CERT_FILE ! Skipping add certificate step!"
fi
}
function init(){
## pre-config initialization
......@@ -48,6 +64,9 @@ function init(){
# write file based config options
writeConfigOptions
echo "adding certificate files to Java keystore..."
addCertificate
## post-config initialization
# check for MariaDB
......@@ -60,20 +79,7 @@ function init(){
##############################################################################
function addCertificate(){
CERT_FILE="/tmp/mowgli.crt"
if [ -f "$CERT_FILE" ];
then
echo "Found certificate file! Adding certificate to java keystore!"
keytool -import -trustcacerts -keystore /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/security/cacerts -storepass changeit -noprompt -alias mycert -file /tmp/mowgli.crt
else
echo "Found no certificate file under /tmp/certificates/mowgli.crt ! Skipping add certificate step!"
fi
}
function checkDatabase(){
......@@ -83,16 +89,11 @@ function checkDatabase(){
function colosseum_service(){
echo "adding certificate files to Java keystore..."
addCertificate
echo "starting colosseum..."
#delete PID file
rm /opt/cloudiator/colosseum-0.2.0-SNAPSHOT/RUNNING_PID
# resolve public IP
#PUBLIC_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
echo "starting colosseum..."
/opt/cloudiator/colosseum-0.2.0-SNAPSHOT/bin/colosseum -Dconfig.file=/opt/cloudiator/colosseum-0.2.0-SNAPSHOT/conf/application.conf -Dlca.client.config.registry=etcdregistry -Dlca.client.config.registry.etcd.hosts=${PUBLIC_IP} 2>&1
......
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