Sha256: d855c79e5bf57a254557e31644187fb72bde87a62cd817b05095d0726eba10a8
Contents?: true
Size: 1.19 KB
Versions: 3
Compression:
Stored size: 1.19 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 = 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 thread 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
3 entries across 3 versions & 1 rubygems