minfra-cli 4.3.1 → 4.5.0
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/CHANGELOG.md +6 -0
 - data/README.md +1 -14
 - data/lib/minfra/cli/commands/project/branch.rb +19 -7
 - data/lib/minfra/cli/commands/stack.rb +4 -4
 - data/lib/minfra/cli/runner.rb +3 -1
 - data/lib/minfra/cli/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 07b87ef33ed2dc996e44d256b5a7261ddc450bdb9ec62ff4cf14ee75100fe54d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: affd2f04ae229524d2aca2f27186cc788385071b91d31af715f9852869aafed5
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 93eeee98335ef70bab22772027c2c9d760d3fbb8e8bc0c6bfb84da675df0e5d04913db030012469f3c1092558dbc5b4b642042d5830953b976c4d5cc0b27e419
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 291c28620311e16e4770a0db2a1d8e18a88529c5cf13e87b52dced59fc5e877533d00008d1561ba64713d2c566754e77d2724a62f7b55e054ff2d587dd2e2457
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,3 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # 4.5.0
         
     | 
| 
      
 2 
     | 
    
         
            +
             * removing the env.roles dependency so it's env.stacks only
         
     | 
| 
      
 3 
     | 
    
         
            +
            # 4.4.0
         
     | 
| 
      
 4 
     | 
    
         
            +
             * adding test option to runner to not run any command
         
     | 
| 
      
 5 
     | 
    
         
            +
             * adding option tag to project branch create to fully override tag generation logic
         
     | 
| 
      
 6 
     | 
    
         
            +
             * adding test options to project branch create to not run the final git command
         
     | 
| 
       1 
7 
     | 
    
         
             
            # 4.3.1
         
     | 
| 
       2 
8 
     | 
    
         
             
             * hashie mash hashes for helm values are now type converted correctl
         
     | 
| 
       3 
9 
     | 
    
         
             
            # 4.3.0
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -14,7 +14,7 @@ Is a KIND (k8s in docker) based development environment. 
     | 
|
| 
       14 
14 
     | 
    
         
             
            |   | MINFRA_ARGV_FILE     |                       | --minfra_argv_file [PATH TO A CSV FILE FILE] |   |
         
     | 
| 
       15 
15 
     | 
    
         
             
            |   | MINFRA_LOGGING_LEVEL | minfra.logging_level  |                                              |   |
         
     | 
| 
       16 
16 
     | 
    
         
             
            |   |                      | minfra.hiera.env_path |                                              |   |
         
     | 
| 
       17 
     | 
    
         
            -
            |   |                      | default_stacks        |                                              | env.stacks  
     | 
| 
      
 17 
     | 
    
         
            +
            |   |                      | default_stacks        |                                              | env.stacks |
         
     | 
| 
       18 
18 
     | 
    
         
             
            |   |                      |                       |                  | infra::allow_insecure_k8s_connections |
         
     | 
| 
       19 
19 
     | 
    
         
             
            | when set to 'true' all hiera lookups are logged on debug level  | MINFRA_DEBUG_HIERA_LOOKUPS | | | |
         
     | 
| 
       20 
20 
     | 
    
         
             
            | to override the backends in the hiera file, comma separated | MINFRA_HIERA_BACKENDS | | | |
         
     | 
| 
         @@ -22,19 +22,6 @@ Is a KIND (k8s in docker) based development environment. 
     | 
|
| 
       22 
22 
     | 
    
         
             
            ## Expected hiera data
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
             * l("cluster.id"): the k8s name of the cluster
         
     | 
| 
       25 
     | 
    
         
            -
             
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
25 
     | 
    
         | 
| 
       39 
26 
     | 
    
         
             
            # Orchparty
         
     | 
| 
       40 
27 
     | 
    
         | 
| 
         @@ -7,15 +7,27 @@ module Minfra 
     | 
|
| 
       7 
7 
     | 
    
         
             
                    desc "create 'story desc'", 'create branch'
         
     | 
| 
       8 
8 
     | 
    
         
             
                    option :prefix, type: :string,
         
     | 
| 
       9 
9 
     | 
    
         
             
                                    desc: "don't use your git email address or project.branch.create.prefix or identity.email"
         
     | 
| 
      
 10 
     | 
    
         
            +
                    option :tag, type: :string, desc: 'overwrite default tag generation'
         
     | 
| 
      
 11 
     | 
    
         
            +
                    option :test, type: :boolean, default: false, desc: "don't create the tag just show the command"
         
     | 
| 
      
 12 
     | 
    
         
            +
                    
         
     | 
| 
       10 
13 
     | 
    
         
             
                    def create(story_desc)
         
     | 
| 
       11 
     | 
    
         
            -
                       
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
                       
     | 
| 
       14 
     | 
    
         
            -
                         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
                        prefix =  
     | 
| 
      
 14 
     | 
    
         
            +
                      if options[:tag]
         
     | 
| 
      
 15 
     | 
    
         
            +
                        tag = options[:tag]
         
     | 
| 
      
 16 
     | 
    
         
            +
                      else
         
     | 
| 
      
 17 
     | 
    
         
            +
                        story_desc = story_desc.gsub(/[^0-9a-z-]/i, '_')
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                        prefix = options[:prefix] || Minfra::Cli.config.project.dig('project', 'branch', 'create', 'prefix')
         
     | 
| 
      
 20 
     | 
    
         
            +
                        unless prefix
         
     | 
| 
      
 21 
     | 
    
         
            +
                          email = Minfra::Cli.config.project.dig('identity', 'email') || `git config user.email`
         
     | 
| 
      
 22 
     | 
    
         
            +
                          fullname = email.split('@').first
         
     | 
| 
      
 23 
     | 
    
         
            +
                          prefix = fullname[0] + fullname.split('.').last
         
     | 
| 
      
 24 
     | 
    
         
            +
                        end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                        now = Time.now.utc.strftime('%Y%m%d')
         
     | 
| 
      
 27 
     | 
    
         
            +
                        tag = options[:tag] || "#{prefix}_#{story_desc}_#{now}"
         
     | 
| 
       17 
28 
     | 
    
         
             
                      end
         
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                      Runner.run("git checkout -b #{tag}", test: options[:test])
         
     | 
| 
       19 
31 
     | 
    
         
             
                    end
         
     | 
| 
       20 
32 
     | 
    
         
             
                  end
         
     | 
| 
       21 
33 
     | 
    
         
             
                end
         
     | 
| 
         @@ -33,14 +33,14 @@ module Minfra 
     | 
|
| 
       33 
33 
     | 
    
         
             
                  option :opts
         
     | 
| 
       34 
34 
     | 
    
         
             
                  option :force, type: :boolean
         
     | 
| 
       35 
35 
     | 
    
         
             
                  def deploy(stack_name, message = '')
         
     | 
| 
       36 
     | 
    
         
            -
                    stacks = l('env. 
     | 
| 
      
 36 
     | 
    
         
            +
                    stacks = l('env.stacks') || []
         
     | 
| 
       37 
37 
     | 
    
         
             
                    default_stacks = minfra_config.project.default_stacks || []
         
     | 
| 
       38 
     | 
    
         
            -
                    stacks  
     | 
| 
      
 38 
     | 
    
         
            +
                    stacks += default_stacks
         
     | 
| 
       39 
39 
     | 
    
         
             
                    if stacks.include?(stack_name) || options[:force] || options[:test]
         
     | 
| 
       40 
40 
     | 
    
         
             
                      kube.deploy(stack_name, message)
         
     | 
| 
       41 
41 
     | 
    
         
             
                    else
         
     | 
| 
       42 
     | 
    
         
            -
                      exit_error("project:default_stacks or hiera:env. 
     | 
| 
       43 
     | 
    
         
            -
                    end 
     | 
| 
      
 42 
     | 
    
         
            +
                      exit_error("project:default_stacks or hiera:env.stacks has to include '#{stack_name}' or use --force or --test")
         
     | 
| 
      
 43 
     | 
    
         
            +
                    end
         
     | 
| 
       44 
44 
     | 
    
         
             
                  end
         
     | 
| 
       45 
45 
     | 
    
         | 
| 
       46 
46 
     | 
    
         
             
                  desc 'rollback <extraargs>', 'rollback a deployment'
         
     | 
    
        data/lib/minfra/cli/runner.rb
    CHANGED
    
    | 
         @@ -64,16 +64,18 @@ module Minfra 
     | 
|
| 
       64 
64 
     | 
    
         | 
| 
       65 
65 
     | 
    
         
             
                  attr_reader :exit_on_error, :runner, :cmd, :on_output
         
     | 
| 
       66 
66 
     | 
    
         | 
| 
       67 
     | 
    
         
            -
                  def initialize(cmd, exit_on_error: true, runner: :popen, on_output: nil)
         
     | 
| 
      
 67 
     | 
    
         
            +
                  def initialize(cmd, exit_on_error: true, runner: :popen, on_output: nil, test: false)
         
     | 
| 
       68 
68 
     | 
    
         
             
                    @cmd = cmd
         
     | 
| 
       69 
69 
     | 
    
         
             
                    @exit_on_error = exit_on_error
         
     | 
| 
       70 
70 
     | 
    
         
             
                    @runner = runner
         
     | 
| 
       71 
71 
     | 
    
         
             
                    @on_output = on_output
         
     | 
| 
      
 72 
     | 
    
         
            +
                    @test = test
         
     | 
| 
       72 
73 
     | 
    
         
             
                  end
         
     | 
| 
       73 
74 
     | 
    
         | 
| 
       74 
75 
     | 
    
         
             
                  def run
         
     | 
| 
       75 
76 
     | 
    
         
             
                    debug("running (#{@runner}): #{@cmd}")
         
     | 
| 
       76 
77 
     | 
    
         
             
                    res = Result.new(on_output:)
         
     | 
| 
      
 78 
     | 
    
         
            +
                    return res if @test
         
     | 
| 
       77 
79 
     | 
    
         
             
                    case @runner
         
     | 
| 
       78 
80 
     | 
    
         
             
                          when :system
         
     | 
| 
       79 
81 
     | 
    
         
             
                            run_system(res)
         
     | 
    
        data/lib/minfra/cli/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: minfra-cli
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 4. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 4.5.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Peter Schrammel
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-06-29 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: thor
         
     |