sct 1.0.1 → 1.0.2

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: 6c949eeff7191cb2699ed0ed1ba26559d7a47ca5111e154204b4e1da42356069
4
- data.tar.gz: 7c021037a4e3fc764d011e7d2e76024344a6a2b3e05672de4bc5dc0cad985042
3
+ metadata.gz: ea8384d7d7c3ab04eb3d184f66953b6f4cc4ce7e669da1ce82533d8964fa2f3a
4
+ data.tar.gz: 45e6800f8369e921f19452c191f27c9ced727676923952590fc9af8ad9bad558
5
5
  SHA512:
6
- metadata.gz: 9022840b61e7414056aef611325122d8c4e1c1dce4c370f99d2b67d5ddda35b9e395444ffc6b7d79b01d530d40117cfc08159148b276263d9b8958cce488e8c5
7
- data.tar.gz: d5f967cd37ad3447f3566051894195b08ecda28773a95a9bdecc7f61bbb59efc339d6541c826b1f5a0efd6e06bc3519e1d1cce32c096b784ca1ad4518f71e0c3
6
+ metadata.gz: e87a61ac439d0e0737963d42bba9f81e0cb43b529fa78a6d1e638e56356760d050daa3fbb84dad74f8ba550277d2cd59a18434996d9cf04018ec21ba57776594
7
+ data.tar.gz: 8d0bd664311e72d1b980fb0485c90d3da29ce302f2d2045df76595ca0d9747811d4732fe70974c68d39aa3a9675338434cfcbbf3079335ed54e1b1a136d3830b
@@ -10,12 +10,12 @@ module Sct
10
10
  exit 1
11
11
  end
12
12
 
13
- def dc command
14
- system "docker-compose -f ~/development/spend-cloud/docker-compose.yml #{command}"
13
+ def dc command, env = {}
14
+ system env, "docker-compose #{command}"
15
15
  end
16
16
 
17
- def local_dc command
18
- system "docker-compose -f #{@@file} #{command}"
17
+ def dc_dev command, env = {}
18
+ dc "-f #{@@file} #{command}", env
19
19
  end
20
20
 
21
21
  def manifest
@@ -38,12 +38,14 @@ module Sct
38
38
  container = service_spec["container_name"]
39
39
  command = service_spec["command"] || ""
40
40
 
41
+ env = { "PUID" => `id -u`.chomp, "PGID" => `id -g`.chomp }
42
+
41
43
  if options.pull
42
- return unless local_dc "pull"
44
+ return unless dc_dev "pull"
43
45
  end
44
46
 
45
47
  if options.build
46
- return unless local_dc "build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) #{options.pull ? "--pull" : ""}"
48
+ return unless dc_dev "build #{options.pull ? "--pull" : ""}", env
47
49
  end
48
50
 
49
51
  if options.pull or options.build
@@ -52,7 +54,7 @@ module Sct
52
54
 
53
55
  return unless dc "rm --stop --force #{service}"
54
56
 
55
- local_dc "run --rm --service-ports --name #{container} #{service} #{command}"
57
+ dc_dev "run --rm --service-ports --name #{container} #{service} #{command}", env
56
58
 
57
59
  dc "up --detach #{service}"
58
60
  end
@@ -1,3 +1,3 @@
1
1
  module Sct
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
4
+ version: 1.0.2
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-25 00:00:00.000000000 Z
11
+ date: 2021-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored