Skip to content

Instantly share code, notes, and snippets.

@skierkowski
Created April 23, 2015 22:21
Show Gist options
  • Save skierkowski/c2f9e2a16f6c1760b607 to your computer and use it in GitHub Desktop.
Save skierkowski/c2f9e2a16f6c1760b607 to your computer and use it in GitHub Desktop.
require 'tutum'
require 'awesome_print'
require 'securerandom'
t = Tutum.new('skierkowski', '...')
repo = 'https://github.com/skierkowski/hello-middleman/archive/master.zip'
commands = [
'apt-get update',
'apt-get install -y nodejs unzip --no-install-recommends',
'mkdir /work',
'cd /work',
"wget #{repo}",
"unzip *",
'cd */',
'bundle install',
'bundle exec middleman build'
]
command = "sh -c '#{commands.join(' && ')}'"
options = {
image: 'ruby:2.1',
name: "test-#{SecureRandom.hex(4)}",
container_size: 'XS',
run_command: command,
target_num_containers: 1
}
service = t.services.create(options)
t.services.start(service['uuid'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment