Skip to content

Instantly share code, notes, and snippets.

@connatser
Created December 29, 2011 16:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connatser/1534917 to your computer and use it in GitHub Desktop.
Save connatser/1534917 to your computer and use it in GitHub Desktop.
Rake web deploy
javascript_compressor: yui
gzip_assets: off
javascripts:
scripts:
- _source/libs/jquery-1.5.min.js
- _source/libs/jquery.address-1.4.min.js
- _source/src/myShit.js
- _source/src/moreOfMyShit.js
stylesheets:
styles:
- _source/styles/main.css
- _source/styles/notMain.css
#!/usr/bin/env rake
LOCALHOST = '/Applications/MAMP/htdocs/mysite'
#rsync deployment for qa
ssh_user_qa = 'user@domain.net'
remote_root_qa = '~/path/to/remote/'
#Compile and Deploy
namespace :deploy do
task :compile_assets do
desc "Concatenate and compile styles and scripts."
system ('jammit -o _public/assets -c _assets.yml')
end
task :deploy_public do
FileUtils.cp_r '_source/content', '_public/'
FileUtils.cp_r '_source/images', '_public/'
FileUtils.cp '_source/index.html', '_public/index.html'
end
task :deploy_dev => [:compile_assets, :deploy_public] do
FileUtils.cp_r '_public/.', LOCALHOST
end
task :launch_chrome do
system('open -a "Google Chrome" "http://localhost:8888/mysite"')
end
task :launch_firefox do
system('open -a "Firefox" "http://localhost:8888/mysite/"')
end
task :deploy_qa do
puts "Deploy to QA."
system('rsync -avz --delete _public/ #{ssh_user_qa}:#{remote_root_qa}')
end
desc "Combines all files required for deployment"
task :compile => [:compile_assets, :deploy_public]
desc "Deploy to Dev"
task :dev => [:deploy_dev]
desc "Deploy to QA"
task :qa => [:deploy_qa]
desc "Deploy and Test"
task :test => [:deploy_dev,:launch_chrome,:launch_firefox]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment