Skip to content

Instantly share code, notes, and snippets.

@hak8or
Created April 19, 2015 17:45
Show Gist options
  • Select an option

  • Save hak8or/9b23b7de0fad00478c5a to your computer and use it in GitHub Desktop.

Select an option

Save hak8or/9b23b7de0fad00478c5a to your computer and use it in GitHub Desktop.
Del me, temporary rake file working on
# Handle dependancies required by the app.
namespace :setup do
desc "Starts redis using a preconfigured docker image."
task :start_redis_server do
sh "docker start some-redis"
end
# Find a way for this to run if some-redis doesn't exist yet.
desc "Fetches and starts an initial redis docker image."
task :make_redis_server do
sh "docker pull redis"
sh "docker run -p 6379:6379 --name some-redis -d redis"
end
desc "Starts sidekiq as a deamon for handling background tasks."
task :start_sidekiq do
sh "sidekiq -d -L $HOME/sidekiq.log -r ./app.rb"
end
desc "Starts sidekiq's dashboard using config.ru as a daemon."
task :start_sidekiq_dashboard do
sh "bundle exec rackup config.ru -D"
end
desc "Runs all of important setup stuff"
multitask :setup_all => [:start_redis_server, :start_sidekiq]
end
# Handle dependancies required by things *within* the app.
namespace :app do
desc "Starts Sinatra webserver"
task :start_sinatra do
sh "ruby app.rb"
end
desc "Currently just a wrapper for setup:setup_all"
task :start => ["setup:setup_all", "start_sinatra"]
end
desc "Currenty just a wrapper for app:start"
task :default => ["app:start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment