forked from linkedin/parseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease
More file actions
executable file
·51 lines (44 loc) · 1.38 KB
/
release
File metadata and controls
executable file
·51 lines (44 loc) · 1.38 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
#!/bin/sh
if test ! -f version.properties
then
echo >&2 Could not find version.properties. Run this command from the root of the project.
exit 1
fi
VERSION=`sed -n 's|version=||p' version.properties`
echo Attempting to publish: $VERSION
echo
JAVA_VERSION=`java -version 2>&1 | head -1`
echo $JAVA_VERSION | grep -q '1\.6\.'
if test $? -ne 0
then
echo "ParSeq releases can only be built using a Java 1.6 JDK."
echo "Java reports its version to be: $JAVA_VERSION"
exit 1
fi
DIRTY="`git status --porcelain || echo FAIL`"
if test -n "$DIRTY"
then
echo "Dirty index or working tree. Use git status to check." 2>&1
echo "After resolution, run this command again." 2>&1
exit 1
fi
INCONSISTENT="`git diff origin/master || echo FAIL`"
if test -n "$INCONSISTENT"
then
echo "origin/master and current branch are inconsistent." 2>&1
echo "Use git diff origin/master to see changes." 2>&1
echo "Rebase or push, as appropriate, and run this command again." 2>&1
exit 1
fi
CHANGELOG=`grep v$VERSION CHANGELOG`
if test $? -ne 0
then
echo "No entry in the CHANGELOG for version $VERSION." 2>&1
echo "To get a list of changes, use git log previous_tag.." 2>&1
echo "Add an entry to the CHANGELOG and run this command again." 2>&1
exit 1
fi
ant clean build test dist && \
git tag v$VERSION && \
git push origin v$VERSION && \
echo "Publish completed successfully"