sct 0.1.8 → 0.1.9
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/.DS_Store +0 -0
- data/.rspec +0 -0
- data/.travis.yml +0 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +22 -0
- data/Rakefile +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/sct/.DS_Store +0 -0
- data/lib/sct/ClassLevelInheritableAttributes.rb +0 -0
- data/lib/sct/command.rb +0 -0
- data/lib/sct/command_interface.rb +0 -0
- data/lib/sct/command_option.rb +0 -0
- data/lib/sct/commands/cluster.rb +48 -42
- data/lib/sct/docker/php.rb +0 -0
- data/lib/sct/setup/helpers.rb +0 -0
- data/lib/sct/version.rb +1 -1
- data/sct.gemspec +0 -0
- 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: ea1ce86b81fd6b343bb0d8452395e606b02451dd6c008e0fbbc825ab7c818a7b
         | 
| 4 | 
            +
              data.tar.gz: ea96dbd41909af88108cf6340878a730e5df2f3635c8058d3ed01b01e259706f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 518f144410191c3d2d21967d8ed52f08cd3a92d5fb97c508374fddd5d6e863be9e491000a26cb1dcb5b91494d706a1ef730870fed478c3932f2562ca80dba0fb
         | 
| 7 | 
            +
              data.tar.gz: c1d0a5663db55f722ea1dd168cc278345965e28a61cad1413e2cb5c6542d210ef59029f65a7b73eaf134210197205bf3c7f53a89d32eb4d4dbbfe44e42c38536
         | 
    
        data/.DS_Store
    CHANGED
    
    | 
            File without changes
         | 
    
        data/.rspec
    CHANGED
    
    | 
            File without changes
         | 
    
        data/.travis.yml
    CHANGED
    
    | 
            File without changes
         | 
    
        data/CODE_OF_CONDUCT.md
    CHANGED
    
    | 
            File without changes
         | 
    
        data/Gemfile
    CHANGED
    
    | 
            File without changes
         | 
    
        data/LICENSE.txt
    CHANGED
    
    | 
            File without changes
         | 
    
        data/README.md
    CHANGED
    
    | @@ -103,6 +103,28 @@ Repeat steps 1-3 from the installation instruction above. | |
| 103 103 |  | 
| 104 104 | 
             
            Bug reports and pull requests are welcome on GitHub at https://gitlab.com/proactive-software/packages/sct. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
         | 
| 105 105 |  | 
| 106 | 
            +
            ## Releasing
         | 
| 107 | 
            +
             | 
| 108 | 
            +
            #### Ownership
         | 
| 109 | 
            +
            Owners of the Ruby Gem project are able to release a new version. You can check the ownership status at https://rubygems.org/gems/sct. If you are an owner you can continue with the following steps. If not you may request to become an owner, or ask an existing owner to do the release for you. 
         | 
| 110 | 
            +
             | 
| 111 | 
            +
            #### Authentication
         | 
| 112 | 
            +
            Owners should update their credentials once before they can actually release new versions. The steps to do this are:
         | 
| 113 | 
            +
            ```$bash
         | 
| 114 | 
            +
            curl -u [YOUR-RUBYGEM-USERNAME] https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
         | 
| 115 | 
            +
            chmod 0600 ~/.gem/credentials
         | 
| 116 | 
            +
            ```
         | 
| 117 | 
            +
             | 
| 118 | 
            +
            ### Release steps
         | 
| 119 | 
            +
            #### Update version
         | 
| 120 | 
            +
            Before releasing you are required to update the version of the new release. You can do this manually by incrementing the value in the file `./sct/lib/sct/version.rb`. After this you need to commit this change and push it to the master branch.
         | 
| 121 | 
            +
             | 
| 122 | 
            +
            #### Release
         | 
| 123 | 
            +
            You are now ready to release. You can do this with a simple command in the SCT repository's root directory:
         | 
| 124 | 
            +
            ```$xslt
         | 
| 125 | 
            +
            rake release
         | 
| 126 | 
            +
            ```
         | 
| 127 | 
            +
             | 
| 106 128 | 
             
            ## License
         | 
| 107 129 |  | 
| 108 130 | 
             
            The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
         | 
    
        data/Rakefile
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/.DS_Store
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/sct/.DS_Store
    CHANGED
    
    | 
            File without changes
         | 
| 
            File without changes
         | 
    
        data/lib/sct/command.rb
    CHANGED
    
    | 
            File without changes
         | 
| 
            File without changes
         | 
    
        data/lib/sct/command_option.rb
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/sct/commands/cluster.rb
    CHANGED
    
    | @@ -2,51 +2,57 @@ require 'sct/command_interface' | |
| 2 2 |  | 
| 3 3 | 
             
            module Sct
         | 
| 4 4 |  | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
                IS_PUBLIC_COMMAND = true
         | 
| 8 | 
            -
                SYNTAX = 'sct cluster up | sct cluster down | sct cluster update-config'
         | 
| 9 | 
            -
                SUMMARY = 'Starts/stops or updates the config of the minikube cluster'
         | 
| 10 | 
            -
                EXAMPLE = 'sct cluster up | sct cluster down | sct cluster update-config'
         | 
| 11 | 
            -
                EXAMPLE_DESCRIPTION = 'Starts/stops or updates the config of the minikube cluster'
         | 
| 12 | 
            -
                DESCRIPTION = "Sct cluster allows you to start, stop or update the config of the Spend Cloud minikube cluster"
         | 
| 13 | 
            -
             | 
| 14 | 
            -
                OPTIONS = []
         | 
| 15 | 
            -
             | 
| 16 | 
            -
                def execute(args, options)
         | 
| 17 | 
            -
                  return puts "SCT has not been initialized. Run 'sct init' first.".red unless Sct::Config.exists
         | 
| 18 | 
            -
             | 
| 19 | 
            -
                  case args[0]
         | 
| 20 | 
            -
                    when "up"
         | 
| 21 | 
            -
                        system("minikube start")
         | 
| 22 | 
            -
                        system("minikube ssh -- 'sudo su -c \"echo 10048576 > /proc/sys/fs/inotify/max_user_watches\"'")
         | 
| 23 | 
            -
                        system("sct cluster update-config")
         | 
| 24 | 
            -
                        system("kubectl config use-context minikube")
         | 
| 25 | 
            -
                        system("kubectl delete pod -n kube-system $(kubectl get pods -n kube-system | grep registry-creds | awk '{print $1}')")
         | 
| 26 | 
            -
                        system("sudo sct hostfile")
         | 
| 27 | 
            -
                        puts "\n✔️  You can now visit your environment at 👉 https://spend-cloud.spend.cloud.local 👌"
         | 
| 28 | 
            -
                    when "down"
         | 
| 29 | 
            -
                        system("minikube stop")
         | 
| 30 | 
            -
                    when "update-config"
         | 
| 31 | 
            -
                        return puts "Skipping minikube config ( only needed for windows )".yellow unless Sct::Config.operatingSystem == Sct::Config::WINDOWS
         | 
| 32 | 
            -
             | 
| 33 | 
            -
                        windows_home_path = Sct::Config.getTrueHomePath
         | 
| 34 | 
            -
                        kube_file_path = windows_home_path+"/.kube/config"
         | 
| 35 | 
            -
             | 
| 36 | 
            -
                        if !File.exists?(kube_file_path)
         | 
| 37 | 
            -
                            return puts "#{kube_file_path} doesn't exist".red
         | 
| 38 | 
            -
                        end
         | 
| 5 | 
            +
                class ClusterCommand
         | 
| 39 6 |  | 
| 40 | 
            -
             | 
| 7 | 
            +
                    IS_PUBLIC_COMMAND = true
         | 
| 8 | 
            +
                    SYNTAX = 'sct cluster up | sct cluster down | sct cluster update-config'
         | 
| 9 | 
            +
                    SUMMARY = 'Starts/stops or updates the config of the minikube cluster'
         | 
| 10 | 
            +
                    EXAMPLE = 'sct cluster up | sct cluster down | sct cluster update-config'
         | 
| 11 | 
            +
                    EXAMPLE_DESCRIPTION = 'Starts/stops or updates the config of the minikube cluster'
         | 
| 12 | 
            +
                    DESCRIPTION = "Sct cluster allows you to start, stop or update the config of the Spend Cloud minikube cluster"
         | 
| 41 13 |  | 
| 42 | 
            -
             | 
| 43 | 
            -
             | 
| 44 | 
            -
             | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 14 | 
            +
                    OPTIONS = []
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                    def execute(args, options)
         | 
| 17 | 
            +
                        return puts "SCT has not been initialized. Run 'sct init' first.".red unless Sct::Config.exists
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        if SCT::Config::Windows
         | 
| 20 | 
            +
                            minikube = "minikube.exe"
         | 
| 21 | 
            +
                        else
         | 
| 22 | 
            +
                            minikube = "minikube"
         | 
| 23 | 
            +
                        end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                        case args[0]
         | 
| 26 | 
            +
                            when "up"
         | 
| 27 | 
            +
                                system("#{minikube} start")
         | 
| 28 | 
            +
                                system("#{minikube} ssh -- 'sudo su -c \"echo 10048576 > /proc/sys/fs/inotify/max_user_watches\"'")
         | 
| 29 | 
            +
                                system("sct cluster update-config")
         | 
| 30 | 
            +
                                system("kubectl config use-context minikube")
         | 
| 31 | 
            +
                                system("kubectl delete pod -n kube-system $(kubectl get pods -n kube-system | grep registry-creds | awk '{print $1}')")
         | 
| 32 | 
            +
                                system("sudo sct hostfile")
         | 
| 33 | 
            +
                                puts "\n✔️  You can now visit your environment at 👉 https://spend-cloud.spend.cloud.local 👌"
         | 
| 34 | 
            +
                            when "down"
         | 
| 35 | 
            +
                                system("#{minikube} stop")
         | 
| 36 | 
            +
                            when "update-config"
         | 
| 37 | 
            +
                                return puts "Skipping minikube config ( only needed for windows )".yellow unless Sct::Config.operatingSystem == Sct::Config::WINDOWS
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                                windows_home_path = Sct::Config.getTrueHomePath
         | 
| 40 | 
            +
                                kube_file_path = windows_home_path+"/.kube/config"
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                                if !File.exists?(kube_file_path)
         | 
| 43 | 
            +
                                    return puts "#{kube_file_path} doesn't exist".red
         | 
| 44 | 
            +
                                end
         | 
| 45 | 
            +
             | 
| 46 | 
            +
                                system("sed -e 's~\\\\~/~g' -e 's~C:~/mnt/c~g' < #{kube_file_path} > ~/.kube/minikube-config")
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                                return puts "Windows minikube config copied to ~/.kube/minikube-config".green
         | 
| 49 | 
            +
                            else
         | 
| 50 | 
            +
                                puts "Unknown or missing argument. Please run 'sct cluster up','sct cluster down' or 'sct cluster update-config'".red
         | 
| 51 | 
            +
                        end
         | 
| 52 | 
            +
                    end
         | 
| 47 53 |  | 
| 48 | 
            -
             | 
| 54 | 
            +
                    implements CommandInterface
         | 
| 49 55 |  | 
| 50 | 
            -
             | 
| 56 | 
            +
                end
         | 
| 51 57 |  | 
| 52 58 | 
             
            end
         | 
    
        data/lib/sct/docker/php.rb
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/sct/setup/helpers.rb
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/sct/version.rb
    CHANGED
    
    
    
        data/sct.gemspec
    CHANGED
    
    | 
            File without changes
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: sct
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.9
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Reshad Farid
         | 
| @@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 188 188 | 
             
                - !ruby/object:Gem::Version
         | 
| 189 189 | 
             
                  version: '0'
         | 
| 190 190 | 
             
            requirements: []
         | 
| 191 | 
            -
            rubygems_version: 3. | 
| 191 | 
            +
            rubygems_version: 3.0.6
         | 
| 192 192 | 
             
            signing_key: 
         | 
| 193 193 | 
             
            specification_version: 4
         | 
| 194 194 | 
             
            summary: Spend Cloud Tool.
         |