mr-shipper 0.0.3 → 0.0.4
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/bin/ship +1 -2
- data/lib/shipper/deploy.rb +2 -2
- data/lib/shipper/host.rb +6 -4
- data/lib/shipper/run.rb +26 -0
- data/lib/shipper.rb +1 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d8bafba34011cd5cae3f192c1295fe9000a7e7fef372e87dff5d5aa9ddc3e87
|
4
|
+
data.tar.gz: 037550c907e063a829f97b66a039a1fda746c500572c07728c6e2c8c7ebe156c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 905efb0a06fb836bbee45683da2a0c7c5d13a3f21b48ff9b1036865201536548b10f95c5615f6091e95c552e8fb4f0b5aac3d0f456c27eb05210b1b593cee526
|
7
|
+
data.tar.gz: c84bbf53143af3e6272e1e10f4f047ce3c92e9c37d7d4cd00f91e9c471acf39551ca77f1fa194405ed0f5afaf7e34f95aa654a89631bbe6594d772566cff7b65
|
data/bin/ship
CHANGED
data/lib/shipper/deploy.rb
CHANGED
@@ -4,9 +4,9 @@ module Shipper
|
|
4
4
|
class Deploy
|
5
5
|
attr_reader :config, :specified_services
|
6
6
|
|
7
|
-
def initialize(specified_services = nil)
|
7
|
+
def initialize(config, specified_services = nil)
|
8
|
+
@config = config
|
8
9
|
@specified_services = specified_services
|
9
|
-
@config = Shipper::Config.instance
|
10
10
|
end
|
11
11
|
|
12
12
|
def perform
|
data/lib/shipper/host.rb
CHANGED
@@ -2,22 +2,24 @@
|
|
2
2
|
|
3
3
|
module Shipper
|
4
4
|
class Host
|
5
|
-
attr_accessor :
|
5
|
+
attr_accessor :user, :host, :location, :executor
|
6
6
|
|
7
7
|
def initialize(options)
|
8
|
-
@
|
8
|
+
@user, @host = options['ssh_entry'].split('@')
|
9
9
|
@location = options['location']
|
10
10
|
@executor = nil
|
11
11
|
end
|
12
12
|
|
13
13
|
def update!
|
14
|
-
|
14
|
+
restart!(pull_changes: true)
|
15
|
+
end
|
15
16
|
|
17
|
+
def restart!(pull_changes: false)
|
16
18
|
::Net::SSH.start(host, user) do |ssh|
|
17
19
|
load_executor(ssh)
|
18
20
|
|
19
21
|
executor.cd location
|
20
|
-
exec 'docker-compose pull'
|
22
|
+
exec 'docker-compose pull' if pull_changes
|
21
23
|
exec 'docker-compose down'
|
22
24
|
exec 'docker-compose up -d'
|
23
25
|
end
|
data/lib/shipper/run.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Shipper
|
4
|
+
class Run
|
5
|
+
attr_reader :config, :options
|
6
|
+
|
7
|
+
def initialize(options)
|
8
|
+
@options = options.empty? ? nil : options
|
9
|
+
@config = ::Shipper::Config.instance
|
10
|
+
end
|
11
|
+
|
12
|
+
def perform
|
13
|
+
if restart?
|
14
|
+
::Shipper::Host.new(config.host).restart!
|
15
|
+
else
|
16
|
+
::Shipper::Deploy.new(config, options).perform
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def restart?
|
23
|
+
options&.size == 1 && options[0] == 'restart'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/shipper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mr-shipper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rostyslav Safonov
|
@@ -52,13 +52,14 @@ files:
|
|
52
52
|
- lib/shipper/executor.rb
|
53
53
|
- lib/shipper/host.rb
|
54
54
|
- lib/shipper/logger.rb
|
55
|
+
- lib/shipper/run.rb
|
55
56
|
- lib/shipper/service.rb
|
56
57
|
homepage: https://rubygemspecs.org/gems/mr-shipper
|
57
58
|
licenses:
|
58
59
|
- MIT
|
59
60
|
metadata:
|
60
|
-
source_code_uri: https://github.com/elhowm/shipper
|
61
|
-
documentation_uri: https://github.com/elhowm/shipper
|
61
|
+
source_code_uri: https://github.com/elhowm/mr-shipper
|
62
|
+
documentation_uri: https://github.com/elhowm/mr-shipper
|
62
63
|
post_install_message:
|
63
64
|
rdoc_options: []
|
64
65
|
require_paths:
|
@@ -74,8 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
75
|
- !ruby/object:Gem::Version
|
75
76
|
version: '0'
|
76
77
|
requirements: []
|
77
|
-
|
78
|
-
rubygems_version: 2.7.9
|
78
|
+
rubygems_version: 3.0.3
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Docker shipping
|