Skip to content
This repository was archived by the owner on Mar 4, 2019. It is now read-only.

Commit c362dd5

Browse files
committed
Improved build script.
1 parent 7802d26 commit c362dd5

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

docker-build.sh

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,42 +31,45 @@ cat <<EOF > $options
3131
EOF
3232

3333
### save the default settings
34-
echo "### Start: $project_dir/install/settings.sh" >> $options
34+
source $project_dir/install/settings.sh
35+
echo "### ----- Start: $project_dir/install/settings.sh" >> $options
3536
cat $project_dir/install/settings.sh >> $options
36-
echo "### End: $project_dir/install/settings" >> $options
37+
echo "### ----- End: $project_dir/install/settings" >> $options
3738

3839
### get command line options and save them to options.sh
3940
for opt in "$@"
4041
do
4142
case $opt in
42-
-h|--help) usage ;;
43+
-h|--help) usage ;;
4344

44-
--git_branch=*)
45+
--git_branch=*)
4546
git_branch=${opt#*=}
46-
echo git_branch="$git_branch" >> $options
47+
echo git_branch="$git_branch" >> $options
4748
;;
4849

4950
--*=*)
50-
optvalue=${opt#*=}
51-
optname=${opt%%=*}
52-
optname=${optname:2}
53-
echo $optname="$optvalue" >> $options
54-
;;
51+
optvalue=${opt#*=}
52+
optname=${opt%%=*}
53+
optname=${optname:2}
54+
eval $optname="$optvalue"
55+
echo $optname="$optvalue" >> $options
56+
;;
5557

56-
*)
57-
if [ ${opt:0:1} = '-' ]; then usage; fi
58+
*)
59+
if [ ${opt:0:1} = '-' ]; then usage; fi
5860

59-
settings=$opt
60-
if ! test -f "$settings"
61+
settings=$opt
62+
if ! test -f "$settings"
6163
then
62-
echo "File '$settings' does not exist."
63-
exit 1
64-
fi
65-
echo "### ----- Start: $settings" >> $options
66-
cat $settings >> $options
67-
echo "### ----- End: $settings" >> $options
64+
echo "File '$settings' does not exist."
65+
exit 1
66+
fi
67+
source $settings
68+
echo "### ----- Start: $settings" >> $options
69+
cat $settings >> $options
70+
echo "### ----- End: $settings" >> $options
6871
echo
69-
;;
72+
;;
7073
esac
7174
done
7275

0 commit comments

Comments
 (0)