fig-newton 0.1.0 → 0.2.0
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 +4 -4
- data/README.md +4 -0
- data/lib/fig-newton/app.rb +7 -0
- data/lib/fig-newton/cli.rb +11 -0
- data/lib/fig-newton/commands/clone.rb +1 -2
- data/lib/fig-newton/commands/down.rb +1 -1
- data/lib/fig-newton/commands/pull.rb +25 -0
- data/lib/fig-newton/commands/up.rb +1 -1
- data/lib/fig-newton/config.rb +4 -2
- data/lib/fig-newton/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ae9477373aa0ae005aced6fa37f28154a753330
|
4
|
+
data.tar.gz: 8280262e74e41764692e56b7bb1b10c2e8613abe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42f9469977f06ec0f42ecfb0c74750bb52aa85bc77c83552bc7d9b27449c7535e5b52cccb7c9037c40bc93e24a85d2874fb20cadc77aaf16f6041819b87772a6
|
7
|
+
data.tar.gz: 32d0360aab28d3244f897cd18af45a63627970372736300d35a89e5a9f88f0cc7169923fbc8e966509b0b0368200e8769e10bb982ef8ffde4c585c78d001eeac
|
data/README.md
CHANGED
@@ -33,3 +33,7 @@ Bring up all the applications defined for the given stack. Equivalent to running
|
|
33
33
|
### `down STACK_NAME`
|
34
34
|
|
35
35
|
Bring down all the applications defined for the given stack. Equivalent to running `fig down` in each application directory.
|
36
|
+
|
37
|
+
### `pull STACK_NAME`
|
38
|
+
|
39
|
+
Pull the latest code for all the repos defined for the given stack. Equivalent to running `git pull` in each application directory.
|
data/lib/fig-newton/app.rb
CHANGED
@@ -13,6 +13,13 @@ module FigNewton
|
|
13
13
|
`git clone #{full_repo} #{clone_directory} &>/dev/null`
|
14
14
|
end
|
15
15
|
|
16
|
+
def pull(parent_directory = ".")
|
17
|
+
source_directory = full_dir(parent_directory)
|
18
|
+
|
19
|
+
puts "-- Pulling latest upstream in '#{source_directory}'"
|
20
|
+
`cd #{source_directory} && git pull`
|
21
|
+
end
|
22
|
+
|
16
23
|
def up(parent_directory)
|
17
24
|
source_directory = full_dir(parent_directory)
|
18
25
|
|
data/lib/fig-newton/cli.rb
CHANGED
@@ -50,5 +50,16 @@ module FigNewton
|
|
50
50
|
command = FigNewton::Commands::Down.new(stack_name, options[:conf])
|
51
51
|
command.run(options[:parent_directory])
|
52
52
|
end
|
53
|
+
|
54
|
+
desc "pull STACK_NAME APP_NAME", "Pull the latest code for all (or one) of the repos defined for the given stack"
|
55
|
+
option :parent_directory, type: :string,
|
56
|
+
default: ".",
|
57
|
+
desc: "The parent directory of the cloned repositories",
|
58
|
+
aliases: ["p"]
|
59
|
+
def pull(stack_name, app = nil)
|
60
|
+
require "fig-newton/commands/pull"
|
61
|
+
command = FigNewton::Commands::Pull.new(stack_name, app, options[:conf])
|
62
|
+
command.run(options[:parent_directory])
|
63
|
+
end
|
53
64
|
end
|
54
65
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require "pp"
|
2
1
|
require "fig-newton/config"
|
3
2
|
|
4
3
|
module FigNewton
|
@@ -10,7 +9,7 @@ module FigNewton
|
|
10
9
|
end
|
11
10
|
|
12
11
|
def run(parent_directory)
|
13
|
-
config.apps.each { |app| app.clone(parent_directory) }
|
12
|
+
config.apps.each { |_, app| app.clone(parent_directory) }
|
14
13
|
end
|
15
14
|
|
16
15
|
private
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "fig-newton/config"
|
2
|
+
|
3
|
+
module FigNewton
|
4
|
+
module Commands
|
5
|
+
class Pull
|
6
|
+
def initialize(stack_name, app, config_dir)
|
7
|
+
@stack_name = stack_name
|
8
|
+
@app = app
|
9
|
+
@config = FigNewton::Config.from_file(File.join(config_dir, @stack_name))
|
10
|
+
end
|
11
|
+
|
12
|
+
def run(parent_directory)
|
13
|
+
if @app
|
14
|
+
config.apps[@app].pull(parent_directory)
|
15
|
+
else
|
16
|
+
config.apps.each { |_, app| app.pull(parent_directory) }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_accessor :config, :stack_name
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/fig-newton/config.rb
CHANGED
@@ -24,8 +24,10 @@ module FigNewton
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def apps
|
27
|
-
@apps ||= data["apps"].
|
28
|
-
|
27
|
+
@apps ||= data["apps"].each_with_object({}) do |app, apps|
|
28
|
+
name, config = app.flatten
|
29
|
+
apps[name] = FigNewton::App.new(name, config)
|
30
|
+
apps
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
data/lib/fig-newton/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fig-newton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Dunn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- lib/fig-newton/commands/clone.rb
|
74
74
|
- lib/fig-newton/commands/down.rb
|
75
75
|
- lib/fig-newton/commands/init.rb
|
76
|
+
- lib/fig-newton/commands/pull.rb
|
76
77
|
- lib/fig-newton/commands/up.rb
|
77
78
|
- lib/fig-newton/config.rb
|
78
79
|
- lib/fig-newton/version.rb
|