-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·53 lines (44 loc) · 1.58 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·53 lines (44 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
### testing undo push
#// read config properties for the environment
props="./config/jenkins-dev.properties"
#// bash variable’s name may contain only digits, letters, and underscores. Therefore we need to choose the underscore ‘_’:
#// We read key and value separately, with the equal sign as a separator.
#// Next, tr translates dots to underscores in the property name. Finally, eval defines a bash variable with a new name.
if [ -f "$props" ]
then
echo "$props found."
while IFS='=' read -r key value
do
key=$(echo $key | tr '.' '_')
eval ${key}=\${value}
done < "$props"
echo "User Id (db.test.user) = " ${db_test_user}
echo "user password (db.test.passwd) = " ${db_test_passwd}
echo "JAVA HOME IS = " ${java_home}
echo "SAG_HOME IS = " ${sag_ci_home}
echo "SYS_PROPS IS = " ${deployer_system_properties}
#/// setup ANT variables
#JAVA_HOME=$(java_home)
#SAG_HOME=$(sag_ci_home)
#SYS_PROPS=$(deployer_system_properties)
else
echo "$props not found."
fi
#// Testing input parameters
echo "Test Build Shell Script !!"
echo "INTERFACE TO BE BUILD=$1"
echo "PACKAGE TO BE BUILD=$2"
echo "Current time is=$3"
echo "Parameter 4 is=$4"
echo "Parameter 5 (Server Type)"=$5
echo "Parameter 5 (Server Name)"=$6
#// validating conditional statemets from input parametere
#// $1- interface, $2- package, $5- server type, $6-server name
if [ $1 == 1 ] && [ $2 == 1 ] && [ $5 == 1 ] && [ $6 == 1 ]; then
echo "BUILD TEST_INTERFACE1"
elif [ $1 == 2 ] && [ $2 == 2 ] && [ $5 == 2 ] && [ $6 == 2 ]; then
echo "BUILD TEST_INTERFACE2"
else
echo "ENTER VALID INTERFACE DETAILS"
fi