Last active
August 29, 2015 13:56
-
-
Save harto/9183907 to your computer and use it in GitHub Desktop.
Install Buildbox agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
# Install Buildbox Ruby agent as a service | |
if [ -z "$BUILDBOX_API_TOKEN" ]; then | |
echo "Must specify BUILDBOX_API_TOKEN env" | |
exit 1 | |
fi | |
BUILDBOX_USER=ubuntu | |
apt-get -y install ruby2.0 ruby2.0-dev libffi-dev gcc make | |
gem install buildbox | |
su - $BUILDBOX_USER -c "buildbox agent:setup $BUILDBOX_API_TOKEN" | |
cat >/etc/init/buildbox.conf <<EOF | |
respawn | |
respawn limit 15 5 | |
start on runlevel [2345] | |
stop on runlevel [06] | |
script | |
su - $BUILDBOX_USER -c "buildbox agent:start" | |
end script | |
EOF | |
service buildbox start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment