Skip to content
Snippets Groups Projects
Commit 6e5f15d8 authored by rds's avatar rds
Browse files

switch to using rsync and use new functions

parent de0269c1
No related branches found
No related tags found
No related merge requests found
......@@ -10,9 +10,11 @@ else
BASE_DIR=$SCRIPT_DIR
fi
. $BASE_DIR/zmap_functions.sh || { echo "Failed to load zmap_functions.sh"; exit 1; }
. $BASE_DIR/zmap_functions.sh || { echo "Failed to load zmap_functions.sh"; exit 1; }
set -o history
. $BASE_DIR/build_config.sh || { echo "Failed to load build_config.sh"; exit 1; }
. $BASE_DIR/build_config.sh || { echo "Failed to load build_config.sh"; exit 1; }
. $BASE_DIR/zmap_functions_web.sh || { echo "Failed to load zmap_functions_web.sh"; exit 1; }
zmap_message_out "Start of script."
......@@ -20,16 +22,20 @@ zmap_message_out "Running in $INITIAL_DIR on $(hostname) under $(uname)"
zmap_message_out "cmd line options = '$*'"
ZMAP_BUILD_CONTAINER=$1
zmap_check ${ZMAP_BUILD_CONTAINER:=$INITIAL_DIR}
# including VARIABLE=VALUE settings from command line
if [ $# -gt 0 ]; then
eval "$*"
fi
# These defaults should probably _not_ be here!
zmap_check ${ZMAP_WEBSITE_TARGET:=/nfs/WWWdev/SANGER_docs/htdocs/Software/analysis/ZMap}
zmap_check ${WEBUSER:=zmap}
zmap_check ${WEBHOST:=cbi4}
zmap_cd $ZMAP_BUILD_CONTAINER
zmap_cd $BASE_DIR
zmap_goto_cvs_module_root
zmap_message_out "Using $ZMAP_WEBSITE_TARGET as website directory."
......@@ -44,33 +50,111 @@ if [ "x$ZMAP_MASTER_DOCS2WEB" == "x$ZMAP_TRUE" ]; then
mkdir -p $LOCAL_WEBSITE_TARGET
rm -rf $LOCAL_WEBSITE_TARGET/*
for dir in $ZMAP_WEBSITE_SOURCE_DIRS;
do
if ! echo $dir | egrep "(^)/" ; then
this_dir=$(pwd)
zmap_cd $dir
cd $dir || {
end_dir=$(basename $dir)
parent=$(dirname $dir)
location=$(find . -name $end_dir | grep $parent)
if [ "x$location" != "x" ]; then
zmap_message_out "Found $end_dir @ $location"
dir=$location
zmap_cd $dir
else
zmap_message_exit "$dir was not found"
fi
}
dir=$(pwd)
zmap_cd $this_dir
fi
zmap_message_out "Copying ($dir/*) to temporary local target ($LOCAL_WEBSITE_TARGET/). "
zmap_message_out "Files:"
find $dir/ -mindepth 1
# find $dir/ -mindepth 1
find $LOCAL_WEBSITE_TARGET -type d | xargs -r chmod 755
find $LOCAL_WEBSITE_TARGET -type f | xargs -r chmod 644
# First we copy to the local one. We can release this later
cp -r $dir/* $LOCAL_WEBSITE_TARGET
rsync -r $dir/ $LOCAL_WEBSITE_TARGET
find $LOCAL_WEBSITE_TARGET -type d | xargs -r chmod 755
find $LOCAL_WEBSITE_TARGET -type f | xargs -r chmod 644
done
update_release_notes_index=$ZMAP_TRUE
if [ "x$update_release_notes_index" == "x$ZMAP_TRUE" ]; then
zmap_message_out "Starting to process Release notes directory to create index"
process_release_notes_files_for_web $LOCAL_WEBSITE_TARGET
zmap_message_out "Finished processing Release notes"
fi
if [ "x$EXPAT_HTML_DOC_LOCATION" != "x" ]; then
if [ -d $EXPAT_HTML_DOC_LOCATION ]; then
mkdir $LOCAL_WEBSITE_TARGET/expat || \
zmap_message_exit "Failed to make expat dir in $LOCAL_WEBSITE_TARGET"
zmap_message_out "Copying Expat docs..."
cp -r $EXPAT_HTML_DOC_LOCATION/* $LOCAL_WEBSITE_TARGET/expat/
zmap_message_out "Removing and recreating index.html [soft link]"
rm -f $LOCAL_WEBSITE_TARGET/expat/index.html
cp $LOCAL_WEBSITE_TARGET/expat/reference.html $LOCAL_WEBSITE_TARGET/expat/index.html
cat >> $LOCAL_WEBSITE_TARGET/expat/index.shtml <<EXPAT
<!-- Auto generated by $0. Do not edit! -->
<!--#include virtual="/perl/header"-->
<iframe src="index.html"
height="600px"
width="100%"
frameborder="0"
scrolling="auto"
name="expat"
id="expat"></iframe>
<!--#include virtual="/perl/footer"-->
EXPAT
echo "# Auto generated by $0. Do not edit!" > $LOCAL_WEBSITE_TARGET/expat/this_links.ini
echo "Expat [sf]=http://expat.sourceforge.net" >> $LOCAL_WEBSITE_TARGET/expat/this_links.ini
else
zmap_message_err "Did not find Expat docs in '$EXPAT_HTML_DOC_LOCATION'"
fi
else
zmap_message_err "\$EXPAT_HTML_DOC_LOCATION not set. Cannot copy Expat docs."
fi
# Make all the header.ini files
make_header_ini $LOCAL_WEBSITE_TARGET
zmap_message_out "Now copying the whole local webroot to $ZMAP_WEBSITE_TARGET"
zmap_message_out "Running scp -r $LOCAL_WEBSITE_TARGET/* $WEBUSER@$WEBHOST:$ZMAP_WEBSITE_TARGET/"
zmap_message_out "Running rsync -r $LOCAL_WEBSITE_TARGET/* $WEBUSER@$WEBHOST:$ZMAP_WEBSITE_TARGET/"
PRODUCTION=yes
if [ "x$PRODUCTION" == "xyes" ]; then
scp -r $LOCAL_WEBSITE_TARGET/* $WEBUSER@$WEBHOST:$ZMAP_WEBSITE_TARGET/ || zmap_message_exit "Secure Copy Failed."
zmap_message_out "Password prompt requires password for $WEBUSER"
export RSYNC_RSH="ssh"
(cat <<EXCLUDE
*.md5
*.int
*.README
*.tag
EXCLUDE
) | rsync -r --exclude-from=- --cvs-exclude --delete-excluded $LOCAL_WEBSITE_TARGET/ $WEBUSER@$WEBHOST:$ZMAP_WEBSITE_TARGET/ || \
zmap_message_exit "Secure Copy Failed."
fi
find $LOCAL_WEBSITE_TARGET -type d | xargs -r chmod 755
find $LOCAL_WEBSITE_TARGET -type f | xargs -r chmod 644
fi
if [ "x$ZMAP_MASTER_WEBPUBLISH" == "x$ZMAP_TRUE" ]; then
zmap_check ${WEBPUBLISH:=webpublish}
# -t is for test apparently....
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment