lbhrr 2.35.0 → 2.37.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9769f0f3caa1bb6fc176e9dd1f91d03332b1dc0af926823359a120c85655a45b
4
- data.tar.gz: 1394802e202084302003f6f84728b4b09acdb7ec32557827d3257aa27f2f1486
3
+ metadata.gz: 4eef3c61a2c26b9ed21dbcb220b7bad89e1a6ff319e73eb4a788dd7fdc644b7e
4
+ data.tar.gz: d5c893175d7195e35fd23b71344d34bebe3aa843299efb534f40f6d67ee8f70d
5
5
  SHA512:
6
- metadata.gz: 40c0d634d96ed343960cdbac4846c9fba941b05f5eb2b4738190c847501462ed1b79a5502ab030a30f54679fbb2d0885445ffc581a44d0dcf813ca895c62ef7b
7
- data.tar.gz: edb6bf13c274974985ad77eb5b5f9dcac51b90b26b3ca46e804c1d689b1af89d4a5d649566051bb916bfa47ad0cee1eb45e1a112af0c9c2acabc81a8fc319e9e
6
+ metadata.gz: 23763cabc8e0d6149b4d1dcaa5b58bfd0850363bac739a6d70144c75c28ab4b5bddf2acb2947118d0d982a6b0ed06b1a0196fb89e30b52c59fe537f8964be590
7
+ data.tar.gz: 1674ddf6156d6fd5ac91f70fbc3f3094470c9141d030839ed96b5f836c375ea2f1e079a899e91e6f8cca4655f16e6355ff1c37a591267a2db3fb2d6b185270cb
data/exe/lbhrr CHANGED
@@ -6,6 +6,7 @@ require "erb"
6
6
  require "open3"
7
7
  require "io/console"
8
8
  require_relative "../lib/lbhrr"
9
+ require "pathname"
9
10
 
10
11
  class LbhrrCLI < Thor
11
12
  include Thor::Actions
@@ -23,6 +24,10 @@ class LbhrrCLI < Thor
23
24
  [21,34,55][n]
24
25
  end
25
26
 
27
+ def source_path(gemname)
28
+ Pathname("/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/#{gemname}/src")
29
+ end
30
+
26
31
  def ok(url,grace: 1,skip: false)
27
32
 
28
33
  yield if block_given? if skip
@@ -301,7 +306,7 @@ class LbhrrCLI < Thor
301
306
  end
302
307
  end
303
308
 
304
-
309
+
305
310
 
306
311
  end
307
312
 
@@ -415,7 +420,7 @@ class LbhrrCLI < Thor
415
420
  if Dir.exist?("build")
416
421
  FileUtils.rm_r("build")
417
422
  end
418
-
423
+
419
424
  config = load_configuration
420
425
 
421
426
  msg =nil
@@ -452,6 +457,18 @@ class LbhrrCLI < Thor
452
457
  assemble "next", version
453
458
  `lxc file push -rp build/#{gem} #{name}/var/gems/`
454
459
  `lxc exec #{name} -- /root/.rbenv/shims/gem install /var/gems/#{gem} --no-document`
460
+
461
+ src = source_path(version)
462
+
463
+ `lxc exec #{name} -- rm -rf /var/www/app/container/next/`
464
+ `lxc exec #{name} -- rsync #{src} /var/www/app/container/next/`
465
+
466
+ `lxc exec #{name} -- [ -d '/var/www/app/container/data/live' ] && cp -rf /var/www/app/container/data/live/*.* /var/www/app/container/data/next`
467
+ puts "data synced! - OK"
468
+
469
+ `lxc exec #{name} -- [ -d '/var/www/app/container/uploads/live' ] && cp -rf /var/www/app/container/uploads/live/*.* /var/www/app/container/uploads/next`
470
+ puts "uploads synced! - OK"
471
+
455
472
  `lxc exec #{name} -- sv restart next`
456
473
  `lxc exec #{name} -- sv restart next.ws`
457
474
 
@@ -481,7 +498,7 @@ class LbhrrCLI < Thor
481
498
  puts "No deploymnt available"
482
499
  else
483
500
  `lxc exec #{name} -- bash -c 'if [ -d /var/www/app/container/rollback ]; then rm -rf /var/www/app/container/rollback; fi'`
484
- `lxc exec #{name} -- mv /var/www/app/container/live /var/www/app/container/rollback`
501
+ `lxc exec #{name} -- [ -d "/var/www/app/container/live" ] && mv /var/www/app/container/live /var/www/app/container/rollback`
485
502
  `lxc exec #{name} -- [ -d "/var/www/app/container/next" ] && cp -r /var/www/app/container/next /var/www/app/container/live`
486
503
  `lxc exec #{name} -- sv restart live`
487
504
  `lxc exec #{name} -- sv restart ws`
data/lib/lbhrr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lbhrr
4
- VERSION = "2.35.0"
4
+ VERSION = "2.37.0"
5
5
  end
data/lib/source.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "pathname"
2
+
3
+ dewwf source_path(gemname)
4
+ Pathname("/root/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/#{gemname}/src")
5
+ end
@@ -17,17 +17,7 @@ Gem.post_install do |installer|
17
17
  destination = File.join(installer.spec.metadata.dig("destination"), env)
18
18
  src = File.expand_path(File.join(File.dirname(__FILE__), '..', 'src'))
19
19
 
20
- if env == "live"
21
- puts "copy files to #{destination}"
22
- system("cp -rf #{src}/ #{destination}")
23
- else
24
- puts "copy files #{destination}"
25
- system("cp -rf #{src}/ #{destination}")
26
- system " [ -d '/var/www/app/container/data/live' ] && cp -rf /var/www/app/container/data/live/*.* /var/www/app/container/data/next"
27
- puts "data synced! - OK"
28
- system "[ -d '/var/www/app/container/uploads/live' ] && cp -rf /var/www/app/container/uploads/live/*.* /var/www/app/container/uploads/next"
29
- puts "uploads synced! - OK"
30
- end
20
+ system("cp -rf #{src}/ #{destination}")
31
21
 
32
22
  if File.exist?("#{destination}/bin/hoisted")
33
23
  system("chmod +x #{destination}/bin/hoisted")
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: 2.35.0
4
+ version: 2.37.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke
@@ -56,6 +56,7 @@ files:
56
56
  - lib/.kafkr/message_queue.txt
57
57
  - lib/lbhrr.rb
58
58
  - lib/lbhrr/version.rb
59
+ - lib/source.rb
59
60
  - sig/lbhrr.rbs
60
61
  - templates/lib/panamax.rb.erb
61
62
  - templates/lib/rubygems_plugin.rb.erb