-
Notifications
You must be signed in to change notification settings - Fork 2
/
create_release
executable file
·83 lines (63 loc) · 1.79 KB
/
create_release
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
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
#############################################################################################
# POP-Java Archive Releaser
# Author : Clement Valentin (clementval)
# Creation date : 31/31/2011
# Description : This script is used to create a releasable archive of POP-Java version
# -------------------------------------------------------------------------------------------
# IMPORTANT : Please, keep this log up to date
#
# Update log
# Date Author Description
# 31/03/2011 clementval First version of this script
#############################################################################################
################################################################
# Define the function to print the program usage
################################################################
usage()
{
cat << EOF
POP-Java releaser script v1.0
This program is used to create a releasable archive of POP-Java
Usage: create_release <version>
version should be in the form of 1.0
EOF
}
if [ "x$1" == "x" ]
then
echo "[ERROR] You must specify a version number"
usage
exit
fi
VERSION=$1
DDATE=$(date +%Y%m%d)
RELDIR="popjava_"$VERSION"_build_"$DDATE
ARCHIVE="$RELDIR.tar"
echo "The archive $RELDIR.tar.gz will be created"
#copy needed item to temp dir
FILES=$(find ./ -not \( -name .svn -a -prune \))
#Create the temporary directory
mkdir $RELDIR
for FILE in $FILES
do
if [[ $FILE != ./workspace* ]]
then
NEWPATH=$(echo ${FILE:1})
if [ -d $FILE ]
then
if [ "$FILE" != "./" ]
then
mkdir $RELDIR$NEWPATH
fi
else
if [ "$FILE" != "./create_release" ]
then
cp $FILE $RELDIR$NEWPATH
fi
fi
fi
done
#create the archive
tar -cf $ARCHIVE $RELDIR/*
gzip $ARCHIVE
rm -rf $RELDIR