Skip to content

Instantly share code, notes, and snippets.

@maguec
Created October 5, 2011 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maguec/1263644 to your computer and use it in GitHub Desktop.
Save maguec/1263644 to your computer and use it in GitHub Desktop.
Easy Rake file for building a deployable gem
task :default => :build_gem
##################################################################
def run_command(cmd)
cmdrun = IO.popen(cmd)
output = cmdrun.read
cmdrun.close
if $?.to_i > 0
puts "count not run #{cmd}, it returned an error #{output}"
exit 2
end
puts "OK: ran command #{cmd}"
end
desc 'build the gem'
task :build_gem do
run_command("gem build deployable_sinatra.gemspec")
end
desc 'clean gems'
task :clean_gem do
run_command("rm -f deployable_sinatra*.gem")
end
desc 'clean vendor'
task :clean_vendor do
run_command("rm -rf vendor")
end
desc 'bundle for deployment'
task :bundle_deploy do
run_command("bundle install --deployment")
end
desc 'bundle for deployment'
task :bundle do
run_command("bundle install")
end
desc 'what the CI server should run'
task :ciserver => [:clean_gem, :clean_vendor, :bundle, :bundle_deploy, :build_gem] do
puts "Getting Ready to Deploy"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment