seira 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +24 -0
- data/README.md +2 -2
- data/lib/seira/jobs.rb +21 -6
- data/lib/seira/pods.rb +0 -2
- data/lib/seira/random.rb +0 -3
- data/lib/seira/version.rb +1 -1
- metadata +6 -6
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e2e516ae84d1bcdc4f3320eeb13c83dc6cd162bfbe5e249b53e2b3af74885c
|
4
|
+
data.tar.gz: 027a214ded3ab47b25fe29b9e8943bd268fe908ff9aa87993ffa07e9c395e350
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6cc9ea8137d0ae4578a5fbdbeac88f8e8d01916dd8e64f8dc83d4ac30517fda718ae06d0d02b5c354e9d80e3ee3ab3f75df433dda45ac85b60e512cc878b058
|
7
|
+
data.tar.gz: 828524836a6abc488bc29a3333733887e57b39351f9d54b8ecb9986c49520abd6e8564b97425f702fed90b2256f68c558303c76ee6be49fc58362a3898fc4f32
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
|
8
|
+
runs-on: ubuntu-20.04
|
9
|
+
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby-version: ['2.6.3', '2.7.2']
|
13
|
+
|
14
|
+
steps:
|
15
|
+
# Pin to this commit: v2
|
16
|
+
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
17
|
+
- name: Set up Ruby
|
18
|
+
# Pin to this commit, v1.82.0
|
19
|
+
uses: ruby/setup-ruby@5e4f0a10bfc39c97cd5358121291e27e5d97e09b
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby-version }}
|
22
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
23
|
+
- name: Run tests
|
24
|
+
run: bundle exec rake
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Seira
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/seira.svg)](https://badge.fury.io/rb/seira)
|
4
|
-
[![Build Status](https://
|
4
|
+
[![Build Status](https://github.com/joinhandshake/seira/actions/workflows/ruby.yml/badge.svg)](https://github.com/joinhandshake/seira/actions)
|
5
5
|
|
6
6
|
An opinionated library for building applications on Kubernetes.
|
7
7
|
|
@@ -165,7 +165,7 @@ Pods can be listed and also exec'd into.
|
|
165
165
|
|
166
166
|
`seira staging app-name pods list`
|
167
167
|
|
168
|
-
`seira staging app-name pods
|
168
|
+
`seira staging app-name pods connect --pod=<POD-NAME>`
|
169
169
|
|
170
170
|
## Development
|
171
171
|
|
data/lib/seira/jobs.rb
CHANGED
@@ -57,7 +57,19 @@ module Seira
|
|
57
57
|
def run_help
|
58
58
|
puts SUMMARY
|
59
59
|
puts "\n\n"
|
60
|
-
puts
|
60
|
+
puts <<~HELPTEXT
|
61
|
+
help: Display the help page.
|
62
|
+
list: List the currently running jobs in the given application namespace.
|
63
|
+
delete: Delete a stuck migration job via Kubernetes job 'seira cluster app delete job-name'.
|
64
|
+
run: Execute a given command to issue a schema migration.
|
65
|
+
|
66
|
+
options:
|
67
|
+
--template-file: Provide a job template file to use. (--template-file=template.yaml.erb)
|
68
|
+
--async: Wait for the job to finish before exiting.
|
69
|
+
--no_delete: Do not delete the Kubernetes job after it is finished.
|
70
|
+
--size: Use a predetermined resource sizing template for this job. (Default size: 1)
|
71
|
+
|
72
|
+
HELPTEXT
|
61
73
|
end
|
62
74
|
|
63
75
|
def run_list
|
@@ -75,6 +87,7 @@ module Seira
|
|
75
87
|
async = false # Wait for job to finish before continuing.
|
76
88
|
no_delete = false # Delete at end
|
77
89
|
resource_hash = RESOURCE_SIZES['1']
|
90
|
+
template_file = "template.yaml"
|
78
91
|
|
79
92
|
# Loop through args and process any that aren't just the command to run
|
80
93
|
loop do
|
@@ -94,6 +107,8 @@ module Seira
|
|
94
107
|
elsif arg.start_with?('--size=')
|
95
108
|
size = arg.split('=')[1]
|
96
109
|
resource_hash = RESOURCE_SIZES[size]
|
110
|
+
elsif arg.start_with?('--template-file=')
|
111
|
+
template_file = arg.split('=')[1]
|
97
112
|
else
|
98
113
|
puts "Warning: Unrecognized argument #{arg}"
|
99
114
|
end
|
@@ -113,7 +128,7 @@ module Seira
|
|
113
128
|
|
114
129
|
source = "kubernetes/#{context[:cluster]}/#{app}" # TODO: Move to method in app.rb
|
115
130
|
Dir.mktmpdir do |destination|
|
116
|
-
file_name = discover_job_template_file_name(source)
|
131
|
+
file_name = discover_job_template_file_name(source, template_file)
|
117
132
|
|
118
133
|
FileUtils.mkdir_p destination # Create the nested directory
|
119
134
|
FileUtils.copy_file "#{source}/jobs/#{file_name}", "#{destination}/#{file_name}"
|
@@ -174,11 +189,11 @@ module Seira
|
|
174
189
|
end
|
175
190
|
end
|
176
191
|
|
177
|
-
def discover_job_template_file_name(source)
|
178
|
-
if File.exist?("#{source}/jobs
|
179
|
-
"
|
192
|
+
def discover_job_template_file_name(source, template_file)
|
193
|
+
if File.exist?("#{source}/jobs/#{template_file}.erb")
|
194
|
+
"#{template_file}.erb"
|
180
195
|
else
|
181
|
-
|
196
|
+
template_file
|
182
197
|
end
|
183
198
|
end
|
184
199
|
end
|
data/lib/seira/pods.rb
CHANGED
data/lib/seira/random.rb
CHANGED
@@ -70,7 +70,6 @@ module Seira
|
|
70
70
|
bombay
|
71
71
|
bongo
|
72
72
|
bonobo
|
73
|
-
booby
|
74
73
|
budgerigar
|
75
74
|
buffalo
|
76
75
|
bulldog
|
@@ -120,7 +119,6 @@ module Seira
|
|
120
119
|
dachshund
|
121
120
|
dalmatian
|
122
121
|
deer
|
123
|
-
dhole
|
124
122
|
dingo
|
125
123
|
dinosaur
|
126
124
|
discus
|
@@ -193,7 +191,6 @@ module Seira
|
|
193
191
|
hippopotamus
|
194
192
|
hornet
|
195
193
|
horse
|
196
|
-
human
|
197
194
|
hummingbird
|
198
195
|
hyena
|
199
196
|
ibis
|
data/lib/seira/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Ringwelski
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -103,12 +103,12 @@ extensions: []
|
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
105
|
- ".default-rubocop.yml"
|
106
|
+
- ".github/workflows/ruby.yml"
|
106
107
|
- ".gitignore"
|
107
108
|
- ".hound.yml"
|
108
109
|
- ".rspec"
|
109
110
|
- ".rubocop.yml"
|
110
111
|
- ".ruby-version"
|
111
|
-
- ".travis.yml"
|
112
112
|
- Gemfile
|
113
113
|
- LICENSE
|
114
114
|
- README.md
|
@@ -143,7 +143,7 @@ homepage: https://github.com/joinhandshake/seira
|
|
143
143
|
licenses:
|
144
144
|
- MIT
|
145
145
|
metadata: {}
|
146
|
-
post_install_message:
|
146
|
+
post_install_message:
|
147
147
|
rdoc_options: []
|
148
148
|
require_paths:
|
149
149
|
- lib
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubygems_version: 3.0.3
|
162
|
-
signing_key:
|
162
|
+
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: An opinionated library for building applications on Kubernetes.
|
165
165
|
test_files: []
|