deployments 0.0.3 → 0.0.4

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.
data/README.md CHANGED
@@ -25,11 +25,15 @@ If you are using Rails 2 version you should add load method to your Rakefile:
25
25
  ```
26
26
 
27
27
  At first you need to create in the config folder deployments.yml file with
28
- line:
28
+ receiver server url and domains of different envs of your application:
29
29
 
30
30
  ```yaml
31
31
  options:
32
32
  server: "your deployments server that will save build version"
33
+ development:
34
+ domain: "development.example.com"
35
+ staging:
36
+ domain: "staging.example.com"
33
37
  ```
34
38
 
35
39
  Add to your capistrano recipes the next following line, changing your_app_env
@@ -1,3 +1,5 @@
1
1
  options:
2
2
  server: "example.com"
3
+ staging:
4
+ domain: "staging.example.com"
3
5
 
@@ -14,7 +14,8 @@ module Deployments
14
14
  :username => username,
15
15
  :env => env,
16
16
  :tag => tag,
17
- :commits => commits
17
+ :commits => commits,
18
+ :domain => domain
18
19
  }
19
20
  end
20
21
 
@@ -31,6 +32,10 @@ module Deployments
31
32
  def tag
32
33
  project.tag
33
34
  end
35
+
36
+ def domain
37
+ Deployments.send(env.to_sym).domain
38
+ end
34
39
  end
35
40
  end
36
41
 
@@ -1,3 +1,3 @@
1
1
  module Deployments
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/spec/build_spec.rb CHANGED
@@ -12,10 +12,15 @@ describe Build do
12
12
  end
13
13
 
14
14
  it "should return env" do
15
- build.should_receive(:env).and_return("staging")
15
+ build.should_receive(:env).twice.and_return("staging")
16
16
  build.to_params[:env].should == "staging"
17
17
  end
18
18
 
19
+ it "should return domain by env" do
20
+ build.should_receive(:domain).and_return("staging.example.com")
21
+ build.to_params[:domain].should == "staging.example.com"
22
+ end
23
+
19
24
  context "in the current git project" do
20
25
  let(:project_path) { './spec/fixtures/repositories/commits_tag/dot_git' }
21
26
 
@@ -5,6 +5,10 @@ describe Deployments do
5
5
  it "should get server url" do
6
6
  Deployments.options.server.should == "example.com"
7
7
  end
8
+
9
+ it "should get domain for env" do
10
+ Deployments.staging.domain == "staging.example.com"
11
+ end
8
12
  end
9
13
  end
10
14
 
@@ -36,17 +36,7 @@ describe Dispatcher do
36
36
 
37
37
  context "with valid data" do
38
38
  let(:response) { double('response', :response_code => 200) }
39
- let(:fields) do
40
- {
41
- :username => "john.smith",
42
- :env => "staging",
43
- :tag => "0.0.1",
44
- :commits => [
45
- "Added deployments section to the README file",
46
- "Added README file"
47
- ]
48
- }
49
- end
39
+ let(:fields) { { } }
50
40
 
51
41
  it "should successfully send" do
52
42
  dispatcher.run.should be_true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deployments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: