forked from meteor/meteor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-meteor-tool-on-all-platforms.sh
executable file
·69 lines (51 loc) · 1.77 KB
/
publish-meteor-tool-on-all-platforms.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
#!/bin/bash
# This scripts automates the release process of Meteor Tool.
# Normally, after publishing a new Meteor release from checkout, you need to ssh
# to a machine running every supported platform and publish a build from it.
# This script automates ssh'ing into machines and running the publish command.
set -e
set -u
TEMP_PRIV_KEY=
TEMP_KEY=
SESSION_FILE=
main () {
if [ $# -ne 1 ]; then
echo "usage: $0 GITSHA" 1>&2
echo "The passed commit is checked out and published from the remote machines." 1>&2
exit 1
fi
GITSHA=$1
ADMIN_DIR="`dirname "$0"`"
SCRIPTS_DIR="`dirname "$ADMIN_DIR"`"
CHECKOUT_DIR="`dirname "$SCRIPTS_DIR"`"
METEOR="$CHECKOUT_DIR/meteor"
trap 'echo "${red}Login failed.${NC}"; clean_up' EXIT
echo "${green}Login with a meteor account belonging to MDG."
echo "A session file will be generated in your checkout and it will be used to"
echo "publish the release from the remote machines.${NC}"
SESSION_FILE="$CHECKOUT_DIR/publish-meteor-tool-session"
env METEOR_SESSION_FILE="$SESSION_FILE" "$METEOR" login
echo "${green}Login succeeded.${NC}"
echo
echo "Run the following commands in separate terminal windows:"
echo
# XXX there is no os.windows.x86_64 as we don't build for it at the moment
PLATFORMS=( os.osx.x86_64 os.linux.x86_64 os.linux.x86_32 os.windows.x86_32 )
for PLATFORM in ${PLATFORMS[@]}; do
COMMAND="`dirname $0`/publish-meteor-tool-on-arch.sh $GITSHA $PLATFORM $SESSION_FILE"
echo $COMMAND
done
trap - EXIT
}
clean_up () {
if [[ "x$SESSION_FILE" != x ]]; then
echo "Removing used session file."
rm "$SESSION_FILE"
fi
exit 1
}
# '|| true' so that we don't fail on terminals without colors
red=`tput setaf 1 || true`
green=`tput setaf 2 || true`
NC=`tput sgr0 || true`
main $@