Mercurial > dive4elements > website
annotate scripts/d4e-website-loader.sh @ 66:26bbcc2db7a5
More thoughts about the D4E framework.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Tue, 25 Mar 2014 14:36:23 +0100 |
parents | c4f1df6e88b0 |
children |
rev | line source |
---|---|
31
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
1 #!/bin/bash |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
2 # Copyright (C) 2014 by Intevation GmbH |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
3 # Author(s): |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
4 # Mathias Gebbe <mgebbe@intevation.de> |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
5 # |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
6 # The Document Root of your projects website is available as: |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
7 # wald.intevation.org:/$PROJECT/htdocs/ |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
8 # so to list the contents of your projects Document root you can use: |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
9 # rsync $USER@wald.intevation.org:/$PROJECT/htdocs/ |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
10 # or to make a locale copy: |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
11 # rsync -vrl $USER@wald.intevation.org:/$PROJECT/htdocs/ $TARGET [should be an empty directory] |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
12 # to upload a new htdocs folder use: |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
13 # 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/ |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
14 # |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
15 # to load the latest d4e-website from repositroy use: hg clone https://scm.wald.intevation.org/hg/dive4elements/website/ |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
16 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
17 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
18 PROJECT=dive4elements |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
19 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
20 function usage |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
21 { |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
22 echo "usage: -u username -d destination [-h]" |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
23 } |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
24 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
25 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
26 ##### Main |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
27 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
28 while [ "$1" != "" ]; do |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
29 case $1 in |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
30 -u | --user ) shift |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
31 username=$1 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
32 ;; |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
33 -d | --destination ) shift |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
34 destination=$1 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
35 ;; |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
36 -h | --help ) usage |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
37 exit 0 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
38 ;; |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
39 * ) usage |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
40 exit 1 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
41 esac |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
42 shift |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
43 done |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
44 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
45 if [ -z $username ];then |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
46 echo "Username:" |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
47 read username |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
48 fi |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
49 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
50 if [ -z $destination ];then |
37
265e1a46de07
rsync with hidden files
Mathias Gebbe <mgebbe@intevation.de>
parents:
31
diff
changeset
|
51 echo "Destination (hit enter for current directory `pwd`/ [should be an empty directory]):" |
31
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
52 read destination |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
53 if [ -z $destination ];then |
37
265e1a46de07
rsync with hidden files
Mathias Gebbe <mgebbe@intevation.de>
parents:
31
diff
changeset
|
54 destination=`pwd`+/ |
31
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
55 fi |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
56 fi |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
57 |
37
265e1a46de07
rsync with hidden files
Mathias Gebbe <mgebbe@intevation.de>
parents:
31
diff
changeset
|
58 mkdir -p $destination |
31
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
59 hg clone ssh://$username@scm.wald.intevation.org/hg/dive4elements/website/ $destination |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
60 |
c66f4b393d15
Added index.php for Python Server Pages
Mathias Gebbe <mgebbe@intevation.de>
parents:
diff
changeset
|
61 echo "run the following command to upload the website from repository" |
37
265e1a46de07
rsync with hidden files
Mathias Gebbe <mgebbe@intevation.de>
parents:
31
diff
changeset
|
62 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/" |