shipyrd 0.2.9 → 0.2.10
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/Gemfile +1 -1
- data/Guardfile +2 -26
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/lib/shipyrd/client.rb +12 -0
- data/lib/shipyrd/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5074f6113c81db3167ce573cc244a07b1da3d0fe382b61096cd33584fec5bbd8
|
|
4
|
+
data.tar.gz: c416cc50aa7a85cceb80ee7196fe3eea802901bc5ae01f0a1d5ecae53695f413
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 510145a48a04599f50ea8c345de79920c6ce6d744179ff3fa80564e2d247294318fd0e9fd153455a85e28e9f62b942a7a7f5e4bae2f749dde48be14bff61d9fa
|
|
7
|
+
data.tar.gz: 68ce310175914a76103f37b63ab790026f6ec5277a9f25c2819f14a48a34cf30a196b5abb86360fd596c5017bb96a4401ec388ad7afebe9d478e60f6e410e678
|
data/Gemfile
CHANGED
data/Guardfile
CHANGED
|
@@ -1,35 +1,11 @@
|
|
|
1
|
-
# A sample Guardfile
|
|
2
|
-
# More info at https://github.com/guard/guard#readme
|
|
3
|
-
|
|
4
|
-
## Uncomment and set this to only include directories you want to watch
|
|
5
|
-
# directories %w(app lib config test spec features) \
|
|
6
|
-
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
|
7
|
-
|
|
8
|
-
## Note: if you are using the `directories` clause above and you are not
|
|
9
|
-
## watching the project directory ('.'), then you will want to move
|
|
10
|
-
## the Guardfile to a watched dir and symlink it back, e.g.
|
|
11
|
-
#
|
|
12
|
-
# $ mkdir config
|
|
13
|
-
# $ mv Guardfile config/
|
|
14
|
-
# $ ln -s config/Guardfile .
|
|
15
|
-
#
|
|
16
|
-
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
|
17
|
-
|
|
18
|
-
# guard :standardrb, fix: true, all_on_start: true do
|
|
19
|
-
# UI.info 'StandardRb is initialized'
|
|
20
|
-
# watch(/.+\.rb$/)
|
|
21
|
-
# end
|
|
22
|
-
|
|
23
1
|
guard :standardrb, fix: false, all_on_start: false, progress: true do
|
|
24
2
|
watch(/.+\.rb$/)
|
|
25
3
|
end
|
|
26
4
|
|
|
27
5
|
guard :minitest, all_on_start: false do
|
|
28
|
-
|
|
29
|
-
watch(%r{^test/(.*)/?test_(.*)\.rb$})
|
|
6
|
+
watch(%r{^test/(.*/)?([^/]+)_test\.rb$})
|
|
30
7
|
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m|
|
|
31
|
-
|
|
32
|
-
"test/#{m[1]}test_#{m[2]}.rb"
|
|
8
|
+
"test/#{m[1]}#{m[2]}_test.rb"
|
|
33
9
|
}
|
|
34
10
|
watch(%r{^test/test_helper\.rb$}) { "test" }
|
|
35
11
|
end
|
data/README.md
CHANGED
|
@@ -69,7 +69,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/shipyr
|
|
|
69
69
|
The `bin/release` command will bump the version in the version.rb file, tag it, and push it up to github & rubygems.
|
|
70
70
|
|
|
71
71
|
```
|
|
72
|
-
bin/release 0.2.
|
|
72
|
+
bin/release 0.2.11
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
## Code of Conduct
|
data/Rakefile
CHANGED
data/lib/shipyrd/client.rb
CHANGED
|
@@ -16,6 +16,8 @@ class Shipyrd::Client
|
|
|
16
16
|
SHIPYRD_HOST
|
|
17
17
|
]
|
|
18
18
|
|
|
19
|
+
class DestinationBlocked < StandardError; end
|
|
20
|
+
|
|
19
21
|
def initialize(host: ENV["SHIPYRD_HOST"], api_key: ENV["SHIPYRD_API_KEY"], **options)
|
|
20
22
|
@host = parse_host(host)
|
|
21
23
|
@api_key = api_key
|
|
@@ -61,9 +63,19 @@ class Shipyrd::Client
|
|
|
61
63
|
|
|
62
64
|
if response.is_a?(Net::HTTPSuccess)
|
|
63
65
|
logger.info "#{event} triggered successfully for #{details[:deploy][:service_version]}"
|
|
66
|
+
elsif response.is_a?(Net::HTTPUnprocessableEntity)
|
|
67
|
+
json_response = JSON.parse(response.body)
|
|
68
|
+
|
|
69
|
+
if (lock = json_response.dig("errors", "lock"))
|
|
70
|
+
raise DestinationBlocked, lock
|
|
71
|
+
else
|
|
72
|
+
logger.info "#{event} trigger failed with errors => #{json_response["errors"]}"
|
|
73
|
+
end
|
|
64
74
|
else
|
|
65
75
|
logger.info "#{event} trigger failed with #{response.code}(#{response.message})"
|
|
66
76
|
end
|
|
77
|
+
rescue DestinationBlocked
|
|
78
|
+
raise
|
|
67
79
|
rescue => e
|
|
68
80
|
logger.info "#{event} trigger failed with error => #{e}"
|
|
69
81
|
end
|
data/lib/shipyrd/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shipyrd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Hammond
|
|
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: The companion gem for Shipyrd, the Kamal deployment dashboard
|
|
14
13
|
email:
|
|
@@ -35,7 +34,6 @@ metadata:
|
|
|
35
34
|
homepage_uri: https://shipyrd.io
|
|
36
35
|
source_code_uri: https://github.com/shipyrd/shipyrd-gem
|
|
37
36
|
changelog_uri: https://github.com/shipyrd/shipyrd-gem/releases
|
|
38
|
-
post_install_message:
|
|
39
37
|
rdoc_options: []
|
|
40
38
|
require_paths:
|
|
41
39
|
- lib
|
|
@@ -50,8 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
50
48
|
- !ruby/object:Gem::Version
|
|
51
49
|
version: '0'
|
|
52
50
|
requirements: []
|
|
53
|
-
rubygems_version:
|
|
54
|
-
signing_key:
|
|
51
|
+
rubygems_version: 4.0.0
|
|
55
52
|
specification_version: 4
|
|
56
53
|
summary: The companion gem for Shipyrd, the Kamal deployment dashboard
|
|
57
54
|
test_files: []
|