sct 1.0.0 → 1.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c949eeff7191cb2699ed0ed1ba26559d7a47ca5111e154204b4e1da42356069
|
4
|
+
data.tar.gz: 7c021037a4e3fc764d011e7d2e76024344a6a2b3e05672de4bc5dc0cad985042
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9022840b61e7414056aef611325122d8c4e1c1dce4c370f99d2b67d5ddda35b9e395444ffc6b7d79b01d530d40117cfc08159148b276263d9b8958cce488e8c5
|
7
|
+
data.tar.gz: d5f967cd37ad3447f3566051894195b08ecda28773a95a9bdecc7f61bbb59efc339d6541c826b1f5a0efd6e06bc3519e1d1cce32c096b784ca1ad4518f71e0c3
|
@@ -63,15 +63,6 @@ module Cluster
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
command :pull do |c|
|
67
|
-
c.syntax = 'sct cluster pull'
|
68
|
-
c.description = 'pull new image versions'
|
69
|
-
|
70
|
-
c.action do |args, options|
|
71
|
-
Cluster::Runner.new.pull
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
66
|
command :status do |c|
|
76
67
|
c.syntax = 'sct cluster status'
|
77
68
|
c.description = 'see the status of your cluster'
|
data/sct/lib/sct/commands/dev.rb
CHANGED
@@ -3,24 +3,34 @@ require 'yaml'
|
|
3
3
|
module Sct
|
4
4
|
class DevCommand
|
5
5
|
|
6
|
+
@@file = "docker-compose.dev.yml"
|
7
|
+
|
6
8
|
def error message
|
7
9
|
UI.error message
|
8
10
|
exit 1
|
9
11
|
end
|
10
12
|
|
11
|
-
def
|
12
|
-
|
13
|
+
def dc command
|
14
|
+
system "docker-compose -f ~/development/spend-cloud/docker-compose.yml #{command}"
|
15
|
+
end
|
13
16
|
|
14
|
-
|
15
|
-
|
17
|
+
def local_dc command
|
18
|
+
system "docker-compose -f #{@@file} #{command}"
|
19
|
+
end
|
20
|
+
|
21
|
+
def manifest
|
22
|
+
if !File.exist? @@file
|
23
|
+
error "Could not find file '#{@@file}'."
|
16
24
|
end
|
17
25
|
|
18
|
-
|
26
|
+
YAML.load File.read @@file
|
27
|
+
end
|
19
28
|
|
29
|
+
def execute args, options
|
20
30
|
services = manifest["services"].to_a
|
21
31
|
|
22
32
|
if services.length != 1
|
23
|
-
error "Currently sct only supports a single service declaration in '#{file}'. Contact the infra guild if you consider this a limitation."
|
33
|
+
error "Currently sct only supports a single service declaration in '#{@@file}'. Contact the infra guild if you consider this a limitation."
|
24
34
|
end
|
25
35
|
|
26
36
|
service, service_spec = services.first
|
@@ -28,15 +38,23 @@ module Sct
|
|
28
38
|
container = service_spec["container_name"]
|
29
39
|
command = service_spec["command"] || ""
|
30
40
|
|
41
|
+
if options.pull
|
42
|
+
return unless local_dc "pull"
|
43
|
+
end
|
44
|
+
|
31
45
|
if options.build
|
32
|
-
return unless
|
46
|
+
return unless local_dc "build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) #{options.pull ? "--pull" : ""}"
|
47
|
+
end
|
48
|
+
|
49
|
+
if options.pull or options.build
|
50
|
+
system "docker image prune -f"
|
33
51
|
end
|
34
52
|
|
35
|
-
return unless
|
53
|
+
return unless dc "rm --stop --force #{service}"
|
36
54
|
|
37
|
-
|
55
|
+
local_dc "run --rm --service-ports --name #{container} #{service} #{command}"
|
38
56
|
|
39
|
-
|
57
|
+
dc "up --detach #{service}"
|
40
58
|
end
|
41
59
|
|
42
60
|
end
|
@@ -40,8 +40,8 @@ module Sct
|
|
40
40
|
command :'dev' do |c|
|
41
41
|
c.syntax = 'sct dev'
|
42
42
|
c.description = 'start development container in the current directory'
|
43
|
-
c.option '--build', '(re)build
|
44
|
-
c.option '--pull', 'pull latest
|
43
|
+
c.option '--build', '(re)build images before starting'
|
44
|
+
c.option '--pull', 'pull latest images before starting'
|
45
45
|
|
46
46
|
c.action do |args, options|
|
47
47
|
Sct::DevCommand.new.execute args, options
|
data/sct/lib/sct/version.rb
CHANGED
data/shell/lib/shell/runner.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reshad Farid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|
@@ -237,10 +237,10 @@ metadata:
|
|
237
237
|
post_install_message:
|
238
238
|
rdoc_options: []
|
239
239
|
require_paths:
|
240
|
+
- shell/lib
|
240
241
|
- cluster/lib
|
241
242
|
- sct/lib
|
242
243
|
- sct_core/lib
|
243
|
-
- shell/lib
|
244
244
|
required_ruby_version: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
246
|
- - ">="
|