bard 3.0.0 → 3.1.0

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: 6e59f0686a010077d3980ceea61597d7c3bac7bd60358110c0e180990df10afc
4
- data.tar.gz: 7e4ef9ac960e6fb28e7e465357e9edaa806bad6b537f580c3eb86ed1ef271e50
3
+ metadata.gz: e0c83a0ddfb1fb786c8887ff950f492ca14d4ec844bcb2089370c54199a872bd
4
+ data.tar.gz: 2adef7cc19355a6c8bd5d64cc0e07296ef7213202c147d9ecd8130b39108f07e
5
5
  SHA512:
6
- metadata.gz: 2f1d8d605e8331cc5375170e1206eb3d5a4c665603f9556ce2d2823ee240b867b667695f38084dafa732dce1dd44a58a890d57b48365cdb09197d308321edb16
7
- data.tar.gz: 56381e180c1d9a65d9f990023bbd23867793a82b77007de941fd3e70d674cd3cd6c5df237c7be61382030ba03711513276411f9c2a77e28a662d159e1781808f
6
+ metadata.gz: fe7d1d506f5861f43a9ff870e77afa1f32c33d04547eec691dd6452a9fc897e38c88d5167b89ea06cbf830902d71fb473b05ffe3007e1c83cd10986a03f06376
7
+ data.tar.gz: 7faa7e8dbc21ac3f3120f58cee268a06572b6fea65ec594c55569abcdd1b6f534fa10ef6e2a275edf38616e9fd743ce6e8c6399c75ed9dfd872cccbc83409b40
@@ -18,26 +18,5 @@ jobs:
18
18
  ruby-version: ${{ matrix.ruby }}
19
19
  bundler-cache: true
20
20
 
21
- - name: Install Podman
22
- run: |
23
- sudo apt-get update -y
24
- sudo apt-get install -y podman
25
- # Start podman service as root using TCP for better compatibility in CI
26
- sudo nohup podman system service --time=0 tcp://127.0.0.1:8080 > /tmp/podman-service.log 2>&1 &
27
- # Wait for service to be ready
28
- for i in {1..30}; do
29
- if curl --silent --fail http://127.0.0.1:8080/v1.40/version >/dev/null 2>&1; then
30
- echo "Podman REST API ready at tcp://127.0.0.1:8080"
31
- break
32
- fi
33
- sleep 1
34
- done
35
- echo "DOCKER_HOST=tcp://127.0.0.1:8080" >> $GITHUB_ENV
36
-
37
- - name: Build test container image
38
- run: |
39
- sudo podman pull ubuntu:24.04
40
- sudo podman build -t bard-test-server -f spec/acceptance/docker/Dockerfile spec/acceptance/docker
41
-
42
21
  - name: Run tests
43
22
  run: bundle exec rake
data/lib/bard/config.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "bard/target"
2
2
  require "bard/plugins/ssh/target_methods"
3
3
  require "bard/plugins/ping/target_methods"
4
+ require "bard/plugins/deploy_url/target_methods"
4
5
 
5
6
  module Bard
6
7
  class Config
@@ -0,0 +1,16 @@
1
+ require "uri"
2
+ require "bard/target"
3
+ require "bard/plugins/url/target_methods"
4
+ require "bard/plugins/ping/target_methods"
5
+
6
+ class Bard::Target
7
+ # The public /bard/deploy endpoint URL for this target, or nil if it has no web address.
8
+ # Prefers the health-checked ping host over the ssh-derived url, which for a proxied app can be
9
+ # an origin with a non-public cert. Anchors to the host root so a ping path (e.g. "/up") is
10
+ # dropped. Mirrors how `bard deploy` chooses where to POST.
11
+ def deploy_url
12
+ base = ping.first || url
13
+ return unless base
14
+ URI.join(base, "/bard/deploy").to_s
15
+ end
16
+ end
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "3.0.0"
2
+ VERSION = "3.1.0"
3
3
  end
4
4
 
@@ -4,6 +4,7 @@ require "bard/target"
4
4
  require "bard/plugins/url/target_methods"
5
5
  require "bard/plugins/ssh/target_methods"
6
6
  require "bard/plugins/ping/target_methods"
7
+ require "bard/plugins/deploy_url/target_methods"
7
8
 
8
9
  describe Bard::Target do
9
10
  let(:config) { double("config", project_name: "testapp") }
@@ -134,6 +135,39 @@ describe Bard::Target do
134
135
  end
135
136
  end
136
137
 
138
+ describe "#deploy_url" do
139
+ it "builds the /bard/deploy endpoint from an ssh-derived url" do
140
+ target.ssh("www@example.com:22022")
141
+ expect(target.deploy_url).to eq("https://example.com/bard/deploy")
142
+ end
143
+
144
+ it "prefers the ping host over the ssh-derived url" do
145
+ target.ssh("www@ssh.example.com:22022")
146
+ target.ping("example.com")
147
+ expect(target.deploy_url).to eq("https://example.com/bard/deploy")
148
+ end
149
+
150
+ it "anchors to the host root, dropping any ping path" do
151
+ target.ping("admin.example.com/up")
152
+ expect(target.deploy_url).to eq("https://admin.example.com/bard/deploy")
153
+ end
154
+
155
+ it "uses the first ping when several are configured" do
156
+ target.ping("primary.example.com", "secondary.example.com")
157
+ expect(target.deploy_url).to eq("https://primary.example.com/bard/deploy")
158
+ end
159
+
160
+ it "falls back to url when ping is disabled" do
161
+ target.url("example.com")
162
+ target.ping(false)
163
+ expect(target.deploy_url).to eq("https://example.com/bard/deploy")
164
+ end
165
+
166
+ it "returns nil when the target has no web address" do
167
+ expect(target.deploy_url).to be_nil
168
+ end
169
+ end
170
+
137
171
  describe "#path" do
138
172
  it "defaults to project name" do
139
173
  expect(target.path).to eq("testapp")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-07-09 00:00:00.000000000 Z
10
+ date: 2026-07-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake
@@ -71,6 +71,7 @@ files:
71
71
  - cucumber.yml
72
72
  - lib/bard.rb
73
73
  - lib/bard/config.rb
74
+ - lib/bard/plugins/deploy_url/target_methods.rb
74
75
  - lib/bard/plugins/ping/target_methods.rb
75
76
  - lib/bard/plugins/ssh/connection.rb
76
77
  - lib/bard/plugins/ssh/server.rb