mgebbe@31: #!/bin/bash mgebbe@31: # Copyright (C) 2014 by Intevation GmbH mgebbe@31: # Author(s): mgebbe@31: # Mathias Gebbe mgebbe@31: # mgebbe@31: # The Document Root of your projects website is available as: mgebbe@31: # wald.intevation.org:/$PROJECT/htdocs/ mgebbe@31: # so to list the contents of your projects Document root you can use: mgebbe@31: # rsync $USER@wald.intevation.org:/$PROJECT/htdocs/ mgebbe@31: # or to make a locale copy: mgebbe@31: # rsync -vrl $USER@wald.intevation.org:/$PROJECT/htdocs/ $TARGET [should be an empty directory] mgebbe@31: # to upload a new htdocs folder use: mgebbe@31: # rsync -rvPC --perms --chmod=ug+rw,o+r,Dg+s,Da+x,u-s,Fg-s,o-wt --exclude '*.swp' --delete ./website/* $username@wald.intevation.org:/$PROJECT/htdocs/ mgebbe@31: # mgebbe@31: # to load the latest d4e-website from repositroy use: hg clone https://scm.wald.intevation.org/hg/dive4elements/website/ mgebbe@31: mgebbe@31: mgebbe@31: PROJECT=dive4elements mgebbe@31: mgebbe@31: function usage mgebbe@31: { mgebbe@31: echo "usage: -u username -d destination [-h]" mgebbe@31: } mgebbe@31: mgebbe@31: mgebbe@31: ##### Main mgebbe@31: mgebbe@31: while [ "$1" != "" ]; do mgebbe@31: case $1 in mgebbe@31: -u | --user ) shift mgebbe@31: username=$1 mgebbe@31: ;; mgebbe@31: -d | --destination ) shift mgebbe@31: destination=$1 mgebbe@31: ;; mgebbe@31: -h | --help ) usage mgebbe@31: exit 0 mgebbe@31: ;; mgebbe@31: * ) usage mgebbe@31: exit 1 mgebbe@31: esac mgebbe@31: shift mgebbe@31: done mgebbe@31: mgebbe@31: if [ -z $username ];then mgebbe@31: echo "Username:" mgebbe@31: read username mgebbe@31: fi mgebbe@31: mgebbe@31: if [ -z $destination ];then mgebbe@37: echo "Destination (hit enter for current directory `pwd`/ [should be an empty directory]):" mgebbe@31: read destination mgebbe@31: if [ -z $destination ];then mgebbe@37: destination=`pwd`+/ mgebbe@31: fi mgebbe@31: fi mgebbe@31: mgebbe@37: mkdir -p $destination mgebbe@31: hg clone ssh://$username@scm.wald.intevation.org/hg/dive4elements/website/ $destination mgebbe@31: mgebbe@31: echo "run the following command to upload the website from repository" mgebbe@37: echo "rsync -rvPC --perms --chmod=ug+rw,o+r,Dg+s,Da+x,u-s,Fg-s,o-wt --exclude '*.swp' --delete $destination $username@wald.intevation.org:/$PROJECT/htdocs/"