Class: Shippy::Cli::Server

Inherits:
Base
  • Object
show all
Defined in:
lib/shippy/cli/server.rb

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?, #initialize

Constructor Details

This class inherits a constructor from Shippy::Cli::Base

Instance Method Details

#bootstrapObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/shippy/cli/server.rb', line 3

def bootstrap
  on(SHIPPY.host) do
    dependencies_to_install = [].tap do |dependencies|
      dependencies << "curl" unless execute "which curl", raise_on_non_zero_exit: false
      dependencies << "docker.io" unless execute "which docker", raise_on_non_zero_exit: false
      dependencies << "docker-compose" unless execute "which docker-compose", raise_on_non_zero_exit: false
    end

    if dependencies_to_install.any?
      execute "apt-get update -y && apt-get install #{dependencies_to_install.join(" ")} -y"
    end
  end
end

#setupObject



18
19
20
21
22
23
# File 'lib/shippy/cli/server.rb', line 18

def setup
  on(SHIPPY.host) do
    execute(:mkdir, "-p", SHIPPY.config.deploy_to + "/apps")
    execute(:mkdir, "-p", SHIPPY.config.deploy_to + "/backups")
  end
end