lbhrr 1.0.24 → 1.0.27

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/lbhrr +56 -14
  3. data/lib/lbhrr/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd06f5b2b2c2ead4e766e8db02df61b8e698cbf9a45c96ab63724c74644114d6
4
- data.tar.gz: e2c15f6103ed1a0f4a1d9f356bb08ad7fdb8e7f6ac6245d27ef1eb0ee9c912be
3
+ metadata.gz: d9316b3555eea12d2403c4b53f2294a09652458267b803938f725667b27b1ac4
4
+ data.tar.gz: aecf3fa3443f1ee16c92e59ae8936631e4e6d489194edad83fdfe316240c40ae
5
5
  SHA512:
6
- metadata.gz: 5ed7d928a8b43c5930aff091d063589843daf4d4975bf0f08f983e28492d4abadd5560477637747bb81cf581605125f8b426dc18d6730de7e8191a7c56c70178
7
- data.tar.gz: 273804677d3c8e4bdb2916d9f5a09ea201a40ddc118c831c2942db69b81136f6fddf08c75980a818199beb5dc839f0769ddafd36ddf7f2bb8d74e973ff2d14d4
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
- Dir.mkdir(exe_directory) unless Dir.exist?(exe_directory)
109
- File.write(run_file_path, run_file_content)
110
- File.chmod(0o755, run_file_path) # Set executable permission
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 "raise", "Deploy an application using the configuration from config/manifest.yml to staging"
212
- def raise
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 production"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lbhrr
4
- VERSION = "1.0.24"
4
+ VERSION = "1.0.27"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lbhrr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.24
4
+ version: 1.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke