capistrano-redmine-deployment 1.0.0 → 1.0.1
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/.gitignore +0 -0
- data/Gemfile +0 -0
- data/{docs/LICENSE.md → LICENSE.txt} +0 -0
- data/README.md +22 -10
- data/Rakefile +0 -0
- data/capistrano-redmine-deployment.gemspec +0 -0
- data/docs/CHANGELOG.md +7 -0
- data/docs/CODE_OF_CONDUCT.md +0 -0
- data/lib/capistrano/redmine/deployment/client.rb +12 -7
- data/lib/capistrano/redmine/deployment/config.rb +7 -6
- data/lib/capistrano/redmine/deployment/gem_version.rb +1 -1
- data/lib/capistrano/redmine/deployment/railtie.rb +0 -0
- data/lib/capistrano/redmine/deployment/receipts.rb +0 -0
- data/lib/capistrano/redmine/deployment/tasks/setup.rake +50 -12
- data/lib/capistrano/redmine/deployment/version.rb +0 -0
- data/lib/capistrano-redmine-deployment.rb +0 -0
- metadata +4 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a1d4def15c15b92236d4cad5e63ab56a469b973763bcaeb0be17a59477efc5e
|
|
4
|
+
data.tar.gz: 91f5982de00664a05f986f714acd782464c60901d6af1ff051dd7691ecf61032
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af10737c30d398ab457265538ea359850403e53ec28771ba020cef4a07d178c712aeaafc0a4cbce4d760d9bf81d21938c8b5aa85ef1a95c6e8116aded924a950
|
|
7
|
+
data.tar.gz: 9d1282a7b24f607c94603b1604138e5d30a18173bbd468be524e39eb8af6c69bf10c47a36703d1868a047a85f9ebc51c65860b0ded0599c3b46f0655db26b1ac
|
data/.gitignore
CHANGED
|
File without changes
|
data/Gemfile
CHANGED
|
File without changes
|
|
File without changes
|
data/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Capistrano::Redmine::Deployment
|
|
2
2
|
|
|
3
|
-
[](http://github.com/ruby-smart/capistrano-redmine-deployment)
|
|
4
4
|
[](http://rubydoc.info/gems/capistrano-redmine-deployment)
|
|
5
5
|
|
|
6
6
|
[](https://badge.fury.io/rb/capistrano-redmine-deployment)
|
|
7
|
-
[](LICENSE.txt)
|
|
8
8
|
|
|
9
9
|
Redmine Deployment Tracking (for redmine_deployment plugin)
|
|
10
10
|
|
|
@@ -29,22 +29,34 @@ Or install it yourself as:
|
|
|
29
29
|
|
|
30
30
|
$ gem install capistrano-redmine-deployment
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
## Setup
|
|
33
|
+
|
|
34
|
+
Require deployment tasks within your `Capfile`
|
|
35
|
+
|
|
36
|
+
require 'capistrano/redmine/deployment/receipts'
|
|
37
|
+
|
|
38
|
+
-----
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
### Shared configuration
|
|
43
|
+
Configure shared redmine credentials within your `config/deploy.rb`.
|
|
33
44
|
```ruby
|
|
34
45
|
# redmine deployment credentials (without api_key)
|
|
35
46
|
set(:redmine_host, "https://your-redmine-host")
|
|
36
47
|
set(:redmine_project, "target-redmine-project-identifier")
|
|
37
48
|
set(:redmine_repository, "target-redmine-repository-identifier")
|
|
38
|
-
```
|
|
39
49
|
|
|
40
|
-
|
|
50
|
+
# in case of `SSL` issues that are caused by *CRL* (i.e. by LetsEncrypt certificates)
|
|
51
|
+
set(:redmine_host_verification, false)
|
|
52
|
+
```
|
|
41
53
|
|
|
42
|
-
|
|
54
|
+
### User-specific credentials
|
|
43
55
|
|
|
56
|
+
Setup redmine `API-KEY` through rake-task:
|
|
44
57
|
|
|
45
|
-
|
|
58
|
+
$ rake capistrano:redmine:deploy:setup
|
|
46
59
|
|
|
47
|
-
require 'capistrano/redmine/deployment/receipts'
|
|
48
60
|
|
|
49
61
|
## Redmine requirements
|
|
50
62
|
|
|
@@ -61,14 +73,14 @@ Install the plugin `redmine_deployment`.
|
|
|
61
73
|
|
|
62
74
|
## Contributing
|
|
63
75
|
|
|
64
|
-
Bug reports and pull requests are welcome on [GitHub](https://github.com/ruby-smart/
|
|
76
|
+
Bug reports and pull requests are welcome on [GitHub](https://github.com/ruby-smart/capistrano-redmine-deployment).
|
|
65
77
|
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](docs/CODE_OF_CONDUCT.md).
|
|
66
78
|
|
|
67
79
|
## License
|
|
68
80
|
|
|
69
81
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
70
82
|
|
|
71
|
-
A copy of the [LICENSE](
|
|
83
|
+
A copy of the [LICENSE](LICENSE.txt) can be found @ the docs.
|
|
72
84
|
|
|
73
85
|
## Code of Conduct
|
|
74
86
|
|
data/Rakefile
CHANGED
|
File without changes
|
|
File without changes
|
data/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Capistrano::Redmine::Deployment - CHANGELOG
|
|
2
2
|
|
|
3
|
+
## [1.0.1] - 2025-10-24
|
|
4
|
+
* **[add]** config for `host_verification` to skip issues with OpenSSL / CRL issues
|
|
5
|
+
* **[add]** warning message during deployment while host verification is disabled
|
|
6
|
+
* **[ref]** setup task for better configuration
|
|
7
|
+
* **[ref]** logging messages for successfully / error deployment
|
|
8
|
+
* **[fix]** host verification SSL/CRL issues
|
|
9
|
+
|
|
3
10
|
## [1.0.0] - 2024-10-01
|
|
4
11
|
* **[add]** config, client & receipts
|
|
5
12
|
* **[add]** rake task for setup
|
data/docs/CODE_OF_CONDUCT.md
CHANGED
|
File without changes
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require 'net/http'
|
|
4
4
|
require 'json'
|
|
5
|
+
require 'openssl'
|
|
5
6
|
|
|
6
7
|
module Capistrano
|
|
7
8
|
module Redmine
|
|
@@ -25,7 +26,7 @@ module Capistrano
|
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
def initialize(config, logging: true)
|
|
28
|
-
@config
|
|
29
|
+
@config = config
|
|
29
30
|
@logging = logging
|
|
30
31
|
end
|
|
31
32
|
|
|
@@ -56,15 +57,16 @@ module Capistrano
|
|
|
56
57
|
private
|
|
57
58
|
|
|
58
59
|
def send_deployment(deployment)
|
|
59
|
-
uri
|
|
60
|
+
uri = URI("#{config.host}/projects/#{config.project}/deploy/#{config.repository}.json")
|
|
60
61
|
|
|
61
62
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
62
63
|
http.use_ssl = true if uri.port == 443
|
|
64
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if config.host_verification == false
|
|
63
65
|
|
|
64
|
-
request
|
|
65
|
-
request["Content-Type"]
|
|
66
|
+
request = Net::HTTP::Post.new(uri.request_uri)
|
|
67
|
+
request["Content-Type"] = "application/json"
|
|
66
68
|
request['X-Redmine-API-Key'] = config.api_key
|
|
67
|
-
request.body
|
|
69
|
+
request.body = { deployment: deployment }.to_json
|
|
68
70
|
|
|
69
71
|
response = http.request(request)
|
|
70
72
|
|
|
@@ -77,16 +79,19 @@ module Capistrano
|
|
|
77
79
|
|
|
78
80
|
def log_deploy(deployment)
|
|
79
81
|
puts "Sending deployment information to #{config.host} (project: '#{config.project}' | repo: '#{config.repository}')"
|
|
80
|
-
|
|
82
|
+
puts "\e[33m WARNING: Host verification disabled!\e[0m" if config.host_verification == false
|
|
83
|
+
puts ""
|
|
81
84
|
puts " Commits......: #{deployment[:from_revision]} ... #{deployment[:to_revision]}"
|
|
82
85
|
puts " Environment..: #{deployment[:environment] || '-'}"
|
|
83
86
|
puts " Branch.......: #{deployment[:branch] || '-'}"
|
|
84
87
|
puts " Server(s)....: #{deployment[:servers]}"
|
|
85
88
|
puts " Result.......: #{deployment[:result]}"
|
|
89
|
+
puts ""
|
|
86
90
|
end
|
|
87
91
|
|
|
88
92
|
def log_deploy_done(response)
|
|
89
93
|
puts "\e[32mSuccessfully created deployment ##{response['deployment']['id']}\e[0m"
|
|
94
|
+
puts ""
|
|
90
95
|
end
|
|
91
96
|
|
|
92
97
|
def log_deploy_errors(response)
|
|
@@ -95,7 +100,7 @@ module Capistrano
|
|
|
95
100
|
else
|
|
96
101
|
puts "\e[31mFailed to created deployment: #{response.inspect}\e[0m"
|
|
97
102
|
end
|
|
98
|
-
|
|
103
|
+
puts ""
|
|
99
104
|
end
|
|
100
105
|
end
|
|
101
106
|
end
|
|
@@ -27,9 +27,10 @@ module Capistrano
|
|
|
27
27
|
|
|
28
28
|
def config_from_capistrano(capistrano)
|
|
29
29
|
config = {
|
|
30
|
-
host:
|
|
31
|
-
project:
|
|
32
|
-
repository: capistrano.fetch(:redmine_repository)
|
|
30
|
+
host: capistrano.fetch(:redmine_host),
|
|
31
|
+
project: capistrano.fetch(:redmine_project) || capistrano.fetch(:redmine_project_id),
|
|
32
|
+
repository: capistrano.fetch(:redmine_repository),
|
|
33
|
+
host_verification: capistrano.fetch(:redmine_host_verification)
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
new(config)
|
|
@@ -42,12 +43,12 @@ module Capistrano
|
|
|
42
43
|
|
|
43
44
|
def initialize(config = {}, file: nil)
|
|
44
45
|
@config = config
|
|
45
|
-
@file
|
|
46
|
+
@file = file
|
|
46
47
|
load
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
def set(key, value)
|
|
50
|
-
if value && value != ''
|
|
51
|
+
if value != nil && value != ''
|
|
51
52
|
@config[key.to_sym] = value
|
|
52
53
|
else
|
|
53
54
|
@config.delete(key.to_sym)
|
|
@@ -66,7 +67,7 @@ module Capistrano
|
|
|
66
67
|
return unless other
|
|
67
68
|
|
|
68
69
|
other.to_h.each do |key, value|
|
|
69
|
-
next if
|
|
70
|
+
next if value == nil || value == ''
|
|
70
71
|
|
|
71
72
|
set(key, value)
|
|
72
73
|
end
|
|
File without changes
|
|
File without changes
|
|
@@ -8,34 +8,72 @@ Configure the redmine credentials for deployment.
|
|
|
8
8
|
task :setup do
|
|
9
9
|
require 'capistrano/redmine/deployment/config'
|
|
10
10
|
|
|
11
|
+
# resolve configs
|
|
12
|
+
config = Capistrano::Redmine::Deployment::Config.config_from_file(File.join(Dir.pwd, '.redmine'))
|
|
13
|
+
|
|
11
14
|
puts "******************************************************************************************************"
|
|
12
15
|
puts "== Capistrano::Redmine::Deployment - setup =="
|
|
13
16
|
puts "******************************************************************************************************"
|
|
14
17
|
puts ""
|
|
15
18
|
puts " This task creates a '.redmine' file in your current application folder (pwd)."
|
|
19
|
+
puts " Define credentials with this task (e.g. api_key)."
|
|
20
|
+
puts ""
|
|
16
21
|
puts " This file must NOT be exposed and should be EXCLUDED by your scm."
|
|
17
|
-
puts " Define
|
|
18
|
-
puts " Define
|
|
22
|
+
puts " Define shared settings within your 'config/deploy.rb' (e.g. host, project, repository)."
|
|
23
|
+
puts " Define credentials with this task (e.g. api_key)."
|
|
24
|
+
puts ""
|
|
25
|
+
puts " > HINT: Keep configs empty to prevent to overwrite existing configs."
|
|
19
26
|
puts ""
|
|
20
27
|
puts "******************************************************************************************************"
|
|
21
|
-
|
|
28
|
+
puts ""
|
|
29
|
+
puts ""
|
|
30
|
+
|
|
31
|
+
# -- BEGIN over here ...
|
|
32
|
+
|
|
33
|
+
if config.get(:api_key)
|
|
34
|
+
print "API-KEY (already done)..................> "
|
|
35
|
+
else
|
|
36
|
+
print "API-KEY (optional)......................> "
|
|
37
|
+
end
|
|
22
38
|
redmine_api_key = STDIN.gets.strip
|
|
23
|
-
|
|
39
|
+
|
|
40
|
+
if config.get(:host)
|
|
41
|
+
print "HOST (already done).....................> "
|
|
42
|
+
else
|
|
43
|
+
print "HOST (optional).........................> "
|
|
44
|
+
end
|
|
24
45
|
redmine_host = STDIN.gets.strip
|
|
25
|
-
|
|
46
|
+
|
|
47
|
+
if config.get(:project)
|
|
48
|
+
print "PROJECT (already done)..................> "
|
|
49
|
+
else
|
|
50
|
+
print "PROJECT (optional)......................> "
|
|
51
|
+
end
|
|
26
52
|
redmine_project = STDIN.gets.strip
|
|
27
|
-
|
|
53
|
+
|
|
54
|
+
if config.get(:repository)
|
|
55
|
+
print "REPOSITORY (already done)...............> "
|
|
56
|
+
else
|
|
57
|
+
print "REPOSITORY (optional)...................> "
|
|
58
|
+
end
|
|
28
59
|
redmine_repository = STDIN.gets.strip
|
|
60
|
+
|
|
61
|
+
if config.get(:host_verification) != nil
|
|
62
|
+
print "DISABLE HOST VERIFICATION (already done)........> "
|
|
63
|
+
else
|
|
64
|
+
print "DISABLE HOST VERIFICATION (y / n)...............> "
|
|
65
|
+
end
|
|
66
|
+
redmine_host_verification = STDIN.gets.strip
|
|
67
|
+
|
|
29
68
|
puts ""
|
|
30
69
|
|
|
31
|
-
# build config
|
|
32
|
-
config = Capistrano::Redmine::Deployment::Config.config_from_file(File.join(Dir.pwd, '.redmine'))
|
|
33
70
|
|
|
34
71
|
# force set to overwrite possible existing keys
|
|
35
|
-
config.set(:api_key, redmine_api_key)
|
|
36
|
-
config.set(:host, redmine_host)
|
|
37
|
-
config.set(:project, redmine_project)
|
|
38
|
-
config.set(:repository, redmine_repository)
|
|
72
|
+
config.set(:api_key, redmine_api_key) if redmine_api_key != ''
|
|
73
|
+
config.set(:host, redmine_host) if redmine_host != ''
|
|
74
|
+
config.set(:project, redmine_project) if redmine_project != ''
|
|
75
|
+
config.set(:repository, redmine_repository) if redmine_repository != ''
|
|
76
|
+
config.set(:host_verification, redmine_host_verification.downcase != 'y') if redmine_host_verification != ''
|
|
39
77
|
|
|
40
78
|
if config.save
|
|
41
79
|
puts "Successfully stored config @ #{config.file}"
|
|
File without changes
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: capistrano-redmine-deployment
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tobias Gonsior
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: |
|
|
14
13
|
'capistrano-redmine-deployment' is a capistrano task to log deployments to any related redmine repository.
|
|
@@ -21,6 +20,7 @@ extra_rdoc_files: []
|
|
|
21
20
|
files:
|
|
22
21
|
- ".gitignore"
|
|
23
22
|
- Gemfile
|
|
23
|
+
- LICENSE.txt
|
|
24
24
|
- README.md
|
|
25
25
|
- Rakefile
|
|
26
26
|
- bin/console
|
|
@@ -28,7 +28,6 @@ files:
|
|
|
28
28
|
- capistrano-redmine-deployment.gemspec
|
|
29
29
|
- docs/CHANGELOG.md
|
|
30
30
|
- docs/CODE_OF_CONDUCT.md
|
|
31
|
-
- docs/LICENSE.md
|
|
32
31
|
- lib/capistrano-redmine-deployment.rb
|
|
33
32
|
- lib/capistrano/redmine/deployment/client.rb
|
|
34
33
|
- lib/capistrano/redmine/deployment/config.rb
|
|
@@ -46,7 +45,6 @@ metadata:
|
|
|
46
45
|
documentation_uri: https://rubydoc.info/gems/capistrano-redmine-deployment
|
|
47
46
|
changelog_uri: https://github.com/ruby-smart/capistrano-redmine-deployment/blob/main/docs/CHANGELOG.md
|
|
48
47
|
allowed_push_host: https://rubygems.org
|
|
49
|
-
post_install_message:
|
|
50
48
|
rdoc_options: []
|
|
51
49
|
require_paths:
|
|
52
50
|
- lib
|
|
@@ -61,8 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
61
59
|
- !ruby/object:Gem::Version
|
|
62
60
|
version: '0'
|
|
63
61
|
requirements: []
|
|
64
|
-
rubygems_version: 3.
|
|
65
|
-
signing_key:
|
|
62
|
+
rubygems_version: 3.6.9
|
|
66
63
|
specification_version: 4
|
|
67
64
|
summary: Redmine Deployment Tracking (for redmine_deployment plugin)
|
|
68
65
|
test_files: []
|