capistrano-circleci 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c99b70a7c7f478289dec5c75e19923b770b679d4
4
+ data.tar.gz: 4a44a3077bd5d4c8d5b9cc278426fc9dcca74084
5
+ SHA512:
6
+ metadata.gz: f3fec9fcd10d5a1abfea1d658db6e8dfe5fb4ab07f28fc14313b276b08c24624c5dbff8f8552eb5b9056c597e6af75b5256211adcdda45ba52b7229bd68453a0
7
+ data.tar.gz: 7e9208125146a33defee793b08a504770fe3a5561df4803d285fa4a2b59d208a20bdc46502e8c9fb3a0192fa4801437fb354421e476fc11b992598faec46f97b
@@ -0,0 +1,41 @@
1
+ require 'capistrano_circleci/version'
2
+ require 'rest-client'
3
+
4
+ require 'capistrano'
5
+
6
+ module CapistranoCircleCI
7
+ module Capistrano
8
+ def self.load_into(configuration)
9
+ configuration.load do
10
+ before "deploy", "circleci:build_check"
11
+
12
+
13
+ namespace :circleci do
14
+ desc <<-DESC
15
+ Check the latest Circle CI Build
16
+ DESC
17
+
18
+ task :build_check, :except => { :no_release => true } do
19
+ branch = fetch(:branch, "master")
20
+ circleci_api_token = fetch(:circleci_api_token, '')
21
+ application = fetch(:application, '')
22
+ organization = fetch(:organization, '')
23
+
24
+ response = RestClient.get "https://circleci.com/api/v1/project/#{organization}/#{application}/tree/#{branch}?circle-token=#{circleci_api_token}&limit=1&offset=0"
25
+ ci_status = JSON.parse(response.body).first['status']
26
+ if ci_status =~ /^(success|fixed)$/
27
+ logger.info "Circle status is successful : #{ci_status}"
28
+ else
29
+ logger.info "Circle status must be successful before you can deploy - current status : #{ci_status}"
30
+ exit
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+
39
+ if Capistrano::Configuration.instance
40
+ CapistranoCircleCI::Capistrano.load_into(Capistrano::Configuration.instance)
41
+ end
@@ -0,0 +1,3 @@
1
+ module CapistranoCircleCI
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-circleci
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Samer Masry
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: capistrano
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ description: "[description]"
42
+ email: samer@onekingslane.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - lib/capistrano_circleci/capistrano.rb
48
+ - lib/capistrano_circleci/version.rb
49
+ homepage: https://github.com/huntersalley/capistrano-circleci
50
+ licenses: []
51
+ metadata: {}
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubyforge_project: "[none]"
68
+ rubygems_version: 2.2.2
69
+ signing_key:
70
+ specification_version: 4
71
+ summary: Capistrano CircleCI Integration
72
+ test_files: []