diff options
author | Kotagiri, Ramprasad (rp5662) <rp5662@att.com> | 2019-03-28 16:44:25 -0400 |
---|---|---|
committer | Kotagiri, Ramprasad (rp5662) <rp5662@att.com> | 2019-03-28 17:49:25 -0400 |
commit | f6c222cd642ea9e3fab7a502ad74ca955cb4b2b4 (patch) | |
tree | 8fd6622520fc071981f3df159546532997f24e3f /ccsdk-app-os/docker-dashboard-installation.sh | |
parent | f4231f30d53e192e15906245a8dd0e6ef42198e1 (diff) |
Docker container implementation
This change contains following items:
1) Update b2b-library.js to remove non-compliant code
2) Format source code for ccsdk-app-os module
3) Add Dockerfile and artifacts to create docker container
4) Update POM files for docker maven plugin and version changes
Issue-ID: CCSDK-1011
Change-Id: Iae93b32e1d8c2e7b911b044bc07bba6b720742a5
Signed-off-by: ramprasad kotagiri <rp5662@att.com>
Diffstat (limited to 'ccsdk-app-os/docker-dashboard-installation.sh')
-rw-r--r-- | ccsdk-app-os/docker-dashboard-installation.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ccsdk-app-os/docker-dashboard-installation.sh b/ccsdk-app-os/docker-dashboard-installation.sh new file mode 100644 index 0000000..75aa8a0 --- /dev/null +++ b/ccsdk-app-os/docker-dashboard-installation.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Unzip the dashboard war file +unzip -qq -d /home/deployments/ccsdk-app /home/deployments/ccsdk-app.war + +# Delete the dashboard war file +rm -f /home/deployments/ccsdk-app.war + +# Update dashboard.properties +cat /home/deployments/ccsdk-app/WEB-INF/conf/dashboard.properties | \ +sed "s/^dev.is_encrypted.*$/dev.is_encrypted=false/g" | \ +sed "s~^dev.url.*$~dev.url = ${cfy_url}~g" | \ +sed "s~^dev.inventory.url.*$~dev.inventory.url = ${inventory_url}~g" | \ +sed "s~^dev.dhandler.url.*$~dev.dhandler.url = ${dhandler_url}~g" | \ +sed "s~^dev.consul.url.*$~dev.consul.url = ${consul_url}~g" | \ +sed "s/^dev.username.*$/dev.username = ${cloudify_user}/g" | \ +sed "s/^dev.password.*$/dev.password = ${cloudify_password}/g" | \ +sed "s/^controller.env.*$/controller.env = ${app_env}/g" > /tmp/dash.prop +mv /tmp/dash.prop /home/deployments/ccsdk-app/WEB-INF/conf/dashboard.properties + +# Update system.properties +cp /home/deployments/ccsdk-app/WEB-INF/conf/system.properties.template \ +/home/deployments/ccsdk-app/WEB-INF/conf/system.properties +cat /home/deployments/ccsdk-app/WEB-INF/conf/system.properties | \ +sed "s/^db.encrypt_flag.*$/db.encrypt_flag=false/g" | \ +sed "s/postgresql:\/\/.*$/postgresql:\/\/${postgres_ip}:${postgres_port}\/${postgres_db_name}/g" | \ +sed "s/^db.userName.*$/db.userName=${postgres_user_dashboard}/g" | \ +sed "s/^db.password.*$/db.password=${postgres_password_dashboard}/g" > /tmp/sys.prop +mv /tmp/sys.prop /home/deployments/ccsdk-app/WEB-INF/conf/system.properties + +# Repackage the war file +cd /home/deployments/ccsdk-app && zip -rqq ../ccsdk-app.war * && cd - + +# Move the war file to Tomcat webapps directory +mv /home/deployments/ccsdk-app.war $CATALINA_HOME/webapps +rm -Rf /home/deployments/ccsdk-app + +# create the database tables +export PGPASSWORD=$postgres_password_dashboard +psql -h $postgres_ip -U $postgres_user_dashboard $postgres_db_name -f /tmp/create_table.sql +psql -h $postgres_ip -U $postgres_user_dashboard $postgres_db_name -c "update FN_APP set app_username='${aaf_app_user}' where app_id=1" + +# Start the tomcat server +catalina.sh run |