Class: Neptuno::CLI::Clone

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/neptuno/cli/clone.rb

Overview

Init Neptuno files

Instance Method Summary collapse

Instance Method Details

#call(**options) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/neptuno/cli/clone.rb', line 11

def call(**options)
  git_url = options[:args].first
  args_path = options[:args].second
  path = args_path || git_url.split("/").last.split(".").first
  `git clone --recurse-submodules #{git_url} #{path}`

  sleep(1)

  return unless options.fetch(:provision)

  `cd #{path} && neptuno services update -am`
  puts "Building Docker images"
  `cd #{path} && neptuno build -a`
  puts "Starting Docker containers"
  `cd #{path} && neptuno up -a`
  puts "Starting service processes"
  `cd #{path} && neptuno start -a`
end