summaryrefslogtreecommitdiffstats
path: root/java/etc/release-sca.sh
blob: 5a93382ef2435a2779b726b09450821f1a111c0c (plain)
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
#!/usr/bin/bash
DIR=`pwd`

# version
BASE=1.0.1
VER=$BASE-incubating
TAG=$BASE-RC4
BRANCH=sca-java-$BASE

# user/pass for signing
USER=rfeng
PASS=

if [ -z $PASS ]; then
stty -echo
echo "Please enter your GPG passphrase: "
read PASS
stty echo
fi


# Staging maven repo
REPO_ID=apache.incubator
REPO_URL=scp://people.apache.org/home/$USER/public_html/tuscany/$TAG/maven

# RAT jar
RAT_JAR=c:\\Apache\\rat\\rat-0.5.1.jar

if [ ! -d $TAG ]; then 
echo "SVN copying ..."
svn copy https://svn.apache.org/repos/asf/incubator/tuscany/branches/$BRANCH $TAG
fi

echo "Changing version ids ..."
cd $DIR/$TAG
if grep $VER-SNAPSHOT pom.xml; then
for i in `/usr/bin/find . -name "*.xml"`; do if grep $VER-SNAPSHOT $i>/dev/null; then sed "s/$VER-SNAPSHOT/$VER/g" $i >/tmp/tmp.xml; cp /tmp/tmp.xml $i; fi; done
for i in `/usr/bin/find ./itest -name "*.vm"`; do if grep $VER-SNAPSHOT $i>/dev/null; then sed "s/$VER-SNAPSHOT/$VER/g" $i> /tmp/tmp.xml; cp /tmp/tmp.xml $i; fi; done
fi

echo "Generating RAT report ..."
cd $DIR
java -jar $RAT_JAR $TAG >$TAG.rat.txt

OPTS="-DaltDeploymentRepository=$REPO_ID::default::$REPO_URL verify gpg:sign install:install deploy:deploy -Dgpg.passphrase=$PASS"

echo "Deploying modules to stating repo ..."
cd $DIR/$TAG
mvn -N $OPTS 

cd $DIR/$TAG/modules
mvn $OPTS

echo "Building samples ..."
cd $DIR/$TAG/samples
mvn clean install

echo "Building itests ..."
cd $DIR/$TAG/itest
mvn clean install

echo "Building distrubtion ..."
cd $DIR/$TAG/distribution
mvn clean install

echo "Signing distrubtion ..."
for i in target/*.zip target/*.gz; do gpg --output $i.asc --detach-sig --armor $i; done
for i in target/*.zip target/*.gz; do openssl md5 -hex $i | sed 's/MD5(\([^)]*\))= \([0-9a-f]*\)/\2 *\1/' > $i.md5; done

echo "Deploying tuscany-sca-all ..."
cd $DIR/$TAG/distribution/bundle/target
mvn gpg:sign-and-deploy-file -DgroupId=org.apache.tuscany.sca -DartifactId=tuscany-sca-all -Dversion=$VER -Dpackaging=jar -Dfile=tuscany-bundle-$VER.jar -DrepositoryId=$REPO_ID -Durl=$REPO_URL -Dkeyname=$USER -Dpassphrase=$PASS