Firstly, you'll need to install rvm as the buildkite-agent
user:
sudo su buildkite-agent
curl -sSL https://get.rvm.io | bash -s stable
source /var/lib/buildkite-agent/.rvm/scripts/rvm
rvm install 2.4.0 && rvm use 2.4.0 && gem install bundler
Secondly, make rvm
available to your build commands by adding the following pre-command
Buildkite Agent hook:
#!/bin/bash
# Place this in /etc/buildkite-agent/hooks/pre-command
#
# Needs to be `chown buildkite-agent` and `chmod +x`
# RVM uses unbound variables and will fail without this
set +u
source /var/lib/buildkite-agent/.rvm/scripts/rvm
Finally, set up your build pipeline with the following two steps and run a build:
:ruby:
bundle install && bundle exec ruby test.rb
:node:
npm install && node test.js