vtasks 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -2
- data/lib/vtasks/release.rb +1 -1
- data/lib/vtasks/utils/docker_shared_context.rb +91 -91
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aec1551cdcfe34c75b9dff6d5704a4095c386217ec81afa95c659e5c90ee9ba8
|
4
|
+
data.tar.gz: 53bed2c1f8d3961dda19b7f5ce826e6608baafce780f2abdfcd9310ba5e055e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cddbf52b1a251fda31bef19f92a5f6051556d44a1d57699167d2c445e8ea84452b541fcdd23187259c533a83a764f00cbe583e764c4e88d45195ccea9306a2bc
|
7
|
+
data.tar.gz: 8c31dcaecdc16c351cb12028eb9c90d66f76093be60d1da168f3afa8842da2f3d19b1f91cce5f4cf43896306d9548bf5135e607d14aee2e5ce788c8bb35c3555
|
data/README.md
CHANGED
@@ -156,13 +156,19 @@ Vtasks::Release.new
|
|
156
156
|
require 'vtasks/release'
|
157
157
|
Vtasks::Release.new(
|
158
158
|
write_changelog: true,
|
159
|
-
|
159
|
+
require_pull_request: true
|
160
|
+
wait_for_ci_success: true,
|
161
|
+
bug_labels: 'Type: Bug',
|
162
|
+
enhancement_labels: 'Type: Enhancement'
|
160
163
|
)
|
161
164
|
```
|
162
165
|
|
163
166
|
Parameters:
|
164
167
|
- `write_changelog`: [Boolean] whether to write the changelog (defaults to `false`)
|
165
|
-
- `
|
168
|
+
- `require_pull_request`: [Boolean] in case the branch is protected and a pull request is required, the task will create a separate branch on which it will commit the changelog, and merge that into master (defaults to `false`). .
|
169
|
+
- `wait_for_ci_success`: [Boolean] whether a "SUCCESS" CI status is required (defaults to `false`)
|
170
|
+
- `bug_labels`: [STRING] Issues with the specified labels will be added to "Fixed bugs" section (defaults to `bug`)
|
171
|
+
- `enhancement_labels`: [STRING] Issues with the specified labels will be added to "Implemented enhancements" section (defaults to `enhancement`)
|
166
172
|
|
167
173
|
Note:
|
168
174
|
First time you have to create an annotated tag and commit the initial CHANGELOG, before creating issues or pull requests (if there these are not present it will fail)
|
data/lib/vtasks/release.rb
CHANGED
@@ -66,7 +66,6 @@ module Vtasks
|
|
66
66
|
git_clean_repo
|
67
67
|
|
68
68
|
# Write changelog
|
69
|
-
# Create a separate release branch (works with protected branches as well)
|
70
69
|
if write_changelog == true
|
71
70
|
info 'Generate new changelog'
|
72
71
|
::GitHubChangelogGenerator::RakeTask.new(:latest_release) do |config|
|
@@ -77,6 +76,7 @@ module Vtasks
|
|
77
76
|
if system 'git diff --quiet HEAD'
|
78
77
|
info 'CHANGELOG has not changed. Skipping...'
|
79
78
|
else
|
79
|
+
# Create a separate release branch (works with protected branches as well)
|
80
80
|
if require_pull_request == true
|
81
81
|
info 'Create a new release branch'
|
82
82
|
sh "git checkout -b #{release_branch}"
|
@@ -1,91 +1,91 @@
|
|
1
|
-
module Vtasks
|
2
|
-
module Utils
|
3
|
-
# DockerSharedContext module
|
4
|
-
module DockerSharedContext
|
5
|
-
require 'rspec/core'
|
6
|
-
|
7
|
-
begin
|
8
|
-
require 'serverspec'
|
9
|
-
require 'docker'
|
10
|
-
rescue LoadError
|
11
|
-
nil # Might be in a group that is not installed
|
12
|
-
end
|
13
|
-
|
14
|
-
# Docker image context
|
15
|
-
module Image
|
16
|
-
extend ::RSpec::Core::SharedContext
|
17
|
-
|
18
|
-
before(:all) do
|
19
|
-
@image = ::Docker::Image.build_from_dir(DOCKER_IMAGE_DIRECTORY)
|
20
|
-
set :backend, :docker
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# Clean-up
|
25
|
-
module CleanUp
|
26
|
-
extend ::RSpec::Core::SharedContext
|
27
|
-
|
28
|
-
after(:all) do
|
29
|
-
@container.kill
|
30
|
-
@container.delete(force: true)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
# Docker container context
|
35
|
-
module Container
|
36
|
-
extend ::RSpec::Core::SharedContext
|
37
|
-
|
38
|
-
include Image
|
39
|
-
|
40
|
-
before(:all) do
|
41
|
-
@container = ::Docker::Container.create('Image' => @image.id)
|
42
|
-
@container.start
|
43
|
-
|
44
|
-
set :docker_container, @container.id
|
45
|
-
end
|
46
|
-
|
47
|
-
include CleanUp
|
48
|
-
end
|
49
|
-
|
50
|
-
# Docker always running container
|
51
|
-
# Overwrite the entrypoint so that we can run the tests
|
52
|
-
module RunningEntrypointContainer
|
53
|
-
extend ::RSpec::Core::SharedContext
|
54
|
-
|
55
|
-
include Image
|
56
|
-
|
57
|
-
before(:all) do
|
58
|
-
@container = ::Docker::Container.create(
|
59
|
-
'Image' => @image.id,
|
60
|
-
'Entrypoint' => ['sh', '-c', 'while true; do sleep 1; done']
|
61
|
-
)
|
62
|
-
@container.start
|
63
|
-
|
64
|
-
set :docker_container, @container.id
|
65
|
-
end
|
66
|
-
|
67
|
-
include CleanUp
|
68
|
-
end
|
69
|
-
|
70
|
-
# Docker always running container
|
71
|
-
# Overwrite the command so that we can run the tests
|
72
|
-
module RunningCommandContainer
|
73
|
-
extend ::RSpec::Core::SharedContext
|
74
|
-
|
75
|
-
include Image
|
76
|
-
|
77
|
-
before(:all) do
|
78
|
-
@container = ::Docker::Container.create(
|
79
|
-
'Image' => @image.id,
|
80
|
-
'Cmd' => ['sh', '-c', 'while true; do sleep 1; done']
|
81
|
-
)
|
82
|
-
@container.start
|
83
|
-
|
84
|
-
set :docker_container, @container.id
|
85
|
-
end
|
86
|
-
|
87
|
-
include CleanUp
|
88
|
-
end
|
89
|
-
end # module DockerSharedContext
|
90
|
-
end # module Utils
|
91
|
-
end # module Vtasks
|
1
|
+
module Vtasks
|
2
|
+
module Utils
|
3
|
+
# DockerSharedContext module
|
4
|
+
module DockerSharedContext
|
5
|
+
require 'rspec/core'
|
6
|
+
|
7
|
+
begin
|
8
|
+
require 'serverspec'
|
9
|
+
require 'docker'
|
10
|
+
rescue LoadError
|
11
|
+
nil # Might be in a group that is not installed
|
12
|
+
end
|
13
|
+
|
14
|
+
# Docker image context
|
15
|
+
module Image
|
16
|
+
extend ::RSpec::Core::SharedContext
|
17
|
+
|
18
|
+
before(:all) do
|
19
|
+
@image = ::Docker::Image.build_from_dir(DOCKER_IMAGE_DIRECTORY)
|
20
|
+
set :backend, :docker
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Clean-up
|
25
|
+
module CleanUp
|
26
|
+
extend ::RSpec::Core::SharedContext
|
27
|
+
|
28
|
+
after(:all) do
|
29
|
+
@container.kill
|
30
|
+
@container.delete(force: true)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Docker container context
|
35
|
+
module Container
|
36
|
+
extend ::RSpec::Core::SharedContext
|
37
|
+
|
38
|
+
include Image
|
39
|
+
|
40
|
+
before(:all) do
|
41
|
+
@container = ::Docker::Container.create('Image' => @image.id)
|
42
|
+
@container.start
|
43
|
+
|
44
|
+
set :docker_container, @container.id
|
45
|
+
end
|
46
|
+
|
47
|
+
include CleanUp
|
48
|
+
end
|
49
|
+
|
50
|
+
# Docker always running container
|
51
|
+
# Overwrite the entrypoint so that we can run the tests
|
52
|
+
module RunningEntrypointContainer
|
53
|
+
extend ::RSpec::Core::SharedContext
|
54
|
+
|
55
|
+
include Image
|
56
|
+
|
57
|
+
before(:all) do
|
58
|
+
@container = ::Docker::Container.create(
|
59
|
+
'Image' => @image.id,
|
60
|
+
'Entrypoint' => ['sh', '-c', 'while true; do sleep 1; done']
|
61
|
+
)
|
62
|
+
@container.start
|
63
|
+
|
64
|
+
set :docker_container, @container.id
|
65
|
+
end
|
66
|
+
|
67
|
+
include CleanUp
|
68
|
+
end
|
69
|
+
|
70
|
+
# Docker always running container
|
71
|
+
# Overwrite the command so that we can run the tests
|
72
|
+
module RunningCommandContainer
|
73
|
+
extend ::RSpec::Core::SharedContext
|
74
|
+
|
75
|
+
include Image
|
76
|
+
|
77
|
+
before(:all) do
|
78
|
+
@container = ::Docker::Container.create(
|
79
|
+
'Image' => @image.id,
|
80
|
+
'Cmd' => ['sh', '-c', 'while true; do sleep 1; done']
|
81
|
+
)
|
82
|
+
@container.start
|
83
|
+
|
84
|
+
set :docker_container, @container.id
|
85
|
+
end
|
86
|
+
|
87
|
+
include CleanUp
|
88
|
+
end
|
89
|
+
end # module DockerSharedContext
|
90
|
+
end # module Utils
|
91
|
+
end # module Vtasks
|