-
Notifications
You must be signed in to change notification settings - Fork 5.2k
/
publish-release.sh
executable file
·47 lines (39 loc) · 1 KB
/
publish-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
#!/bin/bash
set -e
set -u
cd `dirname $0`
DIR="$(pwd)"
METEOR_DIR="$(pwd)/../.."
if [ $# -gt 2 ]; then
echo "usage: publish-release.sh [GIT-REV [RELEASE-NAME]]"
exit 1
fi
if [ $# -lt 1 ]; then
GIT_SHA="$(git rev-parse HEAD)"
else
GIT_SHA="$(git rev-parse "$1")"
fi
if [ $# -lt 2 ]; then
RELEASE_NAME="$GIT_SHA"
else
RELEASE_NAME="$2"
fi
# prepare settings file with git sha of last commit
PUBLISH_TMPDIR=$(mktemp -d -t meteor-publish-release-XXXXXXXX)
cat > "$PUBLISH_TMPDIR/settings.json" <<EOF
{"git-sha": "$GIT_SHA", "release-name": "$RELEASE_NAME"}
EOF
# ensure our 'awssum' smart package is up-to-date
cd $METEOR_DIR
git submodule init
git submodule update
# publish-release is a meteor app
cd $DIR/publish-release
# run it
#
# XXX when we support third-party packages use that mechanism instead
# of keeping the package in git.
#
# XXX it would be cool to be able to not listen on any port here. instead
# we use port 31337
$METEOR_DIR/meteor -p 31337 --once --settings=$PUBLISH_TMPDIR/settings.json