potamus 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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/cli/run.rb +40 -0
- data/lib/potamus/config.rb +1 -1
- data/lib/potamus/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a3c4cf3b0362cd1fdf87c032bab56d64b80458f9478b6027f6a0403663aa79e
|
4
|
+
data.tar.gz: aa0e6f3aec232def467de7d43b5f98eb495d90fe57c89e11bcf054677562564b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/potamus/config.rb
CHANGED
data/lib/potamus/version.rb
CHANGED
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.
|
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-
|
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
|