-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·72 lines (49 loc) · 1.33 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
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -e
# Don't start a release if the tree is dirty
#
if [[ ! -z $(git status -s) ]]; then
echo "Git tree is not clean, aborting release!"
exit 1
fi
# Get version and branch (we only do stable for now)
#
V="$1"
RELEASE="${2:-stable}"
if [[ -z $V ]]; then
echo "A version must be specified!"
exit 1
fi
VERSION="${RELEASE}-${V}"
echo "Releasing ${VERSION}"
if git rev-parse "${VERSION}" >/dev/null 2>&1; then
echo "Tag for such version already exists!"
exit 1
fi
# Prepare changelog
#
LAST_VERSION=$(git describe --tags --abbrev=0)
CHANGES=$(git log --oneline --no-decorate --no-merges ${LAST_VERSION}..HEAD --pretty=format:"%x2a%x20%h%x20%s")
echo "Changelog:"
echo "$CHANGES"
echo -e "## ${VERSION}\n\nBased on ${RELEASE} release ${V}.\n\n${CHANGES}\n" > tmp
cat CHANGELOG.md >> tmp
mv tmp CHANGELOG.md
# Set specific image tags in compose files
#
sed -i "" -e "s/latest/${VERSION}/" *.yml
# Commit all changes and tag the repo
#
git commit -a -m "release: ${VERSION}" -m "${CHANGES}"
git tag -a "${VERSION}" -m "release" -m "${CHANGES}"
# Tag Docker images and push them to DockerHub
#
JITSI_BUILD=${VERSION} make release
# Revert back to "latest" for development
#
sed -i "" -e "s/${VERSION}/latest/" *.yml
git commit -a -m "misc: working on latest"
# Push all changes and tags
#
git push
git push --tags