This repository has been archived by the owner on Sep 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathpublish.sh
executable file
·62 lines (51 loc) · 1.64 KB
/
publish.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
set -e
# See https://stackoverflow.com/a/5148851
require_clean_work_tree () {
git rev-parse --verify HEAD >/dev/null || exit 1
git update-index -q --ignore-submodules --refresh
err=0
if ! git diff-files --quiet --ignore-submodules
then
echo >&2 "Cannot $1: You have unstaged changes."
err=1
fi
if ! git diff-index --cached --quiet --ignore-submodules HEAD --
then
if [ $err = 0 ]
then
echo >&2 "Cannot $1: Your index contains uncommitted changes."
else
echo >&2 "Additionally, your index contains uncommitted changes."
fi
err=1
fi
if [ $err = 1 ]
then
test -n "$2" && echo >&2 "$2"
exit 1
fi
}
# Must be on master branch.
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$BRANCH" != "master" ]]; then
echo 'Must be on master branch.'
exit 1;
fi
require_clean_work_tree "publish"
while true; do
read -p "Did you already run ./build.sh? [y/n] " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo "Please run ./build.sh first." && exit;;
* ) echo "Please answer yes or no.";;
esac
done
VERSION=$(git rev-parse --short HEAD)
echo docker push sourcegraph/syntect_server
docker push sourcegraph/syntect_server
docker tag sourcegraph/syntect_server sourcegraph/syntect_server:$VERSION
echo docker push sourcegraph/syntect_server:$VERSION
docker push sourcegraph/syntect_server:$VERSION
docker tag sourcegraph/syntect_server us.gcr.io/sourcegraph-dev/syntect_server:$VERSION
echo docker push us.gcr.io/sourcegraph-dev/syntect_server:$VERSION
docker push us.gcr.io/sourcegraph-dev/syntect_server:$VERSION