dkc 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f1e4dd6d7d7c4fbb2040883b2e17429ad047c936f61bbe47f2e62ed4320617b
4
- data.tar.gz: fd3dd046e033bc58e1f638a4289c4cf31d324e80b12b2d8bddc47b088fcb62ee
3
+ metadata.gz: 44703aba826e32d7378042cb5c855d63673764f8cc27453ec395bd1de7cf45b8
4
+ data.tar.gz: 305767dac015d8d8b23821a2ce092c49e1de5ad8ba3f68f890023667dc1a9dc2
5
5
  SHA512:
6
- metadata.gz: 48ae41b255fd22f656c0a5680831011acce5ea9378c96eb85ae51c59d17be254cb08f3bcca82c22e0ae7c098f787646492cd9547093abcb446afa9a6ae010a57
7
- data.tar.gz: 51acf56917817cd88fd93a43726b5e39aa5919e7e6758cb908e6a04e9453c9789dac8faacff8475fb49b32ae783ccd04c6855c6dbe5af8ee24a992c4accff607
6
+ metadata.gz: 8aed7129c9b4f1597d3ca0d942d8d763bebdf39380a115165dfc5cf4c64d7641352ccdcdf1e600af7d8fb078b8445b8d035e467db8b90faa00b068233ba45ab0
7
+ data.tar.gz: c30fe8686948c3b0f0bb69e06c19fa050a743c0a53e41486943807ecd0be433aba87e976af016f4b50585967b433b5fbe2ed99f0618ef4992c49ade64b015e65
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dkc (0.1.0)
4
+ dkc (0.1.1)
5
5
  thor (~> 0.20)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Dkc
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dkc`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This gem was created to solve a specific problem. It exists to provide simple commands that are project specific, related to Docker and Docker Compose.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ The gem is very limited in functionality right now.
6
6
 
7
7
  ## Installation
8
8
 
data/lib/dkc/main.rb CHANGED
@@ -27,7 +27,67 @@ module Dkc
27
27
 
28
28
  rescue StandardError => e
29
29
  puts e.message
30
- return false
30
+ exit false
31
+ end
32
+
33
+ desc "down", "Stopping and removing containers"
34
+ def down
35
+ puts "Stopping and Removing Containers..."
36
+ unless Dkc::Config.instance.load
37
+ raise StandardError.new("ERROR: Could not load/parse #{CONFIG_FILE_NAME}")
38
+ end
39
+
40
+ if Dkc::Config.instance.getValue("usesCompose") == true && Dkc::Config.instance.getValue("customDown") == nil
41
+ run("docker-compose down")
42
+ end
43
+
44
+ if Dkc::Config.instance.getValue("usesCompose") == true && Dkc::Config.instance.getValue("customDown") != nil
45
+ run(Dkc::Config.instance.getValue("customDown"))
46
+ end
47
+
48
+ rescue StandardError => e
49
+ puts e.message
50
+ exit false
51
+ end
52
+
53
+ desc "start", "Start containers"
54
+ def start
55
+ puts "Starting Containers..."
56
+ unless Dkc::Config.instance.load
57
+ raise StandardError.new("ERROR: Could not load/parse #{CONFIG_FILE_NAME}")
58
+ end
59
+
60
+ if Dkc::Config.instance.getValue("usesCompose") == true && Dkc::Config.instance.getValue("customStart") == nil
61
+ run("docker-compose start")
62
+ end
63
+
64
+ if Dkc::Config.instance.getValue("usesCompose") == true && Dkc::Config.instance.getValue("customStart") != nil
65
+ run(Dkc::Config.instance.getValue("customStart"))
66
+ end
67
+
68
+ rescue StandardError => e
69
+ puts e.message
70
+ exit false
71
+ end
72
+
73
+ desc "stop", "Stop containers"
74
+ def stop
75
+ puts "Stopping Containers..."
76
+ unless Dkc::Config.instance.load
77
+ raise StandardError.new("ERROR: Could not load/parse #{CONFIG_FILE_NAME}")
78
+ end
79
+
80
+ if Dkc::Config.instance.getValue("usesCompose") == true && Dkc::Config.instance.getValue("customStop") == nil
81
+ run("docker-compose stop")
82
+ end
83
+
84
+ if Dkc::Config.instance.getValue("usesCompose") == true && Dkc::Config.instance.getValue("customStop") != nil
85
+ run(Dkc::Config.instance.getValue("customStop"))
86
+ end
87
+
88
+ rescue StandardError => e
89
+ puts e.message
90
+ exit false
31
91
  end
32
92
 
33
93
  desc "bash", "Start Bash on main container"
@@ -47,7 +107,7 @@ module Dkc
47
107
 
48
108
  rescue StandardError => e
49
109
  puts e.message
50
- return false
110
+ exit false
51
111
  end
52
112
  end
53
113
  end
data/lib/dkc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dkc
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dkc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Taylor Witte
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-31 00:00:00.000000000 Z
11
+ date: 2019-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor