capistrano-ci 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.
- checksums.yaml +8 -8
- data/.travis.yml +1 -0
- data/README.md +15 -19
- data/lib/capistrano/ci/client.rb +2 -2
- data/lib/capistrano/ci/recipes.rb +6 -17
- data/lib/capistrano/ci/recipes/v2.rb +17 -0
- data/lib/capistrano/ci/recipes/v3.rake +18 -0
- data/lib/capistrano/ci/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDQ4NDgxNzJiMWM2Njk5OGU0ZGMzMWJmYzA2YTk2YjVjNDEzOWIxMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWE0MTNhNGE1OWRmNjMzMjEwYTE4NmU2N2YyZGRkZmRjYzNkYmRhOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTIyMDNkOGMyNzAwMTBlOWJmZTkwOTczNjU0ZDNjZGQyNWM0NWRmZWU3YWNl
|
10
|
+
Mzc4N2E0Zjk2NTA5MDRlNGE5Y2M4OWE1YWNkMzQ1NGUyNTgyNDU2YTBlOGVl
|
11
|
+
NTBiZDc5NTM3NDY2ZWVhYmZkMjIyODNlZmFjMDBjYmRkY2ZkMmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzEzZWM4MzUzOWNmZjk2NzQyY2ZjNDhkYmI2MTZhMmNiOWFjZTIzMzRhNWEx
|
14
|
+
YTMxYzQ4ZjBmNTFmMmY1Zjg3YTNmY2I1OTk2NzM5ZjI3OTdmMTIyOTMyM2M5
|
15
|
+
MjJhNDlmNmI2ZDlmMWRjNTBmZGY4Nzc1NWRkNGI0OTY5NzViNGE=
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Capistrano::Ci
|
2
|
-
[](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/
|
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
|
44
|
-
set
|
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
|
51
|
-
set
|
52
|
-
set
|
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
|
61
|
-
set
|
62
|
-
set
|
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
|
69
|
-
set
|
70
|
-
set
|
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'
|
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'
|
80
|
-
ci.verify
|
81
|
-
end
|
77
|
+
before 'patch:create', 'ci:verify'
|
82
78
|
|
83
79
|
## Contributing
|
84
80
|
|
data/lib/capistrano/ci/client.rb
CHANGED
@@ -19,9 +19,9 @@ module Capistrano
|
|
19
19
|
end
|
20
20
|
|
21
21
|
|
22
|
-
def initialize(
|
22
|
+
def initialize(context)
|
23
23
|
@config = self.class.settings.inject({}) do |result, key|
|
24
|
-
result[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::
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
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.
|
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:
|
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
|