Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Download and run Asgard locally
#!/bin/bash
#
# curl -fsSL http://bit.ly/YXV7L3 | bash -e
#
#
set -e
DIR=$HOME/bin
[ -d "$DIR" ] || mkdir -p "$DIR"
if [ ! -e "$DIR/asgard-standalone.jar" ]; then
echo >&2 "Downloading asgard-standalone.jar"
wget -q https://netflixoss.ci.cloudbees.com/job/asgard-master/lastSuccessfulBuild/artifact/asgard-standalone.jar -O /tmp/$$.jar
mv /tmp/$$.jar $DIR/asgard-standalone.jar
fi
if [ ! -e $HOME/.asgard/Config.groovy ]; then
echo >&2
echo >&2 "** Creating ~/.asgard/Config.groovy. **"
echo >&2
mkdir -p -m 0700 $HOME/.asgard
cat > $HOME/.asgard/Config.groovy <<'EOF'
grails {
awsAccounts=['XXXX']
awsAccountNames=['XXXX':'prod']
}
secret {
accessId='AYYYYYYYYYYYYYYA'
secretKey='fbbbbbbbbbbbbbbbbbcccccccccT'
}
cloud {
accountName='prod'
publicResourceAccounts=['amazon']
}
EOF
chmod 0600 $HOME/.asgard/Config.groovy
echo >&2 "** Please fill this out with your credentials, and re-run ~/bin/asgard.sh ** "
echo >&2 "** See: https://github.com/Netflix/asgard/wiki/Asgard-Configuration **"
echo >&2
exit 1
fi
cat > "$DIR/asgard.sh" <<'EOF'
#!/bin/bash
DIR="$(cd $(dirname "$0") && pwd)"
case "$(uname -s)" in
Linux) JAVA_HOME=/usr ;;
Darwin) JAVA_HOME="$(/usr/libexec/java_home)" ;;
*) true ;;
esac
if [ -n "$JAVA_HOME" ]; then
export PATH="$PATH:$JAVA_HOME/bin"
export JAVA_HOME
fi
echo >&2
echo >&2
echo >&2 "** open your browser to http://localhost:8080 **"
echo >&2
echo >&2 "** asgard wiki: https://github.com/Netflix/asgard/wiki **"
echo >&2
echo >&2
cd /tmp
java ${JAVA_OPTS:- -Xmx1024M -XX:MaxPermSize=128m} -jar "$DIR/asgard-standalone.jar" "$@"
EOF
chmod +x "$DIR/asgard.sh"
"$DIR/asgard.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment