forked from wet-boew/wet-boew-drupal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·63 lines (52 loc) · 1.34 KB
/
release.sh
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
#!/bin/bash
# Release and push tags to remotes on Drupal and GitHub
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Variables
BRANCH="7.x-$1"
TAG="7.x-$2"
function git_tag_recurse()
{
for i in * ; do
if [ -d "$i" ]; then
if [[ "$i" == *wetkit* ]]; then
cd $i
# Init 4.x branch
exists=`git show-ref refs/heads/$BRANCH`
if [ -n "$exists" ]; then
echo "Branch name $BRANCH already exists."
else
echo "Branch name $BRANCH is being created."
git branch $BRANCH
fi
# Checkout branch
echo "Checking out $BRANCH"
git checkout $BRANCH
# Tag + Push release
RES=`git tag | grep "^$TAG\$"`
if [ "$RES" == "$TAG" ]; then
echo "Tag name $TAG already exists."
else
echo "Tag name $TAG is being created."
git tag $TAG
fi
# Push new branches to remote
echo "Pushing branches to remote(s)"
git push origin $BRANCH
git push github $BRANCH
# Push new tags to remote
echo "Pushing tags to remote(s)"
git push origin $TAG
git push github $TAG
cd ..
fi
fi
done
}
# Initialize all custom modules
cd modules/custom/
git_tag_recurse
cd $DIR
# Initialize all custom themes
cd themes/
git_tag_recurse
cd $DIR