Class: Watchdog::Bootstrap

Inherits:
Object
  • Object
show all
Defined in:
lib/watchdog/bootstrap.rb

Class Method Summary collapse

Class Method Details

.change_branch(git_branch) ⇒ Object



11
12
13
14
# File 'lib/watchdog/bootstrap.rb', line 11

def self.change_branch(git_branch)
  Watchdog::Utils.run_cmd "git checkout #{git_branch}"
  Watchdog::Utils.run_cmd "git reset --hard origin/#{git_branch}"
end

.clone_repository(git_url) ⇒ Object



5
6
7
8
9
# File 'lib/watchdog/bootstrap.rb', line 5

def self.clone_repository(git_url)
  %x[ #{"git clone #{git_url} project_dir"} ]

  $watchdog_relative_dir = 'project_dir'
end

.setup_environmentObject



16
17
18
# File 'lib/watchdog/bootstrap.rb', line 16

def self.setup_environment
  %x[ #{"cp .env.project #{$watchdog_relative_dir}/.env"} ]
end

.setup_project(setup_cmd) ⇒ Object



20
21
22
# File 'lib/watchdog/bootstrap.rb', line 20

def self.setup_project(setup_cmd)
  Watchdog::Utils.run_cmd setup_cmd
end