Skip to content

Instantly share code, notes, and snippets.

@harto
Last active August 29, 2015 13:56
Show Gist options
  • Save harto/9183907 to your computer and use it in GitHub Desktop.
Save harto/9183907 to your computer and use it in GitHub Desktop.
Install Buildbox agent
#!/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