verto 0.5.0 → 0.6.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 +3 -0
- data/README.md +10 -11
- data/Vertofile +53 -0
- data/lib/verto/commands/main_command.rb +1 -1
- data/lib/verto/commands/tag_command.rb +9 -4
- data/lib/verto/utils/templates/Vertofile +10 -6
- data/lib/verto/version.rb +1 -1
- data/lib/verto.rb +4 -0
- metadata +4 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 768852b8be876572bb72068a3865eaeee672d20baa976923758c9634b901a52d
         | 
| 4 | 
            +
              data.tar.gz: 98339f920377dd25299a8240d5e10da2f5161fd749f5753d593d1878de4e6e9c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 8532433e33edc4061b286d8ab409c70d668d231eed44a20b245243f94de4cdf794754c39b588212c71a10ec8522aa02f5b76ee21b6f636f2e283c2219989da66
         | 
| 7 | 
            +
              data.tar.gz: c04e86927b7edcece876e739fc149743e99f972d86bbab755f86b0c006abf90caa255be1f35bdd6366e0e0387b6c9dbe80d97475394c7263c979cd86d89492d8
         | 
    
        data/CHANGELOG.md
    ADDED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -32,20 +32,20 @@ You don't need to install verto in your machine, you can run verto via the docke | |
| 32 32 | 
             
            To use verto in the same way that you use any other cli, you can set an alias in your `.bashrc`, `.zshrc`, etc:
         | 
| 33 33 |  | 
| 34 34 | 
             
            ```shell
         | 
| 35 | 
            -
            alias verto='docker run -v $(pwd):/usr/src/project -it catks/verto:0. | 
| 35 | 
            +
            alias verto='docker run -v $(pwd):/usr/src/project -it catks/verto:0.6.0'
         | 
| 36 36 | 
             
            ```
         | 
| 37 37 |  | 
| 38 38 | 
             
            If you want you can share your git configuration and known_hosts with:
         | 
| 39 39 |  | 
| 40 40 | 
             
            ```shell
         | 
| 41 | 
            -
            alias verto='docker run -v ~/.gitconfig:/etc/gitconfig -v $(pwd):/usr/src/project -v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts -it catks/verto:0. | 
| 41 | 
            +
            alias verto='docker run -v ~/.gitconfig:/etc/gitconfig -v $(pwd):/usr/src/project -v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts -it catks/verto:0.6.0'
         | 
| 42 42 |  | 
| 43 43 | 
             
            ```
         | 
| 44 44 |  | 
| 45 45 | 
             
            You can also use your ssh keys with verto container (for git push):
         | 
| 46 46 |  | 
| 47 47 | 
             
            ```shell
         | 
| 48 | 
            -
            alias verto='docker run -v $(pwd):/usr/src/project -v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts -v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa -e SSH_PRIVATE_KEY=/root/.ssh/id_rsa -it catks/verto:0. | 
| 48 | 
            +
            alias verto='docker run -v $(pwd):/usr/src/project -v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts -v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa -e SSH_PRIVATE_KEY=/root/.ssh/id_rsa -it catks/verto:0.6.0'
         | 
| 49 49 |  | 
| 50 50 | 
             
            ```
         | 
| 51 51 |  | 
| @@ -53,7 +53,7 @@ Or share the git config, known_hosts and ssh_keys: | |
| 53 53 |  | 
| 54 54 |  | 
| 55 55 | 
             
            ```shell
         | 
| 56 | 
            -
            alias verto='docker run -v ~/.gitconfig:/etc/gitconfig -v $(pwd):/usr/src/project -v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts -v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa -e SSH_PRIVATE_KEY=/root/.ssh/id_rsa -it catks/verto:0. | 
| 56 | 
            +
            alias verto='docker run -v ~/.gitconfig:/etc/gitconfig -v $(pwd):/usr/src/project -v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts -v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa -e SSH_PRIVATE_KEY=/root/.ssh/id_rsa -it catks/verto:0.6.0'
         | 
| 57 57 |  | 
| 58 58 | 
             
            ```
         | 
| 59 59 |  | 
| @@ -93,7 +93,11 @@ You can create a new Vertofile with `verto init` or following the next example: | |
| 93 93 | 
             
            ```ruby
         | 
| 94 94 | 
             
            # Vertofile
         | 
| 95 95 |  | 
| 96 | 
            -
            verto_version '0. | 
| 96 | 
            +
            verto_version '0.6.0'
         | 
| 97 | 
            +
             | 
| 98 | 
            +
            config {
         | 
| 99 | 
            +
             # version.prefix = 'v' # Adds a version_prefix
         | 
| 100 | 
            +
            }
         | 
| 97 101 |  | 
| 98 102 | 
             
            context(branch('master')) {
         | 
| 99 103 | 
             
              before_command('tag_up') {
         | 
| @@ -103,12 +107,9 @@ context(branch('master')) { | |
| 103 107 |  | 
| 104 108 | 
             
              on('before_tag_creation') {
         | 
| 105 109 |  | 
| 106 | 
            -
                version_changes =  | 
| 107 | 
            -
                bitbucket_changes = sh(
         | 
| 110 | 
            +
                version_changes = sh(
         | 
| 108 111 | 
             
                  %q#git log --oneline --decorate  | grep -B 100 -m 1 "tag:" | grep "pull request" | awk '{print $1}' | xargs git show --format='%b' | grep -v Approved | grep -v "^$" | grep -E "^[[:space:]]*\[.*\]" | sed 's/^[[:space:]]*\(.*\)/ * \1/'#, output: false
         | 
| 109 112 | 
             
                ).output
         | 
| 110 | 
            -
                version_changes = bitbucket_changes
         | 
| 111 | 
            -
             | 
| 112 113 |  | 
| 113 114 | 
             
                puts "---------------------------"
         | 
| 114 115 | 
             
                version_changes = "## #{new_version} - #{Time.now.strftime('%d/%m/%Y')}\n#{version_changes}\n"
         | 
| @@ -170,8 +171,6 @@ context(!branch('master', 'staging')) { | |
| 170 171 |  | 
| 171 172 | 
             
              1. Complete README.md description
         | 
| 172 173 | 
             
              2. Add a configuration to enable, disable or specify the number of tags that a single commit can have(eg: only one release and one pre-release)
         | 
| 173 | 
            -
              3. Configure tag prefix (eg: 'v' to generate v0.1.0)
         | 
| 174 | 
            -
              4. Improve DSL Syntax Errors Messages(Ruby backtrace is printed currently)
         | 
| 175 174 | 
             
              5. Adds more specs and test coverage in CI
         | 
| 176 175 |  | 
| 177 176 | 
             
            ## Contributing
         | 
    
        data/Vertofile
    ADDED
    
    | @@ -0,0 +1,53 @@ | |
| 1 | 
            +
            verto_version '0.5.0'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            config {
         | 
| 4 | 
            +
             version.prefix = 'v' # Adds a version_prefix
         | 
| 5 | 
            +
            }
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            context(branch('master')) {
         | 
| 8 | 
            +
              before_command('tag_up') {
         | 
| 9 | 
            +
                git!('pull origin master')
         | 
| 10 | 
            +
                command_options.add(filter: 'release_only')
         | 
| 11 | 
            +
              }
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              on('before_tag_creation') {
         | 
| 14 | 
            +
                version_changes = ""
         | 
| 15 | 
            +
                 bitbucket_changes = sh(
         | 
| 16 | 
            +
                  %q#git log --oneline --decorate  | grep -B 100 -m 1 "tag:" | grep "pull request" | awk '{print $1}' | xargs git show --format='%b' | grep -v Approved | grep -v "^$" | grep -E "^[[:space:]]*\[.*\]" | sed 's/^[[:space:]]*\(.*\)/ * \1/'#, output: false
         | 
| 17 | 
            +
                 ).output
         | 
| 18 | 
            +
                 version_changes = bitbucket_changes
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                puts "---------------------------"
         | 
| 21 | 
            +
                version_changes = "## #{new_version} - #{Time.now.strftime('%d/%m/%Y')}\n#{version_changes}\n"
         | 
| 22 | 
            +
                exit unless confirm("Create new Realease?\n" \
         | 
| 23 | 
            +
                  "---------------------------\n" \
         | 
| 24 | 
            +
                  "#{version_changes}" \
         | 
| 25 | 
            +
                  "---------------------------\n"
         | 
| 26 | 
            +
                )
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                # CHANGELOG
         | 
| 29 | 
            +
                file('CHANGELOG.md').prepend(version_changes)
         | 
| 30 | 
            +
                git!('add CHANGELOG.md')
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                file('lib/verto/version.rb').replace(latest_version.to_s, new_version.to_s)
         | 
| 33 | 
            +
                git!('add lib/verto/version.rb')
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                file('README.md').replace_all(latest_version.to_s, new_version.to_s)
         | 
| 36 | 
            +
                git!('add README.md')
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                file('lib/verto/utils/templates/Vertofile').replace(latest_version.to_s, new_version.to_s)
         | 
| 39 | 
            +
                git!('add lib/verto/utils/templates/Vertofile')
         | 
| 40 | 
            +
             | 
| 41 | 
            +
                sh!('rake install')
         | 
| 42 | 
            +
                git!('add Gemfile.lock')
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                git!('commit -m "Bumps Version"')
         | 
| 45 | 
            +
              }
         | 
| 46 | 
            +
             | 
| 47 | 
            +
              after_command('tag_up') {
         | 
| 48 | 
            +
                git!('push --tags')
         | 
| 49 | 
            +
                git!('push origin master')
         | 
| 50 | 
            +
                sh!('rake release')
         | 
| 51 | 
            +
              }
         | 
| 52 | 
            +
            }
         | 
| 53 | 
            +
             | 
| @@ -8,6 +8,7 @@ module Verto | |
| 8 8 | 
             
                option :pre_release, type: :string
         | 
| 9 9 | 
             
                option :filter, type: :string
         | 
| 10 10 | 
             
                option :release, type: :boolean, default: false
         | 
| 11 | 
            +
                option :version_prefix, type: :string, default: nil
         | 
| 11 12 |  | 
| 12 13 | 
             
                def up
         | 
| 13 14 | 
             
                  call_hooks(%i[before before_tag_up], with_attributes: { command_options: options} )
         | 
| @@ -26,9 +27,9 @@ module Verto | |
| 26 27 |  | 
| 27 28 | 
             
                  call_hooks(:before_tag_creation, with_attributes: { new_version: new_version } )
         | 
| 28 29 |  | 
| 29 | 
            -
                  stderr.puts "Creating Tag #{new_version}..."
         | 
| 30 | 
            -
                  tag_repository.create!(new_version | 
| 31 | 
            -
                  stderr.puts "Tag #{new_version} Created!"
         | 
| 30 | 
            +
                  stderr.puts "Creating Tag #{version_prefix}#{new_version}..."
         | 
| 31 | 
            +
                  tag_repository.create!("#{version_prefix}#{new_version}")
         | 
| 32 | 
            +
                  stderr.puts "Tag #{version_prefix}#{new_version} Created!"
         | 
| 32 33 |  | 
| 33 34 | 
             
                  call_hooks(:after_tag_up, with_attributes: { new_version: new_version })
         | 
| 34 35 | 
             
                  call_hooks(:after)
         | 
| @@ -65,7 +66,7 @@ module Verto | |
| 65 66 | 
             
                  command_error!(
         | 
| 66 67 | 
             
                    <<~TEXT
         | 
| 67 68 | 
             
                      Project doesn't have a previous tag version, create a new tag with git.
         | 
| 68 | 
            -
                      eg: `git tag 0.1.0`
         | 
| 69 | 
            +
                      eg: `git tag #{version_prefix}0.1.0`
         | 
| 69 70 | 
             
                    TEXT
         | 
| 70 71 | 
             
                  ) unless latest_tag
         | 
| 71 72 | 
             
                end
         | 
| @@ -99,5 +100,9 @@ module Verto | |
| 99 100 | 
             
                def load_filter
         | 
| 100 101 | 
             
                  TagFilter.for(options[:filter]) || Regexp.new(options[:filter].to_s)
         | 
| 101 102 | 
             
                end
         | 
| 103 | 
            +
             | 
| 104 | 
            +
                def version_prefix
         | 
| 105 | 
            +
                  options[:version_prefix] || Verto.config.version.prefix
         | 
| 106 | 
            +
                end
         | 
| 102 107 | 
             
              end
         | 
| 103 108 | 
             
            end
         | 
| @@ -1,20 +1,24 @@ | |
| 1 | 
            -
            verto_version '0. | 
| 1 | 
            +
            verto_version '0.6.0'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            config {
         | 
| 4 | 
            +
             # version.prefix = 'v' # Adds a version_prefix
         | 
| 5 | 
            +
             # pre_release.initial_number = 0 # Configures pre_release initial number, defaults to 1
         | 
| 6 | 
            +
             # project.path = "#{project_path}" # Configures a custom project path
         | 
| 7 | 
            +
            }
         | 
| 2 8 |  | 
| 3 9 | 
             
            context(branch('master')) {
         | 
| 4 10 | 
             
              before_command('tag_up') {
         | 
| 5 | 
            -
                git!('origin master')
         | 
| 11 | 
            +
                git!('pull origin master')
         | 
| 6 12 | 
             
                command_options.add(filter: 'release_only')
         | 
| 7 13 | 
             
              }
         | 
| 8 14 |  | 
| 9 15 | 
             
              on('before_tag_creation') {
         | 
| 10 16 |  | 
| 11 17 | 
             
                version_changes = ""
         | 
| 12 | 
            -
                # Uncomment to get  | 
| 13 | 
            -
                #  | 
| 18 | 
            +
                # Uncomment to get Merged PRs Titles as changes to add in CHANGELOG.
         | 
| 19 | 
            +
                # version_changes = sh(
         | 
| 14 20 | 
             
                #  %q#git log --oneline --decorate  | grep -B 100 -m 1 "tag:" | grep "pull request" | awk '{print $1}' | xargs git show --format='%b' | grep -v Approved | grep -v "^$" | grep -E "^[[:space:]]*\[.*\]" | sed 's/^[[:space:]]*\(.*\)/ * \1/'#, output: false
         | 
| 15 21 | 
             
                # ).output
         | 
| 16 | 
            -
                # version_changes = bitbucket_changes
         | 
| 17 | 
            -
             | 
| 18 22 |  | 
| 19 23 | 
             
                puts "---------------------------"
         | 
| 20 24 | 
             
                version_changes = "## #{new_version} - #{Time.now.strftime('%d/%m/%Y')}\n#{version_changes}\n"
         | 
    
        data/lib/verto/version.rb
    CHANGED
    
    
    
        data/lib/verto.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: verto
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.6.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Carlos Atkinson
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020-04- | 
| 11 | 
            +
            date: 2020-04-15 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: thor
         | 
| @@ -162,12 +162,14 @@ files: | |
| 162 162 | 
             
            - ".rspec"
         | 
| 163 163 | 
             
            - ".ruby-version"
         | 
| 164 164 | 
             
            - ".travis.yml"
         | 
| 165 | 
            +
            - CHANGELOG.md
         | 
| 165 166 | 
             
            - Dockerfile
         | 
| 166 167 | 
             
            - Gemfile
         | 
| 167 168 | 
             
            - Gemfile.lock
         | 
| 168 169 | 
             
            - LICENSE.txt
         | 
| 169 170 | 
             
            - README.md
         | 
| 170 171 | 
             
            - Rakefile
         | 
| 172 | 
            +
            - Vertofile
         | 
| 171 173 | 
             
            - bin/console
         | 
| 172 174 | 
             
            - bin/setup
         | 
| 173 175 | 
             
            - docker-entrypoint.sh
         |