gearship 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gearship.gemspec +1 -1
- data/lib/gearship/cli.rb +44 -21
- data/lib/templates/actions/install_docker.sh +9 -7
- data/lib/templates/actions/{pull_latest_image.sh → login_docker.sh} +0 -1
- data/lib/templates/actions/pull_image.sh +1 -0
- data/lib/templates/actions/start_container.sh +0 -1
- data/lib/templates/gearship.sh +0 -11
- data/lib/templates/gearship.yml +1 -1
- data/lib/templates/missions/install_container.sh +2 -1
- data/lib/templates/missions/install_locally.sh +2 -0
- data/lib/templates/missions/update_container.sh +2 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86d96d296139d8b354fe5a40c6f624d118de218f
|
4
|
+
data.tar.gz: 909431af40628e676297513b34dbe52edd7fc76c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f89420895ffaf548b45c05e94a84ac462a77066bc81550811700f4e4c0ede9976ad67b3ca143fef9e308d44526513c431772c1e90b1f31319a799558e07a6109
|
7
|
+
data.tar.gz: 58581cc785ab37a3e2b579559e52d2cc9112c11fdfa2da7c4c4b295244a23de1c79d6aea21baf0a5435f5bc9b0a80e5abc155911c7d0ef32f088a4427217af4f
|
data/gearship.gemspec
CHANGED
data/lib/gearship/cli.rb
CHANGED
@@ -7,14 +7,20 @@ module Gearship
|
|
7
7
|
include Thor::Actions
|
8
8
|
|
9
9
|
desc 'init', 'Initialize gearship project'
|
10
|
-
def init
|
11
|
-
init!(
|
10
|
+
def init
|
11
|
+
init!('gearship')
|
12
12
|
end
|
13
13
|
|
14
14
|
desc 'go [mission] [--sudo]', 'Send gearship on a mission with ssh.'
|
15
15
|
method_options :sudo => false
|
16
|
-
def go(
|
17
|
-
go!(
|
16
|
+
def go(mission, *args)
|
17
|
+
go!(mission, *args)
|
18
|
+
end
|
19
|
+
|
20
|
+
desc 'local [mission] [--sudo]', 'Send gearship on a local mission.'
|
21
|
+
method_options :sudo => false
|
22
|
+
def local(mission, *args)
|
23
|
+
local!(mission, *args)
|
18
24
|
end
|
19
25
|
|
20
26
|
desc 'compile', 'Compile gearship project for debugging'
|
@@ -30,23 +36,24 @@ module Gearship
|
|
30
36
|
end
|
31
37
|
|
32
38
|
def init!(project)
|
33
|
-
copy_file 'templates/.dockerignore',
|
34
|
-
copy_file 'templates/.gitignore',
|
35
|
-
copy_file 'templates/gearship.yml',
|
36
|
-
copy_file 'templates/gearship.sh',
|
39
|
+
copy_file 'templates/.dockerignore', ".dockerignore"
|
40
|
+
copy_file 'templates/.gitignore', "gearship/.gitignore"
|
41
|
+
copy_file 'templates/gearship.yml', "gearship/gearship.yml"
|
42
|
+
copy_file 'templates/gearship.sh', "gearship/gearship.sh"
|
37
43
|
|
38
|
-
copy_file 'templates/actions/configure_firewall.sh',
|
39
|
-
copy_file 'templates/actions/install_basics.sh',
|
40
|
-
copy_file 'templates/actions/install_docker.sh',
|
41
|
-
copy_file 'templates/actions/
|
42
|
-
copy_file 'templates/actions/
|
43
|
-
copy_file 'templates/actions/
|
44
|
+
copy_file 'templates/actions/configure_firewall.sh', "gearship/actions/configure_firewall.sh"
|
45
|
+
copy_file 'templates/actions/install_basics.sh', "gearship/actions/install_basics.sh"
|
46
|
+
copy_file 'templates/actions/install_docker.sh', "gearship/actions/install_docker.sh"
|
47
|
+
copy_file 'templates/actions/login_docker.sh', "gearship/actions/login_docker.sh"
|
48
|
+
copy_file 'templates/actions/pull_image.sh', "gearship/actions/pull_image.sh"
|
49
|
+
copy_file 'templates/actions/remove_container.sh', "gearship/actions/remove_container.sh"
|
50
|
+
copy_file 'templates/actions/start_container.sh', "gearship/actions/start_container.sh"
|
44
51
|
|
45
|
-
copy_file 'templates/missions/install_container.sh',
|
46
|
-
copy_file 'templates/missions/setup_host.sh',
|
47
|
-
copy_file 'templates/missions/update_container.sh',
|
52
|
+
copy_file 'templates/missions/install_container.sh', "gearship/missions/install_container.sh"
|
53
|
+
copy_file 'templates/missions/setup_host.sh', "gearship/missions/setup_host.sh"
|
54
|
+
copy_file 'templates/missions/update_container.sh', "gearship/missions/update_container.sh"
|
48
55
|
|
49
|
-
copy_file 'templates/cargo/sample.conf',
|
56
|
+
copy_file 'templates/cargo/sample.conf', "gearship/cargo/sample.conf"
|
50
57
|
end
|
51
58
|
|
52
59
|
def go!(*args)
|
@@ -56,10 +63,10 @@ module Gearship
|
|
56
63
|
|
57
64
|
if mission.include? 'local'
|
58
65
|
local_commands = <<-EOS
|
59
|
-
|
66
|
+
cd compiled
|
67
|
+
#{sudo}bash gearship.sh
|
60
68
|
EOS
|
61
69
|
else
|
62
|
-
|
63
70
|
user, host, port = parse_target(@config['attributes']['ssh_target'])
|
64
71
|
endpoint = "#{user}@#{host}"
|
65
72
|
|
@@ -82,6 +89,23 @@ module Gearship
|
|
82
89
|
EOS
|
83
90
|
end
|
84
91
|
|
92
|
+
execute(local_commands)
|
93
|
+
end
|
94
|
+
|
95
|
+
def local!(*args)
|
96
|
+
mission = args[0]
|
97
|
+
compile!(mission)
|
98
|
+
sudo = 'sudo ' if options.sudo?
|
99
|
+
|
100
|
+
local_commands = <<-EOS
|
101
|
+
cd compiled
|
102
|
+
#{sudo}bash gearship.sh
|
103
|
+
EOS
|
104
|
+
|
105
|
+
execute(local_commands)
|
106
|
+
end
|
107
|
+
|
108
|
+
def execute(local_commands)
|
85
109
|
Open3.popen3(local_commands) do |stdin, stdout, stderr|
|
86
110
|
stdin.close
|
87
111
|
t = Thread.new do
|
@@ -95,7 +119,6 @@ module Gearship
|
|
95
119
|
t.join
|
96
120
|
end
|
97
121
|
end
|
98
|
-
|
99
122
|
|
100
123
|
def compile!(mission)
|
101
124
|
abort_with 'You must be in the gearship folder' unless File.exists?('gearship.yml')
|
@@ -1,12 +1,14 @@
|
|
1
1
|
if gearship.install "docker-ce"; then
|
2
|
-
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
|
3
|
-
|
4
|
-
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
|
5
|
-
|
6
2
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
7
|
-
|
8
3
|
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
9
|
-
|
10
4
|
sudo apt-get update
|
11
|
-
|
5
|
+
|
6
|
+
sudo apt-get install -y linux-image-extra-$(uname -r) \
|
7
|
+
linux-image-extra-virtual \
|
8
|
+
apt-transport-https \
|
9
|
+
ca-certificates \
|
10
|
+
software-properties-common \
|
11
|
+
docker-ce
|
12
|
+
|
13
|
+
|
12
14
|
fi
|
@@ -0,0 +1 @@
|
|
1
|
+
docker pull <%= @attributes.container_repo %>
|
data/lib/templates/gearship.sh
CHANGED
@@ -38,15 +38,4 @@ echo "
|
|
38
38
|
| (_ |/ -_)/ _\` || '_|(_-<| ' \ | || '_ \\
|
39
39
|
\___|\___|\__,_||_| /__/|_||_||_|| .__/
|
40
40
|
|_|
|
41
|
-
|
42
|
-
___ _ _ __ _
|
43
|
-
/ _ \| ' \ / _\` |
|
44
|
-
\___/|_||_| \__,_|
|
45
|
-
|
46
|
-
_ _ _
|
47
|
-
_ __ (_) ___ ___(_) ___ _ _ | |
|
48
|
-
| ' \ | |(_-<(_-<| |/ _ \| ' \ |_|
|
49
|
-
|_|_|_||_|/__//__/|_|\___/|_||_|(_)
|
50
|
-
|
51
|
-
|
52
41
|
"
|
data/lib/templates/gearship.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gearship
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -77,13 +77,15 @@ files:
|
|
77
77
|
- lib/templates/actions/configure_firewall.sh
|
78
78
|
- lib/templates/actions/install_basics.sh
|
79
79
|
- lib/templates/actions/install_docker.sh
|
80
|
-
- lib/templates/actions/
|
80
|
+
- lib/templates/actions/login_docker.sh
|
81
|
+
- lib/templates/actions/pull_image.sh
|
81
82
|
- lib/templates/actions/remove_container.sh
|
82
83
|
- lib/templates/actions/start_container.sh
|
83
84
|
- lib/templates/cargo/sample.conf
|
84
85
|
- lib/templates/gearship.sh
|
85
86
|
- lib/templates/gearship.yml
|
86
87
|
- lib/templates/missions/install_container.sh
|
88
|
+
- lib/templates/missions/install_locally.sh
|
87
89
|
- lib/templates/missions/setup_host.sh
|
88
90
|
- lib/templates/missions/update_container.sh
|
89
91
|
homepage: http://github.com/leonas/gearship
|