Skip to content

Instantly share code, notes, and snippets.

@colbycheeze
Created November 5, 2015 22:42
Show Gist options
  • Save colbycheeze/99bac0694185427d11a0 to your computer and use it in GitHub Desktop.
Save colbycheeze/99bac0694185427d11a0 to your computer and use it in GitHub Desktop.
desc "Add and commit any changes made"
task :commit, [:msg] do |t, args|
puts "## Adding all files (git add .)"
system("git add .")
commit_msg = args.to_a.join(', ')
puts "## Committing chgnges (git commit -m '#{commit_msg}')"
system("git commit -m '#{commit_msg}'")
end
desc "pushes up all staged changes"
task :push do
puts "## Pushing to Github (git push)"
system("git push")
end
desc "Build Blog"
task :build do
puts "## Building website (middleman build --clean)"
status = system("bundle exec middleman build --clean")
puts status ? "OK" : "FAILED"
end
desc "Deploy website to cloud foundry"
task :deploy do
puts "## Deploying website (cf push cloudhaven -m 64M)"
status = system("cf push cloudhaven -m 64M")
puts status ? "OK" : "FAILED"
end
# desc "Deploy website to Github Pages with Middleman Deploy"
# task :deploy do
# puts "## Deploying website to github pages (middleman deploy)"
# status = system("bundle exec middleman deploy")
# puts status ? "OK" : "FAILED"
# end
desc "One Line deploy"
task :go, [:msg] => [:commit, :push, :build, :deploy] do |t, args|
end
namespace :start do
desc "Start BrowserSync"
task :bsync do
puts "## Starting browsersync server"
status = system "browser-sync start --proxy 'localhost:4567' --files source"
puts status ? "OK" : "FAILED"
end
task :middleman do
puts "## Starting middleman"
status = system "bundle exec middleman"
puts status ? "OK" : "FAILED"
end
end
desc "Start all the servers"
multitask :serve => [ 'start:bsync', 'start:middleman' ]
desc "Start the serves"
task :default => [:serve]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment