shipyrd 0.2.9 → 0.2.11

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: 4ca8632fd328d206ba4b724f9bc87cfb1da3c91e4c6ef170417e14dad5e4218c
4
+ data.tar.gz: c2c0d9a4d1e9f523fbbe9fe1f5c42271a38c806951c0eee95f838ff82ec73748
5
5
  SHA512:
6
- metadata.gz: 9e9813bafcb8a60628689727aafd84e63c47f3a8f1e3f8e533dd56963e70ef915a2c1f2f4cd9ce9d8cd3e02bc4da36477fb4ccd78930a6e30d9896bd2afb23bb
7
- data.tar.gz: 20af02a805bd95be735dac9a66b596294b772606f91c8f0ec9a2e82a49754521105a35cd575d6480f04fd188230d491c0d73980973cd616dd3fbc971baf390cb
6
+ metadata.gz: df11e4e06c89519193752651d55fe33a4e3f8e96b0199c01e08c779b2533f54be89a5d2a10388d85f9c600d5f22f7d7ff5f23f029c7e6b4da63f02623874255c
7
+ data.tar.gz: 57a15080c8af612d49fb6f7414ba6f542120a39324f5bd2e6e91bd1115f39f909b09b33cbe350ea78135cf49fa355b9bb196f87f6841cfcc123848f18b0eae27
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.1.0"
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]
@@ -13,9 +13,12 @@ class Shipyrd::Client
13
13
  KAMAL_SUBCOMMAND
14
14
  KAMAL_VERSION
15
15
  SHIPYRD_API_KEY
16
+ SHIPYRD_COMMIT_MESSAGE
16
17
  SHIPYRD_HOST
17
18
  ]
18
19
 
20
+ class DestinationBlocked < StandardError; end
21
+
19
22
  def initialize(host: ENV["SHIPYRD_HOST"], api_key: ENV["SHIPYRD_API_KEY"], **options)
20
23
  @host = parse_host(host)
21
24
  @api_key = api_key
@@ -37,7 +40,7 @@ class Shipyrd::Client
37
40
  status: event,
38
41
  recorded_at: ENV["KAMAL_RECORDED_AT"],
39
42
  performer: performer,
40
- commit_message: commit_message,
43
+ commit_message: ENV["SHIPYRD_COMMIT_MESSAGE"] || commit_message,
41
44
  version: ENV["KAMAL_VERSION"],
42
45
  service_version: ENV["KAMAL_SERVICE_VERSION"],
43
46
  hosts: ENV["KAMAL_HOSTS"],
@@ -61,9 +64,19 @@ class Shipyrd::Client
61
64
 
62
65
  if response.is_a?(Net::HTTPSuccess)
63
66
  logger.info "#{event} triggered successfully for #{details[:deploy][:service_version]}"
67
+ elsif response.is_a?(Net::HTTPUnprocessableEntity)
68
+ json_response = JSON.parse(response.body)
69
+
70
+ if (lock = json_response.dig("errors", "lock"))
71
+ raise DestinationBlocked, lock
72
+ else
73
+ logger.info "#{event} trigger failed with errors => #{json_response["errors"]}"
74
+ end
64
75
  else
65
76
  logger.info "#{event} trigger failed with #{response.code}(#{response.message})"
66
77
  end
78
+ rescue DestinationBlocked
79
+ raise
67
80
  rescue => e
68
81
  logger.info "#{event} trigger failed with error => #{e}"
69
82
  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.11"
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.11
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: 3.6.9
55
52
  specification_version: 4
56
53
  summary: The companion gem for Shipyrd, the Kamal deployment dashboard
57
54
  test_files: []