Created
January 20, 2015 16:30
-
-
Save chasseurmic/19a41b85ead855416d27 to your computer and use it in GitHub Desktop.
Rake tasks for building and deploying Rails app
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
namespace :docker do | |
desc "Remove docker container" | |
task :clean do | |
sh './clean.sh' | |
end | |
desc "Build Docker image" | |
task :build => [:clean] do | |
sh 'docker build -t localhost:5000/username/repo_name .' | |
end | |
desc "Run Docker image" | |
task :run => [:clean] do | |
sh 'docker run --name repo_name -p host_port:container_port -d localhost:5000/username/repo_name' | |
end | |
desc "Deploy Docker image" | |
task :deploy => [:build] do | |
sh './deploy.sh' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment