capistrano-ci 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDNkMTcwNGI4NjJkYzQ0MzU0YmMzM2I3MzM2NDgwMjY4NGZkOGRlNg==
4
+ MDQ4NDgxNzJiMWM2Njk5OGU0ZGMzMWJmYzA2YTk2YjVjNDEzOWIxMw==
5
5
  data.tar.gz: !binary |-
6
- NmU1Mzk1YjA4N2JkZDVhODNmZWExNWQzZTAzNTNiOGQ2NzNjY2U2MA==
6
+ OWE0MTNhNGE1OWRmNjMzMjEwYTE4NmU2N2YyZGRkZmRjYzNkYmRhOQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YWQyZmFmZjg0MTI4ZWQ1MjIzOTY4Y2VlZTlhMzZhNjc5ZTdhZTZmZTNkYzEz
10
- N2EyYTBlYTc1M2NjYjVmZjZlMmY2N2NlMTg5YTc0OTA3ZDU5ODdhMDJhMmU2
11
- OTIzNjEzY2U3NjAyOTI1ZTk2MjI2ODM3MTc0OGNmZWFhNDQ4YmI=
9
+ OTIyMDNkOGMyNzAwMTBlOWJmZTkwOTczNjU0ZDNjZGQyNWM0NWRmZWU3YWNl
10
+ Mzc4N2E0Zjk2NTA5MDRlNGE5Y2M4OWE1YWNkMzQ1NGUyNTgyNDU2YTBlOGVl
11
+ NTBiZDc5NTM3NDY2ZWVhYmZkMjIyODNlZmFjMDBjYmRkY2ZkMmU=
12
12
  data.tar.gz: !binary |-
13
- MzBmNTYwMzMxNDk3NDFjNDY2ZjU1ZWUzNjM5NzQxMGY5NThkYjExMTQ0NzE5
14
- ZDYwNzBlZGJiYzFhNmNlMmJjNzYzOTZiZDgyYzllNjI1ZWI0ZmIwZDUwZDJi
15
- ZTA4YjFlZDkxY2I2ZjE1NzNmZjAzYTA3NzcxZGQzYjdhNTgyYmM=
13
+ NzEzZWM4MzUzOWNmZjk2NzQyY2ZjNDhkYmI2MTZhMmNiOWFjZTIzMzRhNWEx
14
+ YTMxYzQ4ZjBmNTFmMmY1Zjg3YTNmY2I1OTk2NzM5ZjI3OTdmMTIyOTMyM2M5
15
+ MjJhNDlmNmI2ZDlmMWRjNTBmZGY4Nzc1NWRkNGI0OTY5NzViNGE=
data/.travis.yml CHANGED
@@ -2,6 +2,7 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
+ - 2.1.1
5
6
  - ruby-head
6
7
  notifications:
7
8
  email: false
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Capistrano::Ci
2
- [![Build Status](https://travis-ci.org/railsware/capistrano-ci.png)](https://travis-ci.org/railsware/capistrano-ci)
2
+ [![Build Status](https://travis-ci.org/railsware/capistrano-ci.svg?branch=master)](https://travis-ci.org/railsware/capistrano-ci)
3
3
 
4
4
 
5
5
  ## Introduction
@@ -26,7 +26,7 @@ Or install it yourself as:
26
26
 
27
27
  Add to your Capfile:
28
28
 
29
- require 'capistrano/ci/recipies'
29
+ require 'capistrano/ci/recipes'
30
30
 
31
31
  ## Configuration
32
32
 
@@ -40,16 +40,16 @@ Variables list:
40
40
 
41
41
  Setup ci_client and ci_repository variables in your deployment script:
42
42
 
43
- set(:ci_client){ "travis" }
44
- set(:ci_repository){ "organisation-or-user/repository-name" }
43
+ set :ci_client, "travis"
44
+ set :ci_repository, "organisation-or-user/repository-name"
45
45
 
46
46
  ### Pro Account of Travis-CI:
47
47
 
48
48
  Additional to ci_client and ci_repository setup ci_access_token:
49
49
 
50
- set(:ci_client){ "travis_pro" }
51
- set(:ci_repository){ "organisation-or-user/repository-name" }
52
- set(:ci_access_token){ "your-pro-access-token" }
50
+ set :ci_client, "travis_pro"
51
+ set :ci_repository, "organisation-or-user/repository-name"
52
+ set :ci_access_token, "your-pro-access-token"
53
53
 
54
54
  Read explaination [how to obtain Travis-CI access token](http://railsware.com/blog/2013/09/10/capistrano-recipe-for-checking-travis-ci-build-status/). To have more information about Travis-CI access token follow [this blog post](http://about.travis-ci.org/blog/2013-01-28-token-token-token).
55
55
 
@@ -57,28 +57,24 @@ Read explaination [how to obtain Travis-CI access token](http://railsware.com/bl
57
57
 
58
58
  Setup ci_client, ci_repository and ci_access_token in your deployment script:
59
59
 
60
- set(:ci_client){ "circle" }
61
- set(:ci_repository){ "organisation-or-user/repository-name" }
62
- set(:ci_access_token){ "your-circle-access-token" }
60
+ set :ci_client, "circle"
61
+ set :ci_repository, "organisation-or-user/repository-name"
62
+ set :ci_access_token, "your-circle-access-token"
63
63
 
64
64
  ### Semaphore:
65
65
 
66
66
  Setup ci_client, ci_repository and ci_access_token in your deployment script:
67
67
 
68
- set(:ci_client){ "semaphore" }
69
- set(:ci_repository){ "organisation-or-user/repository-name" }
70
- set(:ci_access_token){ "your-semaphore-access-token" }
68
+ set :ci_client, "semaphore"
69
+ set :ci_repository, "organisation-or-user/repository-name"
70
+ set :ci_access_token, "your-semaphore-access-token"
71
71
 
72
72
  ### Enable ci:verify task:
73
73
 
74
- before 'deploy' do
75
- ci.verify
76
- end
74
+ before 'deploy', 'ci:verify'
77
75
 
78
76
  # or in case of using capistrano-patch:
79
- before 'patch:create' do
80
- ci.verify
81
- end
77
+ before 'patch:create', 'ci:verify'
82
78
 
83
79
  ## Contributing
84
80
 
@@ -19,9 +19,9 @@ module Capistrano
19
19
  end
20
20
 
21
21
 
22
- def initialize(config)
22
+ def initialize(context)
23
23
  @config = self.class.settings.inject({}) do |result, key|
24
- result[key] = config[key] if config.exists?(key)
24
+ result[key] = context.fetch(key)
25
25
  result
26
26
  end
27
27
  end
@@ -1,19 +1,8 @@
1
+ require 'capistrano/version'
1
2
  require 'capistrano/ci'
2
3
 
3
- Capistrano::Configuration.instance(true).load do
4
- namespace :ci do
5
- desc "verification of branch build status on CI"
6
- task :verify do
7
- begin
8
- client = Capistrano::CI::Client.new self
9
-
10
- unless client.passed?(branch)
11
- Capistrano::CLI.ui.say "Your '#{branch}' branch has '#{client.state(branch)}' state on CI."
12
- Capistrano::CLI.ui.ask("Continue anyway? (y/N)") == 'y' or abort
13
- end
14
- rescue => e
15
- Capistrano::CLI.ui.say "#{e.class.name}: #{e.message}"
16
- end
17
- end
18
- end
19
- end
4
+ if defined?(Capistrano::VERSION) && Gem::Version.new(Capistrano::VERSION).release >= Gem::Version.new('3.0.0')
5
+ load 'capistrano/ci/recipes/v3.rake'
6
+ else
7
+ load 'capistrano/ci/recipes/v2.rb'
8
+ end
@@ -0,0 +1,17 @@
1
+ Capistrano::Configuration.instance(true).load do
2
+ namespace :ci do
3
+ desc "verification of branch build status on CI"
4
+ task :verify do
5
+ begin
6
+ client = Capistrano::CI::Client.new self
7
+
8
+ unless client.passed?(branch)
9
+ Capistrano::CLI.ui.say "Your '#{branch}' branch has '#{client.state(branch)}' state on CI."
10
+ Capistrano::CLI.ui.ask("Continue anyway? (y/N)") == 'y' or abort
11
+ end
12
+ rescue => e
13
+ Capistrano::CLI.ui.say "#{e.class.name}: #{e.message}"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ namespace :ci do
2
+ desc "verification of branch build status on CI"
3
+ task :verify do
4
+ begin
5
+ client = Capistrano::CI::Client.new self
6
+
7
+ branch = fetch(:branch)
8
+ unless client.passed?(branch)
9
+ puts "Your '#{branch}' branch has '#{client.state(branch)}' state on CI."
10
+ puts "Continue anyway? (y/N)"
11
+
12
+ abort if $stdin.gets.chomp != 'y'
13
+ end
14
+ rescue => e
15
+ puts "#{e.class.name}: #{e.message}"
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Ci
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - paladiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-24 00:00:00.000000000 Z
11
+ date: 2014-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -144,6 +144,8 @@ files:
144
144
  - lib/capistrano/ci/clients/travis.rb
145
145
  - lib/capistrano/ci/clients/travis_pro.rb
146
146
  - lib/capistrano/ci/recipes.rb
147
+ - lib/capistrano/ci/recipes/v2.rb
148
+ - lib/capistrano/ci/recipes/v3.rake
147
149
  - lib/capistrano/ci/version.rb
148
150
  - spec/capistrano/ci/client_spec.rb
149
151
  - spec/capistrano/ci/clients/base_spec.rb