shipyrd 0.2.6 → 0.2.8
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 +7 -2
- 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: fe5022a38929c185905c3cdcbdc369f2c1248ecceeb5bf168851de844b6f4016
|
4
|
+
data.tar.gz: bae76bddedb65ba16f869eaeba93c295854d35e39508794a3f1b274087971970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b0e4dcc34ec8273699b4d049a3c5f77e6cbb197b270461dc375445bca062b90ef7fed8b976a89a7608203e28e10c0a0dda0f9404bc561c24f2c1ec07e096eb0
|
7
|
+
data.tar.gz: 59a9bb7a98ae6a4b9de55bf2ac82f6d7a1f2a704e6a0290dfde85ceea1125f52499d356f937214a281ead64e2a67eed24d3dbcabbda07f7e7f34c431719254ef
|
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
@@ -73,11 +73,15 @@ class Shipyrd::Client
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def performer
|
76
|
-
github_username = `gh config get -h github.com username`.chomp
|
77
|
-
|
78
76
|
github_username.empty? ? ENV["KAMAL_PERFORMER"] : "https://github.com/#{github_username}"
|
79
77
|
end
|
80
78
|
|
79
|
+
def github_username
|
80
|
+
`gh config get -h github.com username`.chomp
|
81
|
+
rescue
|
82
|
+
"" # gh config get returns an empty string when not set
|
83
|
+
end
|
84
|
+
|
81
85
|
def commit_message
|
82
86
|
message = `git show -s --format=%s`.chomp
|
83
87
|
|
@@ -112,6 +116,7 @@ class Shipyrd::Client
|
|
112
116
|
|
113
117
|
def parse_host(host)
|
114
118
|
return nil unless host
|
119
|
+
return host if host.start_with?("https")
|
115
120
|
|
116
121
|
"https://#{host}"
|
117
122
|
end
|
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.8
|
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-07-08 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
|