blazing 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,22 @@
1
1
  ## master
2
2
 
3
- none
3
+ ...
4
+
5
+ ## 0.1.2 - October 25, 2011
6
+
7
+ * setup initializes an empty repository, so first push will work (#47)
8
+
9
+ * simplified cli workflow (#45):
10
+ * update runs update and setup:local
11
+ * setup:remote renamed to setup
12
+ * setup:remote also runs update
4
13
 
5
14
  ## 0.1.1 - October 25, 2011
6
15
 
7
- * [BUGFIX]: fix #48: dont bundle test and dev gems, do it quietly ([@effkay][])
8
- * [BUGFIX]: fix #44: accept target as argument ([@effkay][])
9
- * [BUGFIX]: fix #41: recipe gem loading issues resolved
10
- * [DOCS]: remove documentation of external recipes ([@effkay][])
16
+ * [BUG]: fix #48: dont bundle test and dev gems, do it quietly
17
+ * [BUG]: fix #44: accept target as argument
18
+ * [BUG]: fix #41: recipe gem loading issues resolved
19
+ * remove documentation of external recipes
11
20
 
12
21
  ## 0.1.0 - October 24, 2011
13
22
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blazing (0.1.1)
4
+ blazing (0.1.2)
5
5
  activesupport
6
6
  grit
7
7
  i18n
data/README.md CHANGED
@@ -8,7 +8,7 @@ Not everyone can or wants to deploy on heroku. But now you can have the same awe
8
8
 
9
9
  ## Quickstart
10
10
 
11
- `blazing init`, edit the configuration, run `blazing setup:local` and `blazing setup:remote <target>` and you're set. Deploy with `git push <target> <branch>` or setup git to always push your current branch.
11
+ `blazing init`, edit the configuration, run `blazing setup [target]` and you're set. Deploy with `git push <target> <branch>` or setup git to always push your current branch.
12
12
 
13
13
  ## Overview & Background
14
14
 
@@ -49,17 +49,13 @@ See the generated configuration file or [the template file](https://github.com/e
49
49
 
50
50
  ### Setup
51
51
 
52
- `blazing setup:local` will setup your local repository for deployment with blazing/git push. Basically, it will add a remote for each target you defined in the configuration file.
53
-
54
- `blazing setup:remote <target>` will setup the project on the server side. It will:
52
+ `blazing setup` will:
55
53
 
54
+ * setup your local repository for deployment with blazing/git push. Basically, it will add a remote for each target you defined in the configuration file.
56
55
  * clone the repository to the specified location
57
56
  * setup the repository to allow a currently checked out branch to be pushed to it
58
- * run ``blazing update``
59
-
60
- `blazing update <target>`
61
57
 
62
- Whenever you change something in your blazing config file you can run the update command so your git post-receive hook gets updated.
58
+ Whenever you change something in your blazing config file you can run the `update` command so your git post-receive hook and your git remotess get updated.
63
59
 
64
60
  ### Deploying
65
61
 
@@ -9,7 +9,7 @@ class Blazing::Runner
9
9
  def initialize(config = nil, target = nil)
10
10
  if config
11
11
  @config = config
12
- @target = @config.targets.find { |t| t.name == target.to_s } || @config.default_target
12
+ @target = @config.targets.find { |t| t.name.to_s == target } || @config.default_target
13
13
  end
14
14
  end
15
15
 
@@ -31,7 +31,7 @@ class Blazing::Runner
31
31
  end
32
32
  end
33
33
 
34
- def setup_local_command
34
+ def setup_git_remotes
35
35
  repository = Grit::Repo.new(Dir.pwd)
36
36
  @config.targets.each do |target|
37
37
  info("Adding new remote #{target.name} pointing to #{target.location}")
@@ -39,12 +39,14 @@ class Blazing::Runner
39
39
  end
40
40
  end
41
41
 
42
- def setup_remote_command
42
+ def setup_command
43
43
  @target.setup
44
+ update_command
44
45
  end
45
46
 
46
47
  def update_command
47
- @target.update
48
+ setup_git_remotes
49
+ @target.apply_hook
48
50
  end
49
51
 
50
52
  def recipes_run_command
@@ -13,11 +13,10 @@ class Blazing::Target
13
13
  end
14
14
 
15
15
  def setup
16
- @shell.run "ssh #{user}@#{host} '#{clone_repository} && #{setup_repository}'"
17
- self.update
16
+ @shell.run "ssh #{user}@#{host} '#{init_repository} && #{setup_repository}'"
18
17
  end
19
18
 
20
- def update
19
+ def apply_hook
21
20
  hook = ERB.new(File.read("#{Blazing::TEMPLATE_ROOT}/hook.erb")).result(binding)
22
21
 
23
22
  File.open(Blazing::TMP_HOOK, "wb") do |f|
@@ -42,8 +41,8 @@ class Blazing::Target
42
41
  user[1] unless user.nil?
43
42
  end
44
43
 
45
- def clone_repository
46
- "git clone #{@config.repository} #{path}"
44
+ def init_repository
45
+ "git init #{path}"
47
46
  end
48
47
 
49
48
  def copy_hook
@@ -1,3 +1,3 @@
1
1
  module Blazing
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -96,15 +96,15 @@ describe Blazing::Config do
96
96
  end
97
97
 
98
98
  it 'accepts a single recipe as argument' do
99
- # @config.recipe :dummy
100
- # @config.recipes.first.should be_a Blazing::Recipe::Dummy
99
+ @config.recipe :dummy
100
+ @config.recipes.first.should be_a Blazing::Recipe::Dummy
101
101
  end
102
102
 
103
103
  it 'allows multiple recipes to be defined' do
104
- # @config.recipe :dummy
105
- # @config.recipe :dummy
106
- # @config.recipes.size.should be 2
107
- # @config.recipes.each { |r| r.should be_a Blazing::Recipe::Dummy }
104
+ @config.recipe :dummy
105
+ @config.recipe :dummy
106
+ @config.recipes.size.should be 2
107
+ @config.recipes.each { |r| r.should be_a Blazing::Recipe::Dummy }
108
108
  end
109
109
 
110
110
  it 'passes the options to the recipe initializer' do
@@ -3,7 +3,7 @@ require 'blazing/config'
3
3
  require 'blazing/runner'
4
4
  require 'grit'
5
5
 
6
- describe 'blazing setup:remote' do
6
+ describe 'blazing setup' do
7
7
 
8
8
  before :each do
9
9
  setup_sandbox
@@ -24,9 +24,9 @@ describe 'blazing setup:remote' do
24
24
  @shell = Blazing::Shell.new
25
25
  @target = @config.default_target
26
26
  @target.instance_variable_set('@shell', @shell)
27
- @shell.should_receive(:run).with("ssh user@host 'git clone /some/where/else && cd /some/where/else && git config receive.denyCurrentBranch ignore'")
28
- @target.should_receive(:update)
29
- capture(:stdout) { @runner.exec('setup:remote') }
27
+ @shell.should_receive(:run).with("ssh user@host 'git init /some/where/else && cd /some/where/else && git config receive.denyCurrentBranch ignore'")
28
+ @target.should_receive(:apply_hook)
29
+ capture(:stdout) { @runner.exec('setup') }
30
30
  end
31
31
 
32
32
  end
@@ -39,4 +39,9 @@ describe 'blazing update' do
39
39
  capture(:stdout) { @runner.exec('update') }
40
40
  end
41
41
 
42
+ it 'adds a git remote for each target' do
43
+ capture(:stdout) { @runner.exec('update') }
44
+ Grit::Repo.new(Dir.pwd).config['remote.production.url'].should == @production_url
45
+ end
46
+
42
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-25 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
16
- requirement: &70305205865040 !ruby/object:Gem::Requirement
16
+ requirement: &70326105257020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70305205865040
24
+ version_requirements: *70326105257020
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70305205864540 !ruby/object:Gem::Requirement
27
+ requirement: &70326105256520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.9.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70305205864540
35
+ version_requirements: *70326105256520
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70305205864120 !ruby/object:Gem::Requirement
38
+ requirement: &70326105256100 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70305205864120
46
+ version_requirements: *70326105256100
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: guard
49
- requirement: &70305205863620 !ruby/object:Gem::Requirement
49
+ requirement: &70326105255640 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70305205863620
57
+ version_requirements: *70326105255640
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: guard-rspec
60
- requirement: &70305205863200 !ruby/object:Gem::Requirement
60
+ requirement: &70326105255180 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70305205863200
68
+ version_requirements: *70326105255180
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: growl
71
- requirement: &70305205862780 !ruby/object:Gem::Requirement
71
+ requirement: &70326105254760 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70305205862780
79
+ version_requirements: *70326105254760
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rb-fsevent
82
- requirement: &70305205862360 !ruby/object:Gem::Requirement
82
+ requirement: &70326105254340 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70305205862360
90
+ version_requirements: *70326105254340
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: grit
93
- requirement: &70305205861940 !ruby/object:Gem::Requirement
93
+ requirement: &70326105253920 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70305205861940
101
+ version_requirements: *70326105253920
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: activesupport
104
- requirement: &70305205861520 !ruby/object:Gem::Requirement
104
+ requirement: &70326105253500 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70305205861520
112
+ version_requirements: *70326105253500
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: i18n
115
- requirement: &70305205861100 !ruby/object:Gem::Requirement
115
+ requirement: &70326105253080 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,7 +120,7 @@ dependencies:
120
120
  version: '0'
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *70305205861100
123
+ version_requirements: *70326105253080
124
124
  description: git push deployent utility, ready to be extended by your own recipes
125
125
  email:
126
126
  - felipekaufmann@gmail.com
@@ -156,7 +156,6 @@ files:
156
156
  - spec/blazing/integration/init_spec.rb
157
157
  - spec/blazing/integration/recipes_list_spec.rb
158
158
  - spec/blazing/integration/recipes_run_spec.rb
159
- - spec/blazing/integration/setup_local_spec.rb
160
159
  - spec/blazing/integration/setup_remote_spec.rb
161
160
  - spec/blazing/integration/update_spec.rb
162
161
  - spec/blazing/recipe_spec.rb
@@ -196,7 +195,6 @@ test_files:
196
195
  - spec/blazing/integration/init_spec.rb
197
196
  - spec/blazing/integration/recipes_list_spec.rb
198
197
  - spec/blazing/integration/recipes_run_spec.rb
199
- - spec/blazing/integration/setup_local_spec.rb
200
198
  - spec/blazing/integration/setup_remote_spec.rb
201
199
  - spec/blazing/integration/update_spec.rb
202
200
  - spec/blazing/recipe_spec.rb
@@ -1,27 +0,0 @@
1
- require 'spec_helper'
2
- require 'blazing/config'
3
- require 'blazing/runner'
4
- require 'grit'
5
-
6
- describe 'blazing setup:local' do
7
-
8
- before :each do
9
- setup_sandbox
10
- @production_url = 'user@host:/some/where'
11
- @staging_url = 'user@host:/some/where/else'
12
-
13
- @config = Blazing::Config.new
14
- @config.target :production, @production_url
15
- @config.target :staging, @staging_url, :default => true
16
- capture(:stdout) { Blazing::Runner.new(@config).exec('setup:local') }
17
- end
18
-
19
- after :each do
20
- teardown_sandbox
21
- end
22
-
23
- it 'adds a git remote for each target' do
24
- Grit::Repo.new(Dir.pwd).config['remote.production.url'].should == @production_url
25
- end
26
-
27
- end