shipyrd 0.2.7 → 0.2.9
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/Dockerfile +32 -0
- data/README.md +26 -0
- data/lib/shipyrd/client.rb +2 -8
- data/lib/shipyrd/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b988c2350fa48044fbef604ad868571d9730c089725062f120b2b22d3da8e02
|
4
|
+
data.tar.gz: 67b6df1cd737d04ac6c73ca7fcc64843d80cfd26b4e4564a54fbb0dd275b225f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e9813bafcb8a60628689727aafd84e63c47f3a8f1e3f8e533dd56963e70ef915a2c1f2f4cd9ce9d8cd3e02bc4da36477fb4ccd78930a6e30d9896bd2afb23bb
|
7
|
+
data.tar.gz: 20af02a805bd95be735dac9a66b596294b772606f91c8f0ec9a2e82a49754521105a35cd575d6480f04fd188230d491c0d73980973cd616dd3fbc971baf390cb
|
data/Dockerfile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Use the official Ruby 3.3.0 Alpine image as the base image
|
2
|
+
FROM ruby:3.3.0-alpine
|
3
|
+
|
4
|
+
# Set the working directory to /shipyrd
|
5
|
+
WORKDIR /shipyrd
|
6
|
+
|
7
|
+
# Copy the Gemfile, shipyrd.gemspec into the container
|
8
|
+
COPY Gemfile shipyrd.gemspec ./
|
9
|
+
|
10
|
+
# Required in shipyrd.gemspec
|
11
|
+
COPY lib/shipyrd/version.rb /shipyrd/lib/shipyrd/version.rb
|
12
|
+
|
13
|
+
# Install system dependencies
|
14
|
+
RUN apk add --no-cache --update build-base git \
|
15
|
+
&& gem install bundler --version=2.5.14 \
|
16
|
+
&& bundle install
|
17
|
+
|
18
|
+
# Copy the rest of our application code into the container.
|
19
|
+
# We do this after bundle install, to avoid having to run bundle
|
20
|
+
# every time we do small fixes in the source code.
|
21
|
+
COPY . .
|
22
|
+
|
23
|
+
# Install the gem locally from the project folder
|
24
|
+
RUN gem build shipyrd.gemspec && \
|
25
|
+
gem install ./shipyrd-*.gem --no-document
|
26
|
+
|
27
|
+
# Set the working directory to /workdir
|
28
|
+
WORKDIR /workdir
|
29
|
+
|
30
|
+
# Tell git it's safe to access /workdir/.git even if
|
31
|
+
# the directory is owned by a different user
|
32
|
+
RUN git config --global --add safe.directory /workdir
|
data/README.md
CHANGED
@@ -18,6 +18,24 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
18
18
|
|
19
19
|
Please see the main Shipyrd app([https://github.com/shipyrd/shipyrd](https://github.com/shipyrd/shipyrd)) for setup and usage instructions.
|
20
20
|
|
21
|
+
## Usage with Docker
|
22
|
+
|
23
|
+
You can run a dockerized version of `shipyrd-gem` by adding the following function to your `~/.bashrc` or similar:
|
24
|
+
|
25
|
+
```bash
|
26
|
+
shipyrd() {
|
27
|
+
docker run --rm -v "${PWD}:/workdir" --env-file <(env | grep -E '^(KAMAL_|SHIPYRD_)') ghcr.io/shipyrd/shipyrd-gem /shipyrd/bin/"$@"
|
28
|
+
}
|
29
|
+
```
|
30
|
+
|
31
|
+
Then within a specific Kamal hook (e.g. `pre-connect`), you can call `shipyrd` like this:
|
32
|
+
|
33
|
+
```bash
|
34
|
+
#!/usr/bin/env bash
|
35
|
+
|
36
|
+
shipyrd pre-connect
|
37
|
+
```
|
38
|
+
|
21
39
|
## Recording a deploy
|
22
40
|
|
23
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/).
|
@@ -46,6 +64,14 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
46
64
|
|
47
65
|
Bug reports and pull requests are welcome on GitHub at https://github.com/shipyrd/shipyrd-gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[shipyrd/shipyrd-gem/blob/main/CODE_OF_CONDUCT.md).
|
48
66
|
|
67
|
+
## Releasing a new version
|
68
|
+
|
69
|
+
The `bin/release` command will bump the version in the version.rb file, tag it, and push it up to github & rubygems.
|
70
|
+
|
71
|
+
```
|
72
|
+
bin/release 0.2.8
|
73
|
+
```
|
74
|
+
|
49
75
|
## Code of Conduct
|
50
76
|
|
51
77
|
Everyone interacting in the Shipyrd project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/shipyrd/shipyrd-gem/blob/main/CODE_OF_CONDUCT.md).
|
data/lib/shipyrd/client.rb
CHANGED
@@ -93,7 +93,7 @@ class Shipyrd::Client
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def validate_configuration
|
96
|
-
|
96
|
+
valid_api_key?
|
97
97
|
|
98
98
|
true
|
99
99
|
rescue ArgumentError => e
|
@@ -102,12 +102,6 @@ class Shipyrd::Client
|
|
102
102
|
false
|
103
103
|
end
|
104
104
|
|
105
|
-
def valid_host?
|
106
|
-
raise ArgumentError, "ENV['SHIPYRD_HOST'] is not configured, disabling" unless host
|
107
|
-
|
108
|
-
true
|
109
|
-
end
|
110
|
-
|
111
105
|
def valid_api_key?
|
112
106
|
raise ArgumentError, "ENV['SHIPYRD_API_KEY'] is not configured, disabling" unless api_key
|
113
107
|
|
@@ -115,7 +109,7 @@ class Shipyrd::Client
|
|
115
109
|
end
|
116
110
|
|
117
111
|
def parse_host(host)
|
118
|
-
return
|
112
|
+
return "https://hooks.shipyrd.io" if host.nil?
|
119
113
|
return host if host.start_with?("https")
|
120
114
|
|
121
115
|
"https://#{host}"
|
data/lib/shipyrd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Hammond
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: The companion gem for Shipyrd, the Kamal deployment dashboard
|
14
14
|
email:
|
@@ -19,6 +19,7 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- ".standard.yml"
|
21
21
|
- CODE_OF_CONDUCT.md
|
22
|
+
- Dockerfile
|
22
23
|
- Gemfile
|
23
24
|
- Guardfile
|
24
25
|
- README.md
|