Created
April 23, 2015 22:21
-
-
Save skierkowski/c2f9e2a16f6c1760b607 to your computer and use it in GitHub Desktop.
This file contains 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
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