verto 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 373195fc35ee48db23ce27dd6bc67105cb510761f7ea6eebe66a5f701bc86283
4
- data.tar.gz: 296d975bf93678478a0b182265ec4c5d6f816d24b32520fcd9f1aadbf3f6999b
3
+ metadata.gz: 768852b8be876572bb72068a3865eaeee672d20baa976923758c9634b901a52d
4
+ data.tar.gz: 98339f920377dd25299a8240d5e10da2f5161fd749f5753d593d1878de4e6e9c
5
5
  SHA512:
6
- metadata.gz: bc6dad7a9b95e58284c7f59ed6bfeccb27339fdf8f6125117cde49ad7cfa951d5927b2578f47cb0b83c3c719e52b6be046fe6b77e43aa07e3877d297b0496b26
7
- data.tar.gz: 65d0d53a12a166ce5c890c2f1349a21ff43726f3158df7df402d3c6170d9f70bc1a26375194302c35d512474c5bbcf4ef172b74cc5ef92b82a41ab025255cb14
6
+ metadata.gz: 8532433e33edc4061b286d8ab409c70d668d231eed44a20b245243f94de4cdf794754c39b588212c71a10ec8522aa02f5b76ee21b6f636f2e283c2219989da66
7
+ data.tar.gz: c04e86927b7edcece876e739fc149743e99f972d86bbab755f86b0c006abf90caa255be1f35bdd6366e0e0387b6c9dbe80d97475394c7263c979cd86d89492d8
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 0.6.0 - 14/04/2020
2
+ * [FEATURE] Adds Version Prefix
3
+
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.4.1'
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.4.1'
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.4.1'
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.4.1'
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.4.1'
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
+
@@ -14,7 +14,7 @@ module Verto
14
14
  Template.render('Vertofile', to: path)
15
15
  end
16
16
 
17
- desc "version", "Show Verto version"
17
+ desc "version", "Shows Verto version"
18
18
 
19
19
  def version
20
20
  Verto.stdout.puts Verto::VERSION
@@ -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.to_s)
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.4.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 Bitbucket Merged PRs Titles as changes to add in CHANGELOG.
13
- # bitbucket_changes = sh(
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
@@ -1,3 +1,3 @@
1
1
  module Verto
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
data/lib/verto.rb CHANGED
@@ -24,6 +24,10 @@ module Verto
24
24
  setting :stderr_to, nil
25
25
  end
26
26
 
27
+ setting :version do
28
+ setting :prefix, ''
29
+ end
30
+
27
31
  setting :hooks, []
28
32
  setting :command_options, CommandOptions.new
29
33
 
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.5.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-09 00:00:00.000000000 Z
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