capistrano-redmine-deployment 1.2.0 → 1.2.2
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/docs/CHANGELOG.md +6 -0
- data/lib/capistrano/redmine/deployment/client.rb +9 -3
- data/lib/capistrano/redmine/deployment/gem_version.rb +1 -1
- data/lib/capistrano/redmine/deployment/receipts.rb +26 -0
- data/lib/capistrano/redmine/deployment/tasks/verify.rake +5 -0
- 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: f9d8da8079907773b8e06aa718f9ea03f5e04abf2cad17e0c3481fa63c9a983d
|
|
4
|
+
data.tar.gz: 26fd885c40272d4fe5eba5bbd165a861deb2433cce413bc74d9803d51a341aef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 42e35c530c6c7514b8bbb5dfa4891a4883acd05c667f7a08c19df44dd7013fea73c553975a2c78ab10c2ac76fa5a3959e706ab44dca58993c228238f2fa16977
|
|
7
|
+
data.tar.gz: 9908a1e55020de6eb1c310a84c4ec5473a28d5fde7085b925d92cc2be8d6546d2df0216688d068560ae6f2d995b6680c866a7be76997e75413366d793a945d45
|
data/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Capistrano::Redmine::Deployment - CHANGELOG
|
|
2
2
|
|
|
3
|
+
## [1.2.2] - 2026-07-11
|
|
4
|
+
* **[fix]** fetch deployments from the deployments index endpoint
|
|
5
|
+
|
|
6
|
+
## [1.2.1] - 2026-07-11
|
|
7
|
+
**[add]** `redmine:verify` task to validate deployment config using `deploy.rb` settings
|
|
8
|
+
|
|
3
9
|
## [1.2.0] - 2026-07-10
|
|
4
10
|
* **[add]** `redmine:verify` capistrano task to verify config & access by receiving a single deployment
|
|
5
11
|
* **[add]** `Client#receive_deployment` (and `Client.receive_deployment`) - GETs a single deployment entry; an empty (no entries) 2xx response is still treated as valid
|
|
@@ -167,7 +167,7 @@ module Capistrano
|
|
|
167
167
|
# @return [Hash, String] the parsed JSON response, or the raw body when
|
|
168
168
|
# it is not valid JSON.
|
|
169
169
|
def fetch_deployments
|
|
170
|
-
uri =
|
|
170
|
+
uri = deployments_uri
|
|
171
171
|
# only a single entry is needed to verify access
|
|
172
172
|
uri.query = 'limit=1'
|
|
173
173
|
|
|
@@ -197,12 +197,18 @@ module Capistrano
|
|
|
197
197
|
end
|
|
198
198
|
end
|
|
199
199
|
|
|
200
|
-
# @return [URI::Generic] the deploy endpoint URI for the
|
|
201
|
-
# host / project / repository.
|
|
200
|
+
# @return [URI::Generic] the deploy (POST) endpoint URI for the
|
|
201
|
+
# configured host / project / repository.
|
|
202
202
|
def deploy_uri
|
|
203
203
|
URI("#{config.host}/projects/#{config.project}/deploy/#{config.repository}.json")
|
|
204
204
|
end
|
|
205
205
|
|
|
206
|
+
# @return [URI::Generic] the deployments index (GET) endpoint URI for
|
|
207
|
+
# the configured host / project.
|
|
208
|
+
def deployments_uri
|
|
209
|
+
URI("#{config.host}/projects/#{config.project}/deployments.json")
|
|
210
|
+
end
|
|
211
|
+
|
|
206
212
|
# Performs an HTTP request, applying SSL and host-verification settings.
|
|
207
213
|
#
|
|
208
214
|
# SSL is enabled when the URI scheme is +https+. A configured +ca_file+
|
|
@@ -71,4 +71,30 @@ namespace :redmine do
|
|
|
71
71
|
Capistrano::Redmine::Deployment::Client.deploy_fail!(config, deployment)
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
|
+
|
|
75
|
+
desc "Verifies your redmine deployment configuration & access (honors config/deploy.rb)"
|
|
76
|
+
task :verify do
|
|
77
|
+
run_locally do
|
|
78
|
+
# resolve redmine config - `capistrano: self` pulls the shared
|
|
79
|
+
# `set(:redmine_host, ...)` values from config/deploy.rb, then `.redmine`
|
|
80
|
+
# files and ENV win over them.
|
|
81
|
+
config = Capistrano::Redmine::Deployment::Config.resolve(capistrano: self)
|
|
82
|
+
|
|
83
|
+
unless config.valid?
|
|
84
|
+
puts "\e[31m Seems like your redmine configuration is missing or unfinished.\n Run rake task 'rake capistrano:redmine:deployment:setup' to start.\n Skipping redmine verification.\e[0m"
|
|
85
|
+
next
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# An empty result (no deployments logged yet) is fine - `false` means the
|
|
89
|
+
# request itself failed (unreachable host, bad credentials, wrong project/repo).
|
|
90
|
+
result = Capistrano::Redmine::Deployment::Client.receive_deployment(config)
|
|
91
|
+
|
|
92
|
+
puts ""
|
|
93
|
+
if result == false
|
|
94
|
+
puts "\e[31mVerification FAILED. Check host, project, repository and api_key.\e[0m"
|
|
95
|
+
else
|
|
96
|
+
puts "\e[32mVerification succeeded.\e[0m"
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
74
100
|
end
|
|
@@ -22,6 +22,10 @@ Verify the redmine credentials & access for deployment.
|
|
|
22
22
|
puts " Shared settings are resolved from ENV or the '.redmine' file (host, project,"
|
|
23
23
|
puts " repository, api_key). Run 'rake capistrano:redmine:deployment:setup' to configure them."
|
|
24
24
|
puts ""
|
|
25
|
+
puts " NOTE: this rake task has no Capistrano context, so 'set(:redmine_host, ...)'"
|
|
26
|
+
puts " values from config/deploy.rb are NOT seen here. To verify using deploy.rb"
|
|
27
|
+
puts " settings, run the stage-aware task instead: cap <stage> redmine:verify"
|
|
28
|
+
puts ""
|
|
25
29
|
puts "******************************************************************************************************"
|
|
26
30
|
puts ""
|
|
27
31
|
puts ""
|
|
@@ -30,6 +34,7 @@ Verify the redmine credentials & access for deployment.
|
|
|
30
34
|
|
|
31
35
|
unless config.valid?
|
|
32
36
|
puts "\e[31mYour redmine configuration is missing or unfinished.\e[0m"
|
|
37
|
+
puts "Run 'cap <stage> redmine:verify' to verify the stage-aware config."
|
|
33
38
|
puts "Run 'rake capistrano:redmine:deployment:setup' to configure the credentials."
|
|
34
39
|
puts ""
|
|
35
40
|
puts "******************************************************************************************************"
|