Merge "Upgrade APPC to use common mariadb galera charts"
[oom.git] / kubernetes / common / dgbuilder / resources / scripts / createReleaseDir.sh
index 38f7fe2..aaf7a26 100755 (executable)
@@ -1,3 +1,17 @@
+# Copyright © 2018 AT&T, Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 #!/bin/bash
 export PATH=$PATH:.
 appDir=$(pwd)
@@ -6,7 +20,7 @@ then
        echo "Usage $0 releaseDir  loginId emailAddress [gitLocalRepository]"
        echo "Note: Specify the gitLocalRepository path if you would want to be able to import flows from your local git repository"
        exit
-fi 
+fi
 if [ ! -e "releases" ]
 then
        mkdir releases
@@ -15,11 +29,11 @@ releaseDir="$1"
 name="Release $releaseDir"
 loginId="$2"
 emailid="$3"
-dbHost="{{.Values.dbServiceName}}.{{.Release.Namespace}}"
+dbHost="{{.Values.config.dbServiceName}}.{{.Release.Namespace}}"
 dbPort="3306"
 dbName="sdnctl"
 dbUser="sdnctl"
-dbPassword="gamma"
+dbPassword="{{.Values.config.dbSdnctlPassword}}"
 gitLocalRepository="$4"
 
 lastPort=$(find "releases/" -name "customSettings.js" |xargs grep uiPort|cut -d: -f2|sed -e s/,//|sort|tail -1)
@@ -76,7 +90,7 @@ fi
        #echo "Created custom settings  file $customSettingsFile"
        echo "Done ....."
 else
-       echo "ERROR:customSettings file $customSettingsFile already exists for $releaseDir"     
+       echo "ERROR:customSettings file $customSettingsFile already exists for $releaseDir"
        exit
 fi
 #echo "Content of custom settings file"
@@ -86,20 +100,20 @@ fi
 svclogicPropFile="./conf/svclogic.properties"
 if [ ! -d "${appDir}/yangFiles" ]
 then
-       mkdir -p "${appDir}/yangFiles" 
+       mkdir -p "${appDir}/yangFiles"
 fi
 if [ ! -d "${appDir}/generatedJS" ]
 then
-       mkdir -p "${appDir}/generatedJS" 
+       mkdir -p "${appDir}/generatedJS"
 fi
 
 if [ ! -e "./$svclogicPropFile" ]
 then
        echo "org.onap.ccsdk.sli.dbtype=jdbc" >$svclogicPropFile
-       echo "org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.dbServiceName}}.{{.Release.Namespace}}:3306/sdnctl" >>$svclogicPropFile
+       echo "org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.config.dbServiceName}}.{{.Release.Namespace}}:3306/sdnctl" >>$svclogicPropFile
        echo "org.onap.ccsdk.sli.jdbc.database=sdnctl" >>$svclogicPropFile
        echo "org.onap.ccsdk.sli.jdbc.user=sdnctl" >>$svclogicPropFile
-       echo "org.onap.ccsdk.sli.jdbc.password=gamma" >>$svclogicPropFile
+       echo "org.onap.ccsdk.sli.jdbc.password={{.Values.config.dbSdnctlPassword}}" >>$svclogicPropFile
 fi
 if [ ! -e "${appDir}/flowShareUsers.js" ]
 then