[r23422]: www / trunk / xml_export / export.sh Maximize Restore History

Download this file

export.sh    62 lines (53 with data), 1.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Export jEdit trackers to plain HTML and put it on jedit.org
#
# Copyright Š 2014 - Eric Le Lay <kerik-sf@users.sf.net>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#/
set -eu
set -x verbose
# ins and outs
mydirabs=`realpath $0`
mydirabs=`dirname $mydirabs`
mydir=`dirname $0`
export_n=export_`date "+%y-%m-%d"`
export_zip="$mydirabs/export/${export_n}.zip"
extract_dir=/tmp/$export_n
res_dir=$mydir/res
# private configuration
source $mydir/project_export.conf
# directory setup
if [ ! -d "$mydir/export" ]; then
mkdir "$mydir/export"
fi
if [ ! -d "$res_dir" ]; then
mkdir "$res_dir"
fi
# get jedit-backup-xxx.zip
if [ "${SKIPD:-}" == "" ]; then
ssh-add $SSH_KEY
$mydir/project_export.sh -v -c $mydir/project_export.conf -o $export_zip
fi
if [ "${SKIPT:-}" == "" ]; then
# extract zip
mkdir -p $extract_dir
(cd $extract_dir && unzip $export_zip)
extracted=`ls -d $extract_dir/jedit-backup-*`
# create html
$mydir/transform.sh "$extracted" "$res_dir"
fi
if [ "${SKIPUP:-}" == "" ]; then
# tar and upload
$mydir/rsync.sh "$res_dir"
fi