| 1 | #!/bin/sh |
|---|
| 2 | # |
|---|
| 3 | # Written by Gregory Vincic |
|---|
| 4 | # |
|---|
| 5 | # This script may be used to setup an automated javadoc generation. |
|---|
| 6 | # |
|---|
| 7 | # Requires |
|---|
| 8 | # ssh access without passwords to DEST_SERVER |
|---|
| 9 | # |
|---|
| 10 | # cd ~ |
|---|
| 11 | # cat .ssh/id_rsa.pub | ssh $DEST_SERVER "cat >> .ssh/authorized_keys" |
|---|
| 12 | # |
|---|
| 13 | |
|---|
| 14 | # rsync is used to synchronize files with server |
|---|
| 15 | # host:/path/to/javadoc |
|---|
| 16 | DEST_SERVER=tom |
|---|
| 17 | ROOT=$DEST_SERVER:/export/home/trac/proteios/htdocs/javadoc |
|---|
| 18 | |
|---|
| 19 | # Where the javadocs end up when generated |
|---|
| 20 | DIST=dist/docs/api/ |
|---|
| 21 | |
|---|
| 22 | # Where the source is, make sure you checkout a copy of the trunk in this directory |
|---|
| 23 | SRC="/home/leo/gregory/cron/proteios-trunk" |
|---|
| 24 | |
|---|
| 25 | # Update source code using subversion |
|---|
| 26 | cd $SRC |
|---|
| 27 | svn update |
|---|
| 28 | |
|---|
| 29 | # Generate documentation |
|---|
| 30 | ant doc |
|---|
| 31 | |
|---|
| 32 | # Synchronizes files to DEST_SERVER |
|---|
| 33 | function sync() |
|---|
| 34 | { |
|---|
| 35 | FROM=$1 |
|---|
| 36 | TO=$2 |
|---|
| 37 | rsync -av --delete-after $FROM $TO |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | sync $SRC/api/core/$DIST $ROOT/core |
|---|
| 41 | sync $SRC/client/ftpd/$DIST $ROOT/ftpd |
|---|
| 42 | sync $SRC/client/servlet/$DIST $ROOT/servlet |
|---|
| 43 | sync $SRC/api/waf/$DIST $ROOT/waf |
|---|
| 44 | sync $SRC/plugin/$DIST $ROOT/plugin |
|---|
| 45 | sync $SRC/doc/generated_schema.html $ROOT/../ |
|---|