Class: Jets::Code::Copy::Rsync
Instance Method Summary collapse
- #check_zip_installed! ⇒ Object
-
#create_temp_zip ⇒ Object
interface method.
Methods inherited from Base
#always_keep, #always_remove, #extract_code, #git_info, #gitconfig, #remove_temp_files, #run, run, #save_gitinfo
Methods included from Util::Sh
Methods included from Util::Logging
Methods included from Util::Git
Instance Method Details
#check_zip_installed! ⇒ Object
14 15 16 17 |
# File 'lib/jets/code/copy/rsync.rb', line 14 def check_zip_installed! return if system("type zip > /dev/null 2>&1") abort "ERROR: zip command is required. Please install zip command." end |
#create_temp_zip ⇒ Object
interface method
4 5 6 7 8 9 10 11 12 |
# File 'lib/jets/code/copy/rsync.rb', line 4 def create_temp_zip FileUtils.mkdir_p("#{build_root}/stage/code-temp") excludes = " --exclude .git" excludes << " --exclude-from=#{Jets.root}/.gitignore" if File.exist?("#{Jets.root}/.gitignore") quiet_sh "rsync -aq#{excludes} #{Jets.root}/ #{build_root}/stage/code-temp" # Create zip file check_zip_installed! quiet_sh "cd #{build_root}/stage/code-temp && zip -q -r #{build_root}/stage/code-temp.zip ." end |