shipyrd 0.2.11 → 0.2.12

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: 4ca8632fd328d206ba4b724f9bc87cfb1da3c91e4c6ef170417e14dad5e4218c
4
- data.tar.gz: c2c0d9a4d1e9f523fbbe9fe1f5c42271a38c806951c0eee95f838ff82ec73748
3
+ metadata.gz: 4dabe0011e5ccdc8b89120b5a9b0a45053b8889b30f18df503a47a6830ac0d05
4
+ data.tar.gz: 9d6eb3e80786b3d4b2e8d78eb6f661fbc65549c7d06db4be5fbeccce35893bcf
5
5
  SHA512:
6
- metadata.gz: df11e4e06c89519193752651d55fe33a4e3f8e96b0199c01e08c779b2533f54be89a5d2a10388d85f9c600d5f22f7d7ff5f23f029c7e6b4da63f02623874255c
7
- data.tar.gz: 57a15080c8af612d49fb6f7414ba6f542120a39324f5bd2e6e91bd1115f39f909b09b33cbe350ea78135cf49fa355b9bb196f87f6841cfcc123848f18b0eae27
6
+ metadata.gz: 62220c52b938866e33b67a2927d9b2255687ddd66c04e86415a4d9228cef38e71a3867279e6ea52e00d99b983071d057584417aac050fbfcecbc5848f5cba87b
7
+ data.tar.gz: b1a59c0ede51edea372bba60512bfe43668063507e07b9040909f6079a3cd10c4d8d6221a6df0362ab175658e97467daed54e441bd359bb2d8dd775e72f59185
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This is a simple helper gem to connect your Kamal hooks(pre-build, pre-build, pre-deploy, post-deploy) to Shipyrd.
4
4
 
5
- [Shipyrd](https://shipyrd.io) is a deployment dashboard built for Kamal.
5
+ [Shipyrd](https://shipyrd.io) is the deployment dashboard for your team.
6
6
 
7
7
  ## Installation
8
8
 
@@ -38,18 +38,18 @@ shipyrd pre-connect
38
38
 
39
39
  ## Recording a deploy
40
40
 
41
- This gem currently sends the following deploy details to record a deploy. The various `KAMAL_` ENV variables are set via Kamal when the [hooks are called](https://kamal-deploy.org/docs/hooks/hooks-overview/).
42
-
43
- * `ENV["KAMAL_COMMAND"]`,
44
- * `ENV["KAMAL_DESTINATION"]`,
45
- * `ENV["KAMAL_HOSTS"`,
46
- * `ENV["KAMAL_PERFORMER"]` - `gh config get -h github.com username` is preferred if set.
47
- * `ENV["KAMAL_RECORDED_AT"]`,
48
- * `ENV["KAMAL_ROLE"]`,
49
- * `ENV["KAMAL_RUNTIME"]`,
50
- * `ENV["KAMAL_SERVICE_VERSION"]`,
51
- * `ENV["KAMAL_SUBCOMMAND"]`,
52
- * `ENV["KAMAL_VERSION"]`,
41
+ This gem currently sends the following deploy details to record a deploy. Each deploy variable can be set with either a `SHIPYRD_` or `KAMAL_` prefix `SHIPYRD_` takes precedence. The `KAMAL_` variants are set automatically by Kamal when the [hooks are called](https://kamal-deploy.org/docs/hooks/hooks-overview/).
42
+
43
+ * `ENV["SHIPYRD_COMMAND"]` / `ENV["KAMAL_COMMAND"]`,
44
+ * `ENV["SHIPYRD_DESTINATION"]` / `ENV["KAMAL_DESTINATION"]`,
45
+ * `ENV["SHIPYRD_HOSTS"]` / `ENV["KAMAL_HOSTS"]`,
46
+ * `ENV["SHIPYRD_PERFORMER"]` / `ENV["KAMAL_PERFORMER"]` - `gh config get -h github.com username` is preferred if set.
47
+ * `ENV["SHIPYRD_RECORDED_AT"]` / `ENV["KAMAL_RECORDED_AT"]`,
48
+ * `ENV["SHIPYRD_ROLE"]` / `ENV["KAMAL_ROLE"]`,
49
+ * `ENV["SHIPYRD_RUNTIME"]` / `ENV["KAMAL_RUNTIME"]`,
50
+ * `ENV["SHIPYRD_SERVICE_VERSION"]` / `ENV["KAMAL_SERVICE_VERSION"]`,
51
+ * `ENV["SHIPYRD_SUBCOMMAND"]` / `ENV["KAMAL_SUBCOMMAND"]`,
52
+ * `ENV["SHIPYRD_VERSION"]` / `ENV["KAMAL_VERSION"]`,
53
53
  * `ENV["SHIPYRD_API_KEY"]`,
54
54
  * `ENV["SHIPYRD_HOST"]`,
55
55
  * Commit message - The first 90 characters of your commit message `git show -s --format=%s`.
@@ -13,8 +13,18 @@ class Shipyrd::Client
13
13
  KAMAL_SUBCOMMAND
14
14
  KAMAL_VERSION
15
15
  SHIPYRD_API_KEY
16
+ SHIPYRD_COMMAND
16
17
  SHIPYRD_COMMIT_MESSAGE
18
+ SHIPYRD_DESTINATION
17
19
  SHIPYRD_HOST
20
+ SHIPYRD_HOSTS
21
+ SHIPYRD_PERFORMER
22
+ SHIPYRD_RECORDED_AT
23
+ SHIPYRD_ROLE
24
+ SHIPYRD_RUNTIME
25
+ SHIPYRD_SERVICE_VERSION
26
+ SHIPYRD_SUBCOMMAND
27
+ SHIPYRD_VERSION
18
28
  ]
19
29
 
20
30
  class DestinationBlocked < StandardError; end
@@ -38,17 +48,17 @@ class Shipyrd::Client
38
48
  details = {
39
49
  deploy: {
40
50
  status: event,
41
- recorded_at: ENV["KAMAL_RECORDED_AT"],
51
+ recorded_at: env_var("RECORDED_AT"),
42
52
  performer: performer,
43
53
  commit_message: ENV["SHIPYRD_COMMIT_MESSAGE"] || commit_message,
44
- version: ENV["KAMAL_VERSION"],
45
- service_version: ENV["KAMAL_SERVICE_VERSION"],
46
- hosts: ENV["KAMAL_HOSTS"],
47
- command: ENV["KAMAL_COMMAND"],
48
- subcommand: ENV["KAMAL_SUBCOMMAND"],
49
- role: ENV["KAMAL_ROLE"],
50
- destination: ENV["KAMAL_DESTINATION"],
51
- runtime: ENV["KAMAL_RUNTIME"]
54
+ version: env_var("VERSION"),
55
+ service_version: env_var("SERVICE_VERSION"),
56
+ hosts: env_var("HOSTS"),
57
+ command: env_var("COMMAND"),
58
+ subcommand: env_var("SUBCOMMAND"),
59
+ role: env_var("ROLE"),
60
+ destination: env_var("DESTINATION"),
61
+ runtime: env_var("RUNTIME")
52
62
  }
53
63
  }
54
64
 
@@ -86,7 +96,7 @@ class Shipyrd::Client
86
96
  end
87
97
 
88
98
  def performer
89
- github_username.empty? ? ENV["KAMAL_PERFORMER"] : "https://github.com/#{github_username}"
99
+ github_username.empty? ? env_var("PERFORMER") : "https://github.com/#{github_username}"
90
100
  end
91
101
 
92
102
  def github_username
@@ -127,4 +137,10 @@ class Shipyrd::Client
127
137
 
128
138
  "https://#{host}"
129
139
  end
140
+
141
+ private
142
+
143
+ def env_var(name)
144
+ ENV["SHIPYRD_#{name}"] || ENV["KAMAL_#{name}"]
145
+ end
130
146
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shipyrd
4
- VERSION = "0.2.11"
4
+ VERSION = "0.2.12"
5
5
  end
data/shipyrd.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["Nick Hammond"]
9
9
  spec.email = ["nick@shipyrd.io"]
10
10
 
11
- spec.summary = "The companion gem for Shipyrd, the Kamal deployment dashboard"
12
- spec.description = "The companion gem for Shipyrd, the Kamal deployment dashboard"
11
+ spec.summary = "The companion gem for Shipyrd, the deployment dashboard for your team"
12
+ spec.description = "The companion gem for Shipyrd, the deployment dashboard for your team"
13
13
  spec.homepage = "https://shipyrd.io"
14
14
  spec.required_ruby_version = ">= 3.0.7"
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipyrd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Hammond
@@ -9,7 +9,7 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
- description: The companion gem for Shipyrd, the Kamal deployment dashboard
12
+ description: The companion gem for Shipyrd, the deployment dashboard for your team
13
13
  email:
14
14
  - nick@shipyrd.io
15
15
  executables: []
@@ -50,5 +50,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  requirements: []
51
51
  rubygems_version: 3.6.9
52
52
  specification_version: 4
53
- summary: The companion gem for Shipyrd, the Kamal deployment dashboard
53
+ summary: The companion gem for Shipyrd, the deployment dashboard for your team
54
54
  test_files: []