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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b988c2350fa48044fbef604ad868571d9730c089725062f120b2b22d3da8e02
4
- data.tar.gz: 67b6df1cd737d04ac6c73ca7fcc64843d80cfd26b4e4564a54fbb0dd275b225f
3
+ metadata.gz: 5074f6113c81db3167ce573cc244a07b1da3d0fe382b61096cd33584fec5bbd8
4
+ data.tar.gz: c416cc50aa7a85cceb80ee7196fe3eea802901bc5ae01f0a1d5ecae53695f413
5
5
  SHA512:
6
- metadata.gz: 9e9813bafcb8a60628689727aafd84e63c47f3a8f1e3f8e533dd56963e70ef915a2c1f2f4cd9ce9d8cd3e02bc4da36477fb4ccd78930a6e30d9896bd2afb23bb
7
- data.tar.gz: 20af02a805bd95be735dac9a66b596294b772606f91c8f0ec9a2e82a49754521105a35cd575d6480f04fd188230d491c0d73980973cd616dd3fbc971baf390cb
6
+ metadata.gz: 510145a48a04599f50ea8c345de79920c6ce6d744179ff3fa80564e2d247294318fd0e9fd153455a85e28e9f62b942a7a7f5e4bae2f749dde48be14bff61d9fa
7
+ data.tar.gz: 68ce310175914a76103f37b63ab790026f6ec5277a9f25c2819f14a48a34cf30a196b5abb86360fd596c5017bb96a4401ec388ad7afebe9d478e60f6e410e678
data/Gemfile CHANGED
@@ -12,6 +12,6 @@ gem "guard-standardrb", "~> 0.2"
12
12
  gem "minitest", "~> 5.20"
13
13
  gem "minitest-reporters", "~> 1.3"
14
14
  gem "minitest-silence"
15
- gem "mocha", "~> 2.1.0"
15
+ gem "mocha", "~> 3.0.1"
16
16
  gem "rake", "~> 13.0"
17
17
  gem "webmock", "~> 3.23"
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
- # with Minitest::Unit
29
- watch(%r{^test/(.*)/?test_(.*)\.rb$})
6
+ watch(%r{^test/(.*/)?([^/]+)_test\.rb$})
30
7
  watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m|
31
- puts "tests"
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.8
72
+ bin/release 0.2.11
73
73
  ```
74
74
 
75
75
  ## Code of Conduct
data/Rakefile CHANGED
@@ -6,6 +6,8 @@ require "standard/rake"
6
6
 
7
7
  Rake::TestTask.new(:test) do |t|
8
8
  t.libs << "test"
9
+ t.libs << "lib"
10
+ t.test_files = FileList["test/**/*_test.rb"]
9
11
  end
10
12
 
11
13
  task default: %i[test standard]
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shipyrd
4
- VERSION = "0.2.9"
4
+ VERSION = "0.2.10"
5
5
  end
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.9
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: 2024-12-03 00:00:00.000000000 Z
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: 3.5.10
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: []