potamus 1.0.0 → 1.0.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: ef774d096cdfa91670f06115c3c0233c7ad5296f28d23eee290976f9793d3f63
4
- data.tar.gz: dcef9e958a1a7b024e759048589ab28942f3bc34368d5fed483b7bd4a3c92b5a
3
+ metadata.gz: 7a3c4cf3b0362cd1fdf87c032bab56d64b80458f9478b6027f6a0403663aa79e
4
+ data.tar.gz: aa0e6f3aec232def467de7d43b5f98eb495d90fe57c89e11bcf054677562564b
5
5
  SHA512:
6
- metadata.gz: d768688ba3aa593c9a178302c6fcbd541b3c24640748caabe62eb3ef3d403cc8db521d7523c99353730ce3e9b3b23a7120b079f71fbce961ca1e46f7a340b258
7
- data.tar.gz: 71217294b89051ae7f80205cb983d1e364491fc1cb8687cf01add351c3ab41e709dfb2a057c6fabf86210bfd14ae120e3450c1eb9b4b890413115a773d856d3f
6
+ metadata.gz: 47e7a8cdd7a87c94ee4f469879ef9974d4e2108b40addbc11efd675d06bcf5c2224a13a058c6dc76cf1fea77cae40713517425516c39531776eca21964670acd
7
+ data.tar.gz: 8187c07c7ac30b96739a48c9ca537be4575d3e6cd9e7080ddcb4c28abedd0530f0776127c3ddfb30233fe1ca38cdbc7cda914265f409bc8e6426d9d759903da6
checksums.yaml.gz.sig CHANGED
Binary file
data/cli/run.rb ADDED
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ command :run do
4
+ desc 'Run the image'
5
+
6
+ option '--test', 'Run in test mode' do |value, options|
7
+ options[:test] = true
8
+ end
9
+
10
+ option '-c [COMMAND]', '--command [COMMAND]', 'Specify the command to run' do |value, options|
11
+ options[:command] = value
12
+ end
13
+
14
+ action do |context|
15
+ require 'potamus/config'
16
+ require 'fileutils'
17
+ config = Potamus::Config.new(FileUtils.pwd)
18
+ if context.options[:test]
19
+ puts "\e[33mRunning in test mode...\e[0m"
20
+ config.test_mode!
21
+ end
22
+
23
+ unless context.options[:test]
24
+ unless config.git?
25
+ raise Error, "This directory containing your PotamusFile doesn't seem to be a git repository"
26
+ end
27
+
28
+ if config.dirty?
29
+ raise Error, "Working copy is dirty. Commit all changes before building."
30
+ end
31
+
32
+ unless config.pushed?
33
+ raise Error, "Your local commit does not match the commit on your remote repository. Have you pushed?"
34
+ end
35
+ end
36
+
37
+ command = context.options[:command] || "/bin/bash"
38
+ system("docker run -it --rm #{config.image_name_with_commit} #{command}")
39
+ end
40
+ end
@@ -24,7 +24,7 @@ module Potamus
24
24
  end
25
25
 
26
26
  def image_name
27
- @options['image_name'] || raise(Error, "image_name is required in the PotomusFile")
27
+ @options['image_name'] || raise(Error, "image_name is required in the PotamusFile")
28
28
  end
29
29
 
30
30
  def image_name_with_commit
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Potamus
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: potamus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
@@ -30,7 +30,7 @@ cert_chain:
30
30
  3wUJNGnT5XYq+qvTqmjkTSTfdGvZCM63C6bGdN5CAyMokGOOatGqyCMAONolWnfC
31
31
  gm3t2GWWrxY=
32
32
  -----END CERTIFICATE-----
33
- date: 2020-02-12 00:00:00.000000000 Z
33
+ date: 2020-02-20 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: swamp-cli
@@ -63,6 +63,7 @@ files:
63
63
  - bin/potamus
64
64
  - cli/build.rb
65
65
  - cli/help.rb
66
+ - cli/run.rb
66
67
  - lib/potamus.rb
67
68
  - lib/potamus/config.rb
68
69
  - lib/potamus/error.rb
metadata.gz.sig CHANGED
Binary file