gsd-cli 0.1.36 → 0.1.37
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/lib/cli/install.rb +8 -5
- data/lib/cli/update.rb +19 -0
- data/lib/cli.rb +1 -1
- data/lib/helpers.rb +19 -0
- 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: fb2a7ef9ed40017c0d6cab79fb2c434989ac1dc4e6ab027904aafcc01281ac5b
|
4
|
+
data.tar.gz: 6ccd788aa9310e88992ba6ec4a111bd539401aa28415e932b864711573909971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c55390d49d52801d978d2036692f0ec2ce04c3da9253ae64c49a8307d361fb8030451f83b15d5d954f72a814a694e17ef8f7ea9df455d53c4ed7ad5c8709577
|
7
|
+
data.tar.gz: e98b4fa209ea41423b92e0c80a0b4df1aa8d39f0f5fd742f467b055e2e6d9c678022f361a1fb79b097a9f4df17cf1d748cb6cd4979e121739052ac2ef75c33dd
|
data/lib/cli/install.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require "commander/import"
|
4
4
|
require "game_template"
|
5
5
|
require "cli/game_hash"
|
6
|
+
require "helpers"
|
6
7
|
|
7
8
|
command :install do |c|
|
8
9
|
c.syntax = "gsd install [args] [options]"
|
@@ -18,7 +19,7 @@ command :install do |c|
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def install(game, path, steam_user, steam_password)
|
21
|
-
puts "Beginning installation process. This may take a while...".
|
22
|
+
puts "Beginning installation process. This may take a while...".blue
|
22
23
|
install_path = if path.nil?
|
23
24
|
puts "Install path was not provided: defaulting to /opt/#{game.name}".yellow
|
24
25
|
"/opt/#{game.name}"
|
@@ -30,8 +31,10 @@ def install(game, path, steam_user, steam_password)
|
|
30
31
|
else
|
31
32
|
"+login #{steam_user} #{steam_password}"
|
32
33
|
end
|
33
|
-
system("rm -f #{"/tmp/#{
|
34
|
-
system("rm -f /etc/systemd/system/#{
|
35
|
-
GameTemplate.new(game)
|
36
|
-
|
34
|
+
system("rm -f #{"/tmp/#{game.name}.service"}")
|
35
|
+
system("rm -f /etc/systemd/system/#{game.name}.service")
|
36
|
+
GameTemplate.new(game)
|
37
|
+
.install(Helpers.get_install_path(path, game.name),
|
38
|
+
Helpers.get_steamcmd_login(steam_user, steam_password))
|
39
|
+
puts "Server installation complete. Check the output for messages or warnings.".green
|
37
40
|
end
|
data/lib/cli/update.rb
CHANGED
@@ -14,4 +14,23 @@ command :update do |c|
|
|
14
14
|
c.action do |args, options|
|
15
15
|
GameTemplate.new(game_hash[args.first()], options.path).update(options.path)
|
16
16
|
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def update(game, path, steam_user, steam_password)
|
20
|
+
puts "Beginning installation process. This may take a while...".yellow
|
21
|
+
install_path = if path.nil?
|
22
|
+
puts "Install path was not provided: defaulting to /opt/#{game.name}".yellow
|
23
|
+
"/opt/#{game.name}"
|
24
|
+
else
|
25
|
+
path
|
26
|
+
end
|
27
|
+
steam_login = if steam_user.nil?
|
28
|
+
"+login anonymous"
|
29
|
+
else
|
30
|
+
"+login #{steam_user} #{steam_password}"
|
31
|
+
end
|
32
|
+
system("rm -f #{"/tmp/#{@game.name}.service"}")
|
33
|
+
system("rm -f /etc/systemd/system/#{@game.name}.service")
|
34
|
+
GameTemplate.new(game).install(install_path, steam_login)
|
35
|
+
puts "Server installation & deployment complete!".green
|
17
36
|
end
|
data/lib/cli.rb
CHANGED
data/lib/helpers.rb
CHANGED
@@ -14,4 +14,23 @@ module Helpers
|
|
14
14
|
false
|
15
15
|
end
|
16
16
|
end
|
17
|
+
|
18
|
+
def self.get_install_path(path, game)
|
19
|
+
install_path = if path.nil?
|
20
|
+
puts "Install path was not provided: defaulting to /opt/#{game}".yellow
|
21
|
+
"/opt/#{game}"
|
22
|
+
else
|
23
|
+
path
|
24
|
+
end
|
25
|
+
install_path
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.get_steamcmd_login(steam_user, steam_password)
|
29
|
+
steam_login = if steam_user.nil?
|
30
|
+
"+login anonymous"
|
31
|
+
else
|
32
|
+
"+login #{steam_user} #{steam_password}"
|
33
|
+
end
|
34
|
+
steam_login
|
35
|
+
end
|
17
36
|
end
|