Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'cje-production/mbscripts/mb010_createEnvfiles.sh')
-rwxr-xr-xcje-production/mbscripts/mb010_createEnvfiles.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/cje-production/mbscripts/mb010_createEnvfiles.sh b/cje-production/mbscripts/mb010_createEnvfiles.sh
new file mode 100755
index 00000000..b20abba1
--- /dev/null
+++ b/cje-production/mbscripts/mb010_createEnvfiles.sh
@@ -0,0 +1,54 @@
+#!/bin/bash -x
+
+#*******************************************************************************
+# Copyright (c) 2018 IBM Corporation and others.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Sravan Lakkimsetti - initial API and implementation
+#*******************************************************************************
+
+if [ $# -ne 1 ]; then
+ echo USAGE: $0 env_file
+ exit 1
+fi
+
+source "../common/common-functions.shsource"
+
+shEnvFile=$(basename $1)
+buildDir=$(dirname $1)
+baseEnvFile=$(echo $shEnvFile |cut -d. -f1)
+phpEnvFile=$(echo $baseEnvFile.php)
+propEnvFile=$(echo $baseEnvFile.properties)
+
+BUILD_ENV_FILE=${buildDir}/${shEnvFile}
+BUILD_ENV_FILE_PHP=${buildDir}/${phpEnvFile}
+BUILD_ENV_FILE_PROP=${buildDir}/${propEnvFile}
+
+fn-addToPropFiles ()
+{
+ echo "export $1=$2" >> $BUILD_ENV_FILE
+ echo "\$$1 = $2;" >> $BUILD_ENV_FILE_PHP
+ echo "$1 = $2" >> $BUILD_ENV_FILE_PROP
+}
+while read propLine
+do
+ if [[ ${propLine:0:1} == "#" ]]
+ then
+ continue
+ else
+ key=$(echo $propLine|cut -d= -f1)
+ value=$(echo $propLine|cut -d= -f2-)
+ if [[ -z $key ]]
+ then
+ continue
+ fi
+ fn-addToPropFiles $key $value
+ fi
+done < ../buildproperties.txt

Back to the top