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

Commit

Permalink
Improved build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dashohoxha committed Oct 16, 2014
1 parent 5040d40 commit 86d31e9
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,45 @@ cat <<EOF > $options
EOF

### save the default settings
echo "### Start: $project_dir/install/settings.sh" >> $options
source $project_dir/install/settings.sh
echo "### ----- Start: $project_dir/install/settings.sh" >> $options
cat $project_dir/install/settings.sh >> $options
echo "### End: $project_dir/install/settings" >> $options
echo "### ----- End: $project_dir/install/settings" >> $options

### get command line options and save them to options.sh
for opt in "$@"
do
case $opt in
-h|--help) usage ;;
-h|--help) usage ;;

--git_branch=*)
--git_branch=*)
git_branch=${opt#*=}
echo git_branch="$git_branch" >> $options
echo git_branch="$git_branch" >> $options
;;

--*=*)
optvalue=${opt#*=}
optname=${opt%%=*}
optname=${optname:2}
echo $optname="$optvalue" >> $options
;;
optvalue=${opt#*=}
optname=${opt%%=*}
optname=${optname:2}
eval $optname="$optvalue"
echo $optname="$optvalue" >> $options
;;

*)
if [ ${opt:0:1} = '-' ]; then usage; fi
*)
if [ ${opt:0:1} = '-' ]; then usage; fi

settings=$opt
if ! test -f "$settings"
settings=$opt
if ! test -f "$settings"
then
echo "File '$settings' does not exist."
exit 1
fi
echo "### ----- Start: $settings" >> $options
cat $settings >> $options
echo "### ----- End: $settings" >> $options
echo "File '$settings' does not exist."
exit 1
fi
source $settings
echo "### ----- Start: $settings" >> $options
cat $settings >> $options
echo "### ----- End: $settings" >> $options
echo
;;
;;
esac
done

Expand Down

0 comments on commit 86d31e9

Please sign in to comment.