Sha256: fb2d45bb9ea5d9b40e23f5cff252f723c472b687547ccebf35ffb61c92ec1ce9
Contents?: true
Size: 1.16 KB
Versions: 31
Compression:
Stored size: 1.16 KB
Contents
require_relative 'paths' module GitHelper include Paths private def repos_changed `git fetch origin 1>/dev/null` `git diff origin/master` != '' end public def clone_environment FileUtils.mkdir_p(path_to_environment) Dir.chdir(path_to_environment) { `git clone git@bitbucket.org:nixsolutions/ije.git .` } end def clone_provisioning_updater FileUtils.mkdir_p(path_to_provisioning_updater) Dir.chdir(path_to_provisioning_updater) { `git clone git@bitbucket.org:nixsolutions/npu.git .` } end def set_git_hook(&hook_block) Thread.new do Dir.chdir(path_to_environment) do while true if repos_changed `git pull` hook_block.call() end sleep(15) end end end end def remove_local_environment FileUtils.rm_rf(path_to_environment) end def remove_local_provisioning_updater FileUtils.rm_rf(path_to_provisioning_updater) end end
Version data entries
31 entries across 31 versions & 1 rubygems