Files
Mozilla/mozilla/tools/release/bin/pushsnip
asasaki%mozilla.com 6e10eda322 bug 792201 - move pushed snippets to a different directory, for realz. r=bhearsum
git-svn-id: svn://10.0.0.236/trunk@264227 18797224-902f-48f8-a5cc-f745e15eee43
2012-09-20 16:48:05 +00:00

63 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
set -e
#set -v
unset SSH_AUTH_SOCK
LIVE_SNIPPET_DIR=/opt/aus2/incoming/3
STAGING_DIR=/opt/aus2/snippets/staging
PUSHED_DIR=/opt/aus2/snippets/pushed
RSYNC=/usr/bin/rsync
SED=/bin/sed
## Reincarnate when SCL3 has aus dist setup, ignore for now
if [[ 'dm-ausstage01.mozilla.org' == `uname -n` ]]; then
UPDATE_PHX=1
PHX_HOST=dp-ausstage01.phx.mozilla.com
PHX_USER=ffxbld
PHX_KEY=~/.ssh/auspush
else
UPDATE_PHX=0
fi
if test -z $1; then
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
exit 1
fi
newSnippetDir=`echo $1 | $SED -e 's/\///'g`
if ! test -d $STAGING_DIR/$newSnippetDir; then
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
exit 1
fi
# publish the new snippets
echo "---------------------------------------------------------------------------"
echo Updating PHX1:
echo Running /usr/bin/time -p -o $PUSHED_DIR/$1.time $RSYNC -PaO $STAGING_DIR/$1/* $LIVE_SNIPPET_DIR
/usr/bin/time -p -o $PUSHED_DIR/$1.time $RSYNC -PaO $STAGING_DIR/$1/* $LIVE_SNIPPET_DIR
echo
for d in `ls $STAGING_DIR/$1/`; do
echo Touching $LIVE_SNIPPET_DIR/$d
touch $LIVE_SNIPPET_DIR/$d
done
## Reincarnate when SCL3 has aus dist setup, ignore for now
if [[ $UPDATE_PHX -eq 1 ]]; then
echo "---------------------------------------------------------------------------"
echo Updating PHX:
echo Running time $RSYNC -e \"ssh -i $PHX_KEY\" -PaO $STAGING_DIR/$1/ ${PHX_USER}@${PHX_HOST}:$LIVE_SNIPPET_DIR
time $RSYNC -e "ssh -i $PHX_KEY" -PaO $STAGING_DIR/$1/ ${PHX_USER}@${PHX_HOST}:$LIVE_SNIPPET_DIR
echo
echo Running ssh -i $PHX_KEY ${PHX_USER}@${PHX_HOST} touch $LIVE_SNIPPET_DIR
ssh -i $PHX_KEY ${PHX_USER}@${PHX_HOST} touch $LIVE_SNIPPET_DIR
echo "---------------------------------------------------------------------------"
fi
mv $STAGING_DIR/$1 $PUSHED_DIR/
exit 0