Class: DockerComposeDeploy::Actions::Deployment
- Inherits:
-
Struct
- Object
- Struct
- DockerComposeDeploy::Actions::Deployment
- Defined in:
- lib/docker_compose_deploy/actions/deployment.rb
Instance Attribute Summary collapse
-
#ignore_pull_failures ⇒ Object
Returns the value of attribute ignore_pull_failures.
-
#shell ⇒ Object
Returns the value of attribute shell.
Instance Method Summary collapse
Instance Attribute Details
#ignore_pull_failures ⇒ Object
Returns the value of attribute ignore_pull_failures
5 6 7 |
# File 'lib/docker_compose_deploy/actions/deployment.rb', line 5 def ignore_pull_failures @ignore_pull_failures end |
#shell ⇒ Object
Returns the value of attribute shell
5 6 7 |
# File 'lib/docker_compose_deploy/actions/deployment.rb', line 5 def shell @shell end |
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/docker_compose_deploy/actions/deployment.rb', line 7 def create shell.ssh!("mkdir -p ./sites") shell.ssh!("rm -rf ./sites/config") # bin/deploy is irreversible :) shell.scp!("./sites/config/", "#{connection}:./sites/config", "-r") docker_compose.services.each do |service_name| shell.ssh!("mkdir -p ./sites/data/#{service_name}") shell.ssh!("mkdir -p ./sites/log/#{service_name}") end shell.scp!(docker_compose.path, "#{connection}:./docker-compose.yml") shell.ssh!("docker-compose down") shell.ssh!("docker-compose pull #{ignore_pull_failures_option}") shell.ssh!("docker-compose up -d") shell.notify "success" end |