Class: Terraspace::Cloud::Upload::Package
- Inherits:
-
Base
- Object
- Terraspace::CLI::Base
- Base
- Base
- Terraspace::Cloud::Upload::Package
- Defined in:
- lib/terraspace/cloud/upload/package.rb
Instance Method Summary collapse
Methods inherited from Base
#artifacts_path, #initialize, #zip_path
Methods inherited from Base
#cancelled?, #changes?, #clean_cache2_stage, #cloud_upload, #initialize, #record?, #sh, #stage_attrs, #success_status
Methods included from Util::Pretty
Methods included from Util::Sure
Methods included from Util::Logging
Methods included from Context
Methods included from Api::Validate
Methods included from Api::Concern
#api, #cloud_stack_name, #expander, #region
Methods included from Api::Concern::Errors
Methods inherited from Terraspace::CLI::Base
Constructor Details
This class inherits a constructor from Terraspace::Cloud::Upload::Base
Instance Method Details
#build ⇒ Object
5 6 7 8 9 |
# File 'lib/terraspace/cloud/upload/package.rb', line 5 def build copy tidy zip # returns zip path end |
#copy ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/terraspace/cloud/upload/package.rb', line 11 def copy FileUtils.rm_rf(artifacts_path) FileUtils.mkdir_p(File.dirname(artifacts_path)) expr = "#{@mod.cache_dir}/.terraspace-cache/.cache2/#{@type}/*" Dir.glob(expr).each do |src| dest = "#{artifacts_path}/#{File.basename(src)}" FileUtils.mkdir_p(File.dirname(dest)) FileUtils.cp(src, dest) end end |
#tidy ⇒ Object
23 24 25 |
# File 'lib/terraspace/cloud/upload/package.rb', line 23 def tidy Tidy.new(@options).cleanup end |
#zip ⇒ Object
27 28 29 30 31 |
# File 'lib/terraspace/cloud/upload/package.rb', line 27 def zip FileUtils.rm_f(zip_path) ZipFolder.zip(artifacts_path, zip_path) zip_path end |