dispatch.sh: Make dispatching actually work for rrsync and diff
Make it work. Basic BSD shell doesn't seem to have array support (read failed and ${!VAR[@]} as well). Also I don't know integer arithmetic so I do a runtime length for the loop. As we don't put $MACHINE/$RELASE into an `` block we should be okay and not run into remote execution.
This commit is contained in:
parent
2061115bbf
commit
a7fc6e6009
|
@ -4,14 +4,37 @@
|
|||
# TODO: Make this interactive and show the diff before and then
|
||||
# do the merge?
|
||||
|
||||
case "$SSH_ORIGINAL_COMMAND" in
|
||||
|
||||
set -e
|
||||
|
||||
# Extract first part...
|
||||
item=1
|
||||
for i in $SSH_ORIGINAL_COMMAND;
|
||||
do
|
||||
if [ $item = "1" ]; then
|
||||
CMD=$i
|
||||
elif [ $item = "11" ]; then
|
||||
MACHINE=$i
|
||||
elif [ $item = "111" ]; then
|
||||
RELEASE=$i
|
||||
else
|
||||
echo "Unknown.. $i"
|
||||
fi
|
||||
item="1$item"
|
||||
done
|
||||
|
||||
case "$CMD" in
|
||||
"rsync")
|
||||
exec /usr/local/bin/rrsync web-files
|
||||
exec /usr/local/bin/rrsync $1
|
||||
;;
|
||||
"diff-testing")
|
||||
exec `dirname $0`/make-stable.sh $1 $2 dry-run
|
||||
cd $1
|
||||
cd ../
|
||||
exec `dirname $0`/make-stable.sh $MACHINE $RELEASE dry-run
|
||||
;;
|
||||
"merge-testing")
|
||||
exec `dirname $0`/make-stable.sh $1 $2
|
||||
cd $1
|
||||
cd ../
|
||||
exec `dirname $0`/make-stable.sh $MACHINE $RELEASE
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue