lbhrr 1.0.24 → 1.0.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/lbhrr +56 -14
- data/lib/lbhrr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9316b3555eea12d2403c4b53f2294a09652458267b803938f725667b27b1ac4
|
4
|
+
data.tar.gz: aecf3fa3443f1ee16c92e59ae8936631e4e6d489194edad83fdfe316240c40ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 032ad826d862ae97d42e9ab573ce72ff00d985c3492931513b3de411e431ed08e5a6e0ea7e63d555c85c0d338b13c78907c584835ef9e9ed961f7141682a03e3
|
7
|
+
data.tar.gz: 6be6169070b182d3f54d254c81aa53391f49bee00d45e3d9a0c6fca6b08e0299c84ae714635793366dbfe93b4a5703ccf78271fe1450de66cd84b84a041ded21
|
data/exe/lbhrr
CHANGED
@@ -100,24 +100,64 @@ class LbhrrCLI < Thor
|
|
100
100
|
YAML.dump(example_global_config)
|
101
101
|
end
|
102
102
|
|
103
|
-
def create_run_file
|
104
|
-
run_file_path = File.join(Dir.pwd, "exe", "run")
|
105
|
-
run_file_content = "#!/bin/sh\n HARBR_ENV=$2 bundle exec puma -p $1"
|
106
|
-
exe_directory = File.join(Dir.pwd, "exe")
|
103
|
+
def create_run_file(type)
|
107
104
|
|
108
|
-
|
109
|
-
|
110
|
-
|
105
|
+
service_content = <<-RUBY
|
106
|
+
#!/usr/bin/env ruby
|
107
|
+
require 'bundler/inline'
|
108
|
+
|
109
|
+
gemfile do
|
110
|
+
source 'https://rubygems.org'
|
111
|
+
#gem 'kafkr', require: true
|
112
|
+
end
|
113
|
+
|
114
|
+
puts 'Gems installed and loaded!'
|
115
|
+
|
116
|
+
loop do
|
117
|
+
puts 'ok!'
|
118
|
+
sleep 1
|
119
|
+
end
|
120
|
+
|
121
|
+
RUBY
|
122
|
+
|
123
|
+
if type == "web"
|
124
|
+
run_file_path = File.join(Dir.pwd, "exe", "run")
|
125
|
+
web_run_file_content = "#!/bin/sh\n HARBR_ENV=$2 bundle exec puma -p $1"
|
126
|
+
exe_directory = File.join(Dir.pwd, "exe")
|
127
|
+
|
128
|
+
Dir.mkdir(exe_directory) unless Dir.exist?(exe_directory)
|
129
|
+
File.write(run_file_path, web_run_file_content)
|
130
|
+
File.chmod(0o755, run_file_path) # Set executable permission
|
131
|
+
puts "Created ./exe/run file."
|
132
|
+
end
|
133
|
+
|
134
|
+
if type == "service"
|
135
|
+
run_file_path = File.join(Dir.pwd, "exe", "run")
|
136
|
+
service_run_file_content = "#!/bin/sh\n HARBR_ENV=$2 ruby service"
|
137
|
+
exe_directory = File.join(Dir.pwd, "exe")
|
138
|
+
|
139
|
+
Dir.mkdir(exe_directory) unless Dir.exist?(exe_directory)
|
140
|
+
File.write(run_file_path, service_run_file_content)
|
141
|
+
File.chmod(0o755, run_file_path) # Set executable permission
|
142
|
+
puts "Created ./exe/run file."
|
143
|
+
|
144
|
+
File.write("service", service_content)
|
145
|
+
File.chmod(0o755, "service") # Set executable permission
|
146
|
+
puts "Created ./service file."
|
147
|
+
|
148
|
+
end
|
149
|
+
|
150
|
+
|
111
151
|
|
112
|
-
puts "Created ./exe/run file."
|
113
152
|
rescue => e
|
114
153
|
puts "Error creating ./exe/run file: #{e.message}"
|
115
154
|
end
|
116
155
|
|
117
|
-
def create_example_local_config
|
156
|
+
def create_example_local_config(type)
|
118
157
|
example_local_config = {
|
119
158
|
"name" => File.basename(Dir.pwd),
|
120
159
|
"version" => "0",
|
160
|
+
"type" => type,
|
121
161
|
"port" => "#{File.basename(Dir.pwd)}.app",
|
122
162
|
"host" => "#{File.basename(Dir.pwd)}.harbr.zero2one.ee"
|
123
163
|
}
|
@@ -162,17 +202,19 @@ class LbhrrCLI < Thor
|
|
162
202
|
end
|
163
203
|
|
164
204
|
desc "init", "Initialize project with .gitignore"
|
205
|
+
method_option :type, type: :string, enum: ['web', 'service'], default: 'web', desc: "Specify the type of process"
|
165
206
|
def init
|
166
207
|
local_config_path = File.join(Dir.pwd, "config", "manifest.yml")
|
167
208
|
|
168
209
|
unless File.exist?(local_config_path)
|
169
210
|
FileUtils.mkdir_p(File.dirname(local_config_path)) unless Dir.exist?(File.dirname(local_config_path))
|
170
|
-
File.write(local_config_path, create_example_local_config)
|
211
|
+
File.write(local_config_path, create_example_local_config(options[:type]))
|
171
212
|
end
|
172
213
|
# Load and merge configurations
|
173
214
|
local_config = YAML.load_file(local_config_path) || {}
|
174
215
|
create_gitignore
|
175
|
-
create_run_file
|
216
|
+
create_run_file(options[:type])
|
217
|
+
|
176
218
|
|
177
219
|
|
178
220
|
# Include other initialization tasks if necessary
|
@@ -208,8 +250,8 @@ class LbhrrCLI < Thor
|
|
208
250
|
puts "App #{name} has been successfully destroyed."
|
209
251
|
end
|
210
252
|
|
211
|
-
desc "
|
212
|
-
def
|
253
|
+
desc "lift", "Deploy an application using the configuration from config/manifest.yml to next"
|
254
|
+
def lift
|
213
255
|
if manifest?
|
214
256
|
|
215
257
|
package
|
@@ -295,7 +337,7 @@ class LbhrrCLI < Thor
|
|
295
337
|
end
|
296
338
|
|
297
339
|
|
298
|
-
desc "hoist", "Deploy an application using the configuration from config/manifest.yml to
|
340
|
+
desc "hoist", "Deploy an application using the configuration from config/manifest.yml to live"
|
299
341
|
def hoist(name=nil)
|
300
342
|
config = load_configuration
|
301
343
|
host = config["host"]
|
data/lib/lbhrr/version.rb
CHANGED