cem_acpt 0.8.5 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/Gemfile.lock +2 -2
 - data/lib/cem_acpt/image_builder/provision_commands.rb +1 -0
 - data/lib/cem_acpt/image_builder.rb +5 -1
 - data/lib/cem_acpt/provision/terraform/linux.rb +1 -1
 - data/lib/cem_acpt/provision/terraform/terraform_cmd.rb +11 -3
 - data/lib/cem_acpt/version.rb +1 -1
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 8b20898f83c35c92ab9276fe4753a82aca2da25da72169d35600b6dba3c27435
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 4ef575b47bfee5102cf5c8effb6a50183cfc927da524ab319b135f2654211726
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 19414bc367fdb4a101b9969ebb3a76276712238455947648f0434c1df748b959013fcfe0206491cee841709554d3738021e1524dee646e4e40c1f967ccf73729
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3366d39bedcb059f2f8d848aae6f872677e62c9593b59021286e1a4bfaa1eb2939f0574dc83aab643cd180e04909c948c5d2a0b27ef05c63f7db0808dd8239b6
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
| 
         @@ -144,7 +144,11 @@ module CemAcpt 
     | 
|
| 
       144 
144 
     | 
    
         
             
                  end
         
     | 
| 
       145 
145 
     | 
    
         | 
| 
       146 
146 
     | 
    
         
             
                  def terraform
         
     | 
| 
       147 
     | 
    
         
            -
                     
     | 
| 
      
 147 
     | 
    
         
            +
                    # Instead of passing in @image_terraform_dir, we pass in @working_dir. The reason being
         
     | 
| 
      
 148 
     | 
    
         
            +
                    # @image_terraform_dir is the parent directory that has path like ~/.cem_acpt/terraform/image/gcp (gcp being the platform)
         
     | 
| 
      
 149 
     | 
    
         
            +
                    # We want to pass the working directory that has the linux and windows directories in it
         
     | 
| 
      
 150 
     | 
    
         
            +
                    # which we can then further manipulate to get the correct path.
         
     | 
| 
      
 151 
     | 
    
         
            +
                    @terraform ||= CemAcpt::Provision::TerraformCmd.new(@working_dir, @environment)
         
     | 
| 
       148 
152 
     | 
    
         
             
                  end
         
     | 
| 
       149 
153 
     | 
    
         | 
| 
       150 
154 
     | 
    
         
             
                  def new_environment(config)
         
     | 
| 
         @@ -89,11 +89,17 @@ module CemAcpt 
     | 
|
| 
       89 
89 
     | 
    
         
             
                  end
         
     | 
| 
       90 
90 
     | 
    
         | 
| 
       91 
91 
     | 
    
         
             
                  def chdir(opts = {})
         
     | 
| 
       92 
     | 
    
         
            -
                    [extract_arg!(opts, :chdir) 
     | 
| 
      
 92 
     | 
    
         
            +
                    [Dir.pwd, working_dir, extract_arg!(opts, :chdir)].each do |d|
         
     | 
| 
       93 
93 
     | 
    
         
             
                      next if d.nil? || d.empty?
         
     | 
| 
       94 
94 
     | 
    
         | 
| 
       95 
95 
     | 
    
         
             
                      d = File.expand_path(d)
         
     | 
| 
       96 
     | 
    
         
            -
             
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
      
 97 
     | 
    
         
            +
                      # Added a check for main.tf to make sure we're in the right directory and have necessary file whhen running terraform
         
     | 
| 
      
 98 
     | 
    
         
            +
                      # There are three possible path that we can be in:
         
     | 
| 
      
 99 
     | 
    
         
            +
                      # 1. The working directory that was passed in, which is usually the created temporary directory
         
     | 
| 
      
 100 
     | 
    
         
            +
                      # 2. The current directory that this code is being executed from (usually in a linux or windows directory of working directory)
         
     | 
| 
      
 101 
     | 
    
         
            +
                      # 3. The working directory that was passed in, but with a linux or windows directory appended to it
         
     | 
| 
      
 102 
     | 
    
         
            +
                      return "-chdir=#{d}" if File.directory?(d) && File.exist?(File.join(d, 'main.tf'))
         
     | 
| 
       97 
103 
     | 
    
         | 
| 
       98 
104 
     | 
    
         
             
                      logger.warn('CemAcpt::Provision::TerraformCmd') { "Directory #{d} does not exist, using next..." }
         
     | 
| 
       99 
105 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -121,7 +127,9 @@ module CemAcpt 
     | 
|
| 
       121 
127 
     | 
    
         
             
                      k = k.to_s
         
     | 
| 
       122 
128 
     | 
    
         
             
                      k.tr!('_', '-')
         
     | 
| 
       123 
129 
     | 
    
         
             
                      if k == 'vars'
         
     | 
| 
       124 
     | 
    
         
            -
                         
     | 
| 
      
 130 
     | 
    
         
            +
                        # Included a check for Hash so that we can generate JSON to pass to terraform.
         
     | 
| 
      
 131 
     | 
    
         
            +
                        # If not a Hash, then we just pass the value as is, which is a string.
         
     | 
| 
      
 132 
     | 
    
         
            +
                        v.map { |vk, vv| "-var='#{vk}=#{vv.is_a?(Hash) ? JSON.generate(vv) : vv}'" }.join(' ')
         
     | 
| 
       125 
133 
     | 
    
         
             
                      elsif %w[input lock refresh].include?(k) # These are boolean flags with values
         
     | 
| 
       126 
134 
     | 
    
         
             
                        "-#{k}=#{v}"
         
     | 
| 
       127 
135 
     | 
    
         
             
                      elsif v.nil? || (v.respond_to?(:empty) && v.empty?) || v.is_a?(TrueClass)
         
     | 
    
        data/lib/cem_acpt/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: cem_acpt
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.8. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.8.6
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - puppetlabs
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2023-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-10-09 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: async-http
         
     | 
| 
         @@ -277,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       277 
277 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       278 
278 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       279 
279 
     | 
    
         
             
            requirements: []
         
     | 
| 
       280 
     | 
    
         
            -
            rubygems_version: 3.4. 
     | 
| 
      
 280 
     | 
    
         
            +
            rubygems_version: 3.4.19
         
     | 
| 
       281 
281 
     | 
    
         
             
            signing_key:
         
     | 
| 
       282 
282 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       283 
283 
     | 
    
         
             
            summary: CEM Acceptance Tests
         
     |