verto 0.6.1 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +51 -0
- data/.rubocop.yml +23 -0
- data/.rubocop_todo.yml +50 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +17 -0
- data/Gemfile +3 -1
- data/Gemfile.lock +34 -11
- data/README.md +42 -47
- data/Rakefile +7 -5
- data/Vertofile +10 -30
- data/bin/console +4 -3
- data/djin.yml +37 -0
- data/exe/verto +6 -4
- data/lib/verto.rb +63 -22
- data/lib/verto/commands/base_command.rb +7 -2
- data/lib/verto/commands/main_command.rb +10 -6
- data/lib/verto/commands/tag_command.rb +44 -23
- data/lib/verto/dsl.rb +2 -0
- data/lib/verto/dsl/built_in_hooks.rb +24 -0
- data/lib/verto/dsl/file.rb +4 -2
- data/lib/verto/dsl/hook.rb +2 -0
- data/lib/verto/dsl/interpreter.rb +8 -7
- data/lib/verto/dsl/syntax.rb +44 -11
- data/lib/verto/dsl/update_changelog.rb +60 -0
- data/lib/verto/repositories/tag_repository.rb +2 -0
- data/lib/verto/utils/cli_helpers.rb +15 -0
- data/lib/verto/utils/command_options.rb +4 -2
- data/lib/verto/utils/semantic_version.rb +2 -0
- data/lib/verto/utils/strict_hash.rb +9 -0
- data/lib/verto/utils/system_command_executor.rb +4 -2
- data/lib/verto/utils/tag_filter.rb +5 -3
- data/lib/verto/utils/template.rb +2 -0
- data/lib/verto/utils/templates/Vertofile +31 -33
- data/lib/verto/version.rb +3 -1
- data/verto.gemspec +29 -25
- metadata +61 -23
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9185dc3395380b1defa2ec58cc79067e4f94c3fb612067eb7b2f57c422599f85
|
4
|
+
data.tar.gz: e2f144854a7acce5c07f32faa407ec11b45f855b0bfa4ceb4fbafb8329a86a4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45f95bbbc09c4b64c65071fa24aa1641c0b3180ce06aee785f23a4e02bde95f6c77291e7c00974faba90d861dd107cf95149643af24d99da32c022f5c5050e1c
|
7
|
+
data.tar.gz: abe98354760214070d5a3b7422b1f6a1706bae93d4812f1e5913bbfa7901f3d45bf5e8aaed0d21fbe58d6e858d8ec5b4d8e06133d463bfe0cb72c4a9938dbbdc
|
@@ -0,0 +1,51 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-16.04
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: ['2.5', '2.6', '2.7']
|
11
|
+
name: Ruby ${{ matrix.ruby }}
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- uses: actions/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
17
|
+
|
18
|
+
- name: Setup Code Climate test-reporter
|
19
|
+
run: |
|
20
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
21
|
+
chmod +x ./cc-test-reporter
|
22
|
+
./cc-test-reporter before-build
|
23
|
+
|
24
|
+
- name: Install Gems
|
25
|
+
run: |
|
26
|
+
gem install bundler
|
27
|
+
bundle install --jobs 4 --retry 3
|
28
|
+
|
29
|
+
- name: Run tests
|
30
|
+
run: |
|
31
|
+
git config --global user.email "github_actions@test.com"
|
32
|
+
git config --global user.name "Github Actions Test"
|
33
|
+
bundle exec rake
|
34
|
+
|
35
|
+
- name: Publish code coverage
|
36
|
+
run: |
|
37
|
+
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
|
38
|
+
./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}}
|
39
|
+
|
40
|
+
lint:
|
41
|
+
runs-on: ubuntu-16.04
|
42
|
+
name: Lint
|
43
|
+
steps:
|
44
|
+
- uses: actions/checkout@v2
|
45
|
+
- uses: actions/setup-ruby@v1
|
46
|
+
with:
|
47
|
+
ruby-version: '2.5'
|
48
|
+
- run: |
|
49
|
+
gem install bundler
|
50
|
+
bundle install --jobs 4 --retry 3
|
51
|
+
bundle exec rubocop
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# TODO: Remove and use pronto
|
2
|
+
inherit_from: .rubocop_todo.yml
|
3
|
+
|
4
|
+
# The behavior of RuboCop can be controlled via the .rubocop.yml
|
5
|
+
# configuration file. It makes it possible to enable/disable
|
6
|
+
# certain cops (checks) and to alter their behavior if they accept
|
7
|
+
# any parameters. The file can be placed either in your home
|
8
|
+
# directory or in some project directory.
|
9
|
+
#
|
10
|
+
# RuboCop will start looking for the configuration file in the directory
|
11
|
+
# where the inspected file is and continue its way up to the root directory.
|
12
|
+
#
|
13
|
+
# See https://docs.rubocop.org/rubocop/configuration
|
14
|
+
AllCops:
|
15
|
+
TargetRubyVersion: 2.5
|
16
|
+
|
17
|
+
Metrics/BlockLength:
|
18
|
+
Exclude:
|
19
|
+
- 'spec/**/*.rb'
|
20
|
+
- verto.gemspec
|
21
|
+
|
22
|
+
Style/Documentation:
|
23
|
+
Enabled: false
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 2000`
|
3
|
+
# on 2020-10-16 18:48:37 UTC using RuboCop version 0.93.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 4
|
10
|
+
# Configuration parameters: IgnoredMethods, Max.
|
11
|
+
Metrics/AbcSize:
|
12
|
+
Exclude:
|
13
|
+
- 'lib/verto.rb'
|
14
|
+
- 'lib/verto/commands/tag_command.rb'
|
15
|
+
- 'lib/verto/utils/system_command_executor.rb'
|
16
|
+
|
17
|
+
# Offense count: 1
|
18
|
+
# Configuration parameters: IgnoredMethods, Max.
|
19
|
+
Metrics/CyclomaticComplexity:
|
20
|
+
Exclude:
|
21
|
+
- 'lib/verto/commands/tag_command.rb'
|
22
|
+
|
23
|
+
# Offense count: 4
|
24
|
+
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods.
|
25
|
+
Metrics/MethodLength:
|
26
|
+
Exclude:
|
27
|
+
- 'lib/verto.rb'
|
28
|
+
- 'lib/verto/commands/tag_command.rb'
|
29
|
+
|
30
|
+
# Offense count: 1
|
31
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
32
|
+
Metrics/ModuleLength:
|
33
|
+
Exclude:
|
34
|
+
- 'lib/verto/dsl/syntax.rb'
|
35
|
+
|
36
|
+
# Offense count: 1
|
37
|
+
# Configuration parameters: IgnoredMethods, Max.
|
38
|
+
Metrics/PerceivedComplexity:
|
39
|
+
Exclude:
|
40
|
+
- 'lib/verto/commands/tag_command.rb'
|
41
|
+
|
42
|
+
# Offense count: 5
|
43
|
+
# Cop supports --auto-correct.
|
44
|
+
# Configuration parameters: AutoCorrect, Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
45
|
+
# URISchemes: http, https
|
46
|
+
Layout/LineLength:
|
47
|
+
Exclude:
|
48
|
+
- 'lib/verto/dsl/syntax.rb'
|
49
|
+
- 'lib/verto/dsl/update_changelog.rb'
|
50
|
+
- 'lib/verto/repositories/tag_repository.rb'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
## 0.10.1 - 14/01/2021
|
2
|
+
* [FIX] UpdateChangelog Versions
|
3
|
+
* [TECH] Adds Rubocop
|
4
|
+
* [TECH] Github Actions CI
|
5
|
+
|
6
|
+
## 0.10.0 - 14/10/2020
|
7
|
+
* [FEATURE] Adds update_changelog in DSL
|
8
|
+
|
9
|
+
## 0.9.0 - 08/08/2020
|
10
|
+
* [FEATURE] Custom Default Pre-Release Identifier
|
11
|
+
|
12
|
+
## 0.8.0 - 05/05/2020
|
13
|
+
* [PATCH] Handles Ctrl-C / SIGINT in CLI
|
14
|
+
|
15
|
+
## 0.7.0 - 29/04/2020
|
16
|
+
* [FEATURE Built In Git Hooks]
|
17
|
+
|
1
18
|
## 0.6.1 - 15/04/2020
|
2
19
|
* [FIX] Fix Vertofile to add Gemfile.lock before release
|
3
20
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,41 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
verto (0.
|
4
|
+
verto (0.10.1)
|
5
5
|
dry-auto_inject (~> 0.7)
|
6
6
|
dry-configurable (~> 0.8)
|
7
7
|
dry-container (~> 0.7)
|
8
|
+
mustache (~> 1.1.1)
|
8
9
|
thor (~> 1.0.1)
|
9
10
|
vseries (~> 0.2)
|
10
11
|
|
11
12
|
GEM
|
12
13
|
remote: https://rubygems.org/
|
13
14
|
specs:
|
15
|
+
ast (2.4.1)
|
14
16
|
byebug (11.1.1)
|
15
|
-
concurrent-ruby (1.1.
|
17
|
+
concurrent-ruby (1.1.7)
|
16
18
|
diff-lcs (1.3)
|
17
19
|
docile (1.3.2)
|
18
20
|
dry-auto_inject (0.7.0)
|
19
21
|
dry-container (>= 0.3.4)
|
20
|
-
dry-configurable (0.
|
22
|
+
dry-configurable (0.12.0)
|
21
23
|
concurrent-ruby (~> 1.0)
|
22
|
-
dry-core (~> 0.
|
23
|
-
dry-equalizer (~> 0.2)
|
24
|
+
dry-core (~> 0.5, >= 0.5.0)
|
24
25
|
dry-container (0.7.2)
|
25
26
|
concurrent-ruby (~> 1.0)
|
26
27
|
dry-configurable (~> 0.1, >= 0.1.3)
|
27
|
-
dry-core (0.
|
28
|
+
dry-core (0.5.0)
|
28
29
|
concurrent-ruby (~> 1.0)
|
29
|
-
|
30
|
+
json (2.3.1)
|
31
|
+
mustache (1.1.1)
|
32
|
+
parallel (1.19.2)
|
33
|
+
parser (2.7.2.0)
|
34
|
+
ast (~> 2.4.1)
|
35
|
+
rainbow (3.0.0)
|
30
36
|
rake (13.0.1)
|
37
|
+
regexp_parser (1.8.2)
|
38
|
+
rexml (3.2.4)
|
31
39
|
rspec (3.9.0)
|
32
40
|
rspec-core (~> 3.9.0)
|
33
41
|
rspec-expectations (~> 3.9.0)
|
@@ -41,11 +49,25 @@ GEM
|
|
41
49
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
50
|
rspec-support (~> 3.9.0)
|
43
51
|
rspec-support (3.9.2)
|
44
|
-
|
52
|
+
rubocop (0.93.1)
|
53
|
+
parallel (~> 1.10)
|
54
|
+
parser (>= 2.7.1.5)
|
55
|
+
rainbow (>= 2.2.2, < 4.0)
|
56
|
+
regexp_parser (>= 1.8)
|
57
|
+
rexml
|
58
|
+
rubocop-ast (>= 0.6.0)
|
59
|
+
ruby-progressbar (~> 1.7)
|
60
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
61
|
+
rubocop-ast (0.8.0)
|
62
|
+
parser (>= 2.7.1.5)
|
63
|
+
ruby-progressbar (1.10.1)
|
64
|
+
simplecov (0.17.1)
|
45
65
|
docile (~> 1.1)
|
46
|
-
|
47
|
-
|
66
|
+
json (>= 1.8, < 3)
|
67
|
+
simplecov-html (~> 0.10.0)
|
68
|
+
simplecov-html (0.10.2)
|
48
69
|
thor (1.0.1)
|
70
|
+
unicode-display_width (1.7.0)
|
49
71
|
vseries (0.2.0)
|
50
72
|
|
51
73
|
PLATFORMS
|
@@ -56,7 +78,8 @@ DEPENDENCIES
|
|
56
78
|
byebug
|
57
79
|
rake (~> 13.0)
|
58
80
|
rspec (~> 3.0)
|
59
|
-
|
81
|
+
rubocop
|
82
|
+
simplecov (~> 0.17.0)
|
60
83
|
verto!
|
61
84
|
|
62
85
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Verto
|
2
|
-
|
2
|
+
![Build](https://github.com/catks/verto/workflows/Ruby/badge.svg)
|
3
3
|
[![Maintainability](https://api.codeclimate.com/v1/badges/b699d13df33e33bbe2d0/maintainability)](https://codeclimate.com/github/catks/verto/maintainability)
|
4
4
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/39e7c6f1f5f57b8555ed/test_coverage)](https://codeclimate.com/github/catks/verto/test_coverage)\
|
5
5
|
Verto is a CLI to generate git tags (following the [Semantic Versioning](https://semver.org/) system)
|
@@ -32,28 +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 --rm -v $(pwd):/usr/src/project -it catks/verto:0.10.1'
|
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 --rm -v ~/.gitconfig:/etc/gitconfig -v $(pwd):/usr/src/project -v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts -it catks/verto:0.10.1'
|
42
42
|
|
43
43
|
```
|
44
44
|
|
45
|
-
You can also use your ssh keys with verto container (for git push):
|
45
|
+
You can also use your ssh keys, know_hosts and git config 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.
|
49
|
-
|
50
|
-
```
|
51
|
-
|
52
|
-
Or share the git config, known_hosts and ssh_keys:
|
53
|
-
|
54
|
-
|
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.6.1'
|
48
|
+
alias verto='docker run --rm -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.10.1'
|
57
49
|
|
58
50
|
```
|
59
51
|
|
@@ -93,72 +85,75 @@ You can create a new Vertofile with `verto init` or following the next example:
|
|
93
85
|
```ruby
|
94
86
|
# Vertofile
|
95
87
|
|
96
|
-
verto_version '0.
|
88
|
+
verto_version '0.10.1'
|
97
89
|
|
98
90
|
config {
|
99
91
|
# version.prefix = 'v' # Adds a version_prefix
|
92
|
+
# pre_release.default_identifier = 'alpha' } # Defaults to 'rc'
|
93
|
+
git.pull_before_tag_creation = true # Pull Changes before tag creation
|
94
|
+
git.push_after_tag_creation = true # Push changes after tag creation
|
95
|
+
|
96
|
+
## CHANGELOG FORMAT
|
97
|
+
## Verto uses Mustache template rendering to render changelog updates, the default value is:
|
98
|
+
##
|
99
|
+
## ## {{new_version}} - #{Time.now.strftime('%d/%m/%Y')}
|
100
|
+
## {{#version_changes}}
|
101
|
+
## * {{.}}
|
102
|
+
## {{/version_changes}}
|
103
|
+
##
|
104
|
+
## A custom format can be specified, eg:
|
105
|
+
# changelog.format = <<~CHANGELOG
|
106
|
+
# ## {{new_version}}
|
107
|
+
# {{#version_changes}}
|
108
|
+
# * {{.}}
|
109
|
+
# {{/version_changes}}
|
110
|
+
# CHANGELOG
|
100
111
|
}
|
101
112
|
|
102
113
|
context(branch('master')) {
|
103
|
-
|
104
|
-
git!('origin master')
|
114
|
+
before_command_tag_up {
|
105
115
|
command_options.add(filter: 'release_only')
|
106
116
|
}
|
107
117
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
puts "---------------------------"
|
115
|
-
version_changes = "## #{new_version} - #{Time.now.strftime('%d/%m/%Y')}\n#{version_changes}\n"
|
116
|
-
exit unless confirm("Create new Realease?\n" \
|
117
|
-
"---------------------------\n" \
|
118
|
-
"#{version_changes}" \
|
119
|
-
"---------------------------\n"
|
118
|
+
before_tag_creation {
|
119
|
+
update_changelog(
|
120
|
+
with: :merged_pull_requests_with_bracketed_labels, # Optional, defines the strategy to retrive the changes, default: :merged_pull_requests_with_bracketed_labels
|
121
|
+
confirmation: true, # Optional, asks for confirmation before updating the changelog, default: true
|
122
|
+
filename: 'CHANGELOG.md' # Optional, defines the filename of the CHANGELOG file, default: 'CHANGELOG.md'
|
120
123
|
)
|
121
|
-
|
122
|
-
# CHANGELOG
|
123
|
-
file('CHANGELOG.md').prepend(version_changes)
|
124
124
|
git('add CHANGELOG.md')
|
125
125
|
|
126
126
|
# Uncomment to update the version in other files, like package.json
|
127
127
|
# file('package.json').replace(/"(\d+)\.(\d+)\.(\d+)(-?.*)"/, %Q{"#{new_version}"})
|
128
128
|
# git('add package.json')
|
129
129
|
|
130
|
-
git('commit -m "Updates CHANGELOG"')
|
130
|
+
git!('commit -m "Updates CHANGELOG"')
|
131
131
|
}
|
132
132
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
133
|
+
# After Hooks
|
134
|
+
# after_command_tag_up {
|
135
|
+
# git('push --tags')
|
136
|
+
# git('push origin master')
|
137
|
+
# }
|
137
138
|
}
|
138
139
|
|
139
140
|
context(branch('staging')) {
|
140
|
-
|
141
|
+
before_command_tag_up {
|
141
142
|
git!('pull origin staging')
|
142
143
|
command_options.add(pre_release: 'rc')
|
143
144
|
}
|
144
145
|
|
145
|
-
|
146
|
+
before_tag_creation {
|
146
147
|
# file('package.json').replace(/"(\d+)\.(\d+)\.(\d+)(-?.*)"/, %Q{"#{new_version}"})
|
147
148
|
# git('add package.json')
|
148
149
|
|
149
|
-
git('commit -m "Release
|
150
|
-
git('commit --allow-empty -m "Staging Release"')
|
151
|
-
}
|
152
|
-
|
153
|
-
after_command('tag_up') {
|
154
|
-
git('push --tags')
|
155
|
-
git('push origin staging')
|
150
|
+
git!('commit --allow-empty -m "Staging Release"')
|
156
151
|
}
|
157
152
|
}
|
158
153
|
|
159
154
|
# Block tag creation in other branchs
|
160
155
|
context(!branch('master', 'staging')) {
|
161
|
-
error "Tags only
|
156
|
+
error "Tags can only be created in master or staging branch"
|
162
157
|
exit
|
163
158
|
}
|
164
159
|
```
|
@@ -171,7 +166,7 @@ context(!branch('master', 'staging')) {
|
|
171
166
|
|
172
167
|
1. Complete README.md description
|
173
168
|
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)
|
174
|
-
|
169
|
+
3. Adds more specs and test coverage in CI
|
175
170
|
|
176
171
|
## Contributing
|
177
172
|
|
data/Rakefile
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require_relative 'lib/verto'
|
6
|
+
require_relative 'spec/helpers/test_repo.rb'
|
5
7
|
|
6
8
|
RSpec::Core::RakeTask.new(:spec)
|
7
9
|
|
8
|
-
task :
|
10
|
+
task default: :spec
|
9
11
|
|
10
12
|
desc 'Verto REPL'
|
11
13
|
task :console do
|
data/Vertofile
CHANGED
@@ -1,32 +1,18 @@
|
|
1
|
-
verto_version '0.
|
1
|
+
verto_version '0.10.1'
|
2
2
|
|
3
3
|
config {
|
4
|
-
|
4
|
+
version.prefix = 'v' # Adds a version_prefix
|
5
|
+
git.pull_before_tag_creation = true
|
6
|
+
git.push_after_tag_creation = true
|
5
7
|
}
|
6
8
|
|
7
9
|
context(branch('master')) {
|
8
|
-
|
9
|
-
git!('pull origin master')
|
10
|
+
before_command_tag_up {
|
10
11
|
command_options.add(filter: 'release_only')
|
11
12
|
}
|
12
13
|
|
13
|
-
|
14
|
-
|
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)
|
14
|
+
before_tag_creation {
|
15
|
+
update_changelog
|
30
16
|
git!('add CHANGELOG.md')
|
31
17
|
|
32
18
|
file('lib/verto/version.rb').replace(latest_version.to_s, new_version.to_s)
|
@@ -36,7 +22,9 @@ context(branch('master')) {
|
|
36
22
|
git!('add README.md')
|
37
23
|
|
38
24
|
file('lib/verto/utils/templates/Vertofile').replace(latest_version.to_s, new_version.to_s)
|
39
|
-
|
25
|
+
file('Vertofile').replace(latest_version.to_s, new_version.to_s)
|
26
|
+
|
27
|
+
git!('add Vertofile lib/verto/utils/templates/Vertofile')
|
40
28
|
|
41
29
|
sh!('bundle install')
|
42
30
|
sh!('rake install')
|
@@ -44,12 +32,4 @@ context(branch('master')) {
|
|
44
32
|
|
45
33
|
git!('commit -m "Bumps Version"')
|
46
34
|
}
|
47
|
-
|
48
|
-
after_command('tag_up') {
|
49
|
-
exit
|
50
|
-
git!('push --tags')
|
51
|
-
git!('push origin master')
|
52
|
-
sh!('rake release')
|
53
|
-
}
|
54
35
|
}
|
55
|
-
|