Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[0caf73]: scripts / publish-updates.sh Maximize Restore History

Download this file

publish-updates.sh    74 lines (53 with data), 1.6 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
62
63
64
65
66
67
68
69
70
71
#! /bin/bash
# This script runs on Mac OS X ans is intended to
# publishes the ilg.gnuarmeclipse-repository site
# to the File Release System (FRS) folder on SourceForge
TEST=""
if [ $# -gt 0 ] && [ "$1" = "test" ]
then
TEST="-test"
shift
fi
SF_FOLDER="Eclipse/updates"
echo "Updating $SF_FOLDER$TEST"
if [ $# -gt 0 ] && [ "$1" = "dry" ]
then
DRY="dry"
shift
echo "Dry run"
fi
SF_USER=ilg-ul
SF_DESTINATION="$SF_USER,gnuarmeclipse@frs.sourceforge.net:/home/frs/project/g/gn/gnuarmeclipse/$SF_FOLDER$TEST"
SOURCE_LIST="."
# -c skip based on checksum, not mod-time & size
RSYNC_OPTS="-vrCct --exclude=scripts --exclude=.*"
RSYNC_OPTS+=" --delete"
if [ "$DRY" = "dry" ]
then
RSYNC_OPTS+=" -n"
fi
if [ ! -d ../ilg.gnuarmeclipse-repository/target/repository ]
then
echo "No repository folder found"
exit 1
fi
cd ../ilg.gnuarmeclipse-repository/target
echo "Rsync-ing SourceForge $SF_FOLDER$TEST site"
(cd repository; rsync -e ssh $RSYNC_OPTS $SOURCE_LIST $SF_DESTINATION)
if [ "$TEST" = "-test" ]
then
echo "Published on the test site"
else
echo "Published on the main site. Don't forget to publish the archive too!"
fi
if [ -f *-SNAPSHOT.zip ]
then
NUMDATE=$(ls repository/plugins/ilg.gnuarmeclipse.managedbuild.cross* | sed -e 's/.*_[0-9]*[.][0-9]*[.][0-9]*[.]\([0-9]*\)[.]jar/\1/')
ARCHIVE_PREFIX=$(ls *-SNAPSHOT.zip | sed -e 's/\(.*\)-SNAPSHOT[.]zip/\1/')
ARCHIVE_FOLDER=~/tmp/gnuarmeclipse-archive
if [ ! -d $ARCHIVE_FOLDER ]
then
mkdir -p $ARCHIVE_FOLDER
fi
mv -fv $ARCHIVE_PREFIX-SNAPSHOT.zip $ARCHIVE_FOLDER/$ARCHIVE_PREFIX-$NUMDATE.zip
fi