-
Notifications
You must be signed in to change notification settings - Fork 437
/
release
executable file
·65 lines (50 loc) · 1.89 KB
/
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
#!/usr/bin/env bash
set -e
if (( "$#" != 1 ))
then
echo "Tag has to be provided"
exit 1
fi
if [ ! -f ./CHANGELOG_FUTURE.md ]; then
echo "Release changelog has not been generated. File CHANGELOG_FUTURE.md does not exist."
exit 1
fi
rm ./CHANGELOG_FUTURE.md
CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
git add CHANGELOG.md && git commit -s -m "Release $1" -S && git push origin "$CURRENT_BRANCH"
./bin/subtree-split
for REMOTE in origin stomp amqp-ext amqp-lib amqp-bunny amqp-tools pheanstalk gearman sqs sns snsqs gps fs redis dbal null rdkafka enqueue simple-client enqueue-bundle job-queue test async-event-dispatcher async-command mongodb wamp monitoring dsn
do
echo ""
echo ""
echo "Releasing $REMOTE";
TMP_DIR="/tmp/enqueue-repo"
REMOTE_URL=`git remote get-url $REMOTE`
rm -rf $TMP_DIR;
mkdir $TMP_DIR;
(
cd $TMP_DIR;
git clone $REMOTE_URL .
git checkout "$CURRENT_BRANCH";
# gsort comes with coreutils packages. brew install coreutils
LAST_RELEASE=$(git tag -l [0-9].* | gsort -V | tail -n1 )
if [[ -z "$LAST_RELEASE" ]]; then
echo "There has not been any releases. Releasing $1";
#git tag $1 -a -s -m "Release $1"
git tag $1 -a -m "Release $1"
git push origin --tags
else
echo "Last release $LAST_RELEASE";
CHANGES_SINCE_LAST_RELEASE=$(git log "$LAST_RELEASE"...master)
CHANGES_SINCE_LAST_RELEASE="$CHANGES_SINCE_LAST_RELEASE" | xargs echo -n
if [[ ! -z "$CHANGES_SINCE_LAST_RELEASE" ]]; then
echo "There are changes since last release. Releasing $1";
#git tag $1 -s -m "Release $1"
git tag $1 -m "Release $1"
git push origin --tags
else
echo "No change since last release.";
fi
fi
)
done