lbhrr 1.0.0 → 1.0.6
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/exe/lbhrr +16 -21
- data/lib/lbhrr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14f484333308696cc1f728428f328b3c8330b466ddd7dabbcf0bfe7bf61f22fb
|
4
|
+
data.tar.gz: b0b574e3cc24289433bf65f312812732615f8e62045b2c31e84068a38eaeb0c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f861df26bfb215ecfa3adff8fabb2887df18dfd70dfe7f6ab5abf5dbda58419554db12ac3dfb067ae5849a49f52122504d2688afdcf7fa056b5237ee3f563c3b
|
7
|
+
data.tar.gz: 3eac4bdf9442f160a75c8e6a22e8e28169d7c0b14c71572a1361d1c6d6cbabaf18d96a37caa0b0f6f69c80e5e3d169036c33d6f8102ce05a133edf05f4f367dd
|
data/exe/lbhrr
CHANGED
@@ -77,6 +77,7 @@ class LbhrrCLI < Thor
|
|
77
77
|
|
78
78
|
def create_example_local_config
|
79
79
|
example_local_config = {
|
80
|
+
'name' => File.basename(Dir.pwd),
|
80
81
|
'version' => '0',
|
81
82
|
'host' => "#{File.basename(Dir.pwd)}.harbr.zero2one.ee'"
|
82
83
|
}
|
@@ -166,7 +167,6 @@ class LbhrrCLI < Thor
|
|
166
167
|
end
|
167
168
|
|
168
169
|
|
169
|
-
|
170
170
|
desc "deploy", "Deploy an application using the configuration from config/manifest.yml"
|
171
171
|
def deploy
|
172
172
|
begin
|
@@ -187,37 +187,32 @@ class LbhrrCLI < Thor
|
|
187
187
|
basename = File.basename(Dir.pwd)
|
188
188
|
base_directory = "/var/harbr/#{basename}"
|
189
189
|
versions_directory = "#{base_directory}/versions"
|
190
|
-
previous_version_path = "#{versions_directory}/#{version - 1}"
|
191
190
|
destination_path = "#{versions_directory}/#{version}"
|
192
191
|
current_path = "#{base_directory}/current"
|
193
192
|
|
194
193
|
# Check and create the versions directory on the server
|
195
194
|
system("ssh #{user}@#{host} 'mkdir -p #{versions_directory}'")
|
196
195
|
|
197
|
-
#
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
deployed(version)
|
212
|
-
else
|
213
|
-
puts "Failed to deploy application version #{version} to #{host}"
|
214
|
-
end
|
196
|
+
# Prepare the rsync exclude option using .gitignore
|
197
|
+
gitignore_path = File.join(Dir.pwd, '.gitignore')
|
198
|
+
exclude_option = File.exist?(gitignore_path) ? "--exclude='.git' --exclude-from='#{gitignore_path}'" : ""
|
199
|
+
|
200
|
+
# Rsync files to the new version directory, excluding files as per .gitignore
|
201
|
+
rsync_command = "rsync -avz #{exclude_option} ./ #{user}@#{host}:#{destination_path}"
|
202
|
+
|
203
|
+
if system(rsync_command) &&
|
204
|
+
system("ssh #{user}@#{host} 'ln -sfn #{destination_path} #{current_path}'")
|
205
|
+
puts "Successfully deployed application version #{version} to #{host}"
|
206
|
+
increment_version(local_manifest_path, version)
|
207
|
+
deployed(version)
|
208
|
+
else
|
209
|
+
puts "Failed to deploy application version #{version} to #{host}"
|
215
210
|
end
|
216
211
|
rescue => e
|
217
212
|
puts "Deployment error: #{e.message}"
|
218
213
|
end
|
219
214
|
end
|
220
|
-
|
215
|
+
|
221
216
|
|
222
217
|
end
|
223
218
|
|
data/lib/lbhrr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lbhrr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delaney Kuldvee Burke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|