capistrano-isitdeployed 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3553474a256853809eebe7aa7aa06ea5e07352bd
4
- data.tar.gz: 697a5e20c409a10c9a86aae82c4b6c77cd947fe6
3
+ metadata.gz: d1e80dc7f4fbe2d68fe7e757435d40ffc1be3edf
4
+ data.tar.gz: 375bfa6616de5284e778a5508b1133661bfc74b2
5
5
  SHA512:
6
- metadata.gz: f23411e27b9466f56ec0b802fc610e84f34317c6731fe8d661fd996a83126fd86e69531fe308953f6848f27b79120b1f8bebf14392ee0b28e400315dcc976257
7
- data.tar.gz: 832ea7ccb6667af11fcbcb2d4251a6ba7c65420f7d74d079a1a098179bc5b7c52206d3bea14be0651121a44727f872bad67ab57ed1a03b46fb3dcb00ea678d94
6
+ metadata.gz: 6b7c301a01d64b3e86c66f33e4f5478145064cd44c0c8fc7b0982330f1c19e2705d5b4a41301b6ddf5977b0c68e76a312ce9c46007d4eb73d72ca35cd5d61ad9
7
+ data.tar.gz: 21058ceb15e9777c116d0204e187ff0739a40eed22f5a17585c7bf7a037aecbb0fd7e160089cadb99996b91cf246f17d56d804c7e3b3f14fbd91c6894c614951
@@ -1,7 +1,9 @@
1
1
  module Capistrano
2
2
  module Isitdeployed
3
3
 
4
- ENDPOINT = 'http://staging.isitdeployed.com'
4
+ ENDPOINT = 'http://www.isitdeployed.com'
5
+ # ENDPOINT = 'http://staging.isitdeployed.com'
6
+ # ENDPOINT = 'http://0.0.0.0:3000'
5
7
  CONFIG_SRC = 'template/isitdeployed.yml'
6
8
  CONFIG_DEST = 'config/isitdeployed.yml'
7
9
 
@@ -3,8 +3,8 @@
3
3
  #
4
4
 
5
5
  # required configuration
6
- isitdeployed_pid: x
7
- isitdeployed_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
6
+ project_id: x
7
+ api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
8
8
 
9
9
  # optional parameters:
10
10
  # "isitdeployed_app", to override :application variable
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Isitdeployed
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -49,16 +49,20 @@ module Capistrano
49
49
  logger.trace "IsItDeployed > WARNING: No configuration file found, please run cap 'isit:setup'"
50
50
  end
51
51
  started = Capistrano::Isitdeployed.timestamp
52
- RestClient.post(Capistrano::Isitdeployed::ENDPOINT + "/p/#{Capistrano::Isitdeployed::CONFIG['isitdeployed_pid']}/d", { :status => 1, :platform => "#{stage}", :release => "#{release_name}", :started => started, :token => Capistrano::Isitdeployed::CONFIG['isitdeployed_token'] }.to_json, :content_type => :json, :accept => :json, :timeout => 5, :open_timeout => 5){ |response, request, result| response
52
+ RestClient.post(Capistrano::Isitdeployed::ENDPOINT + "/p/#{Capistrano::Isitdeployed::CONFIG['project_id']}/d", { :status => 1, :platform => "#{stage}", :release => "#{release_name}", :started => started, :token => Capistrano::Isitdeployed::CONFIG['api_secret'] }.to_json, :content_type => :json, :accept => :json, :timeout => 5, :open_timeout => 5){ |response, request, result| response
53
53
  case response.code
54
54
  when 201
55
55
  logger.trace "IsItDeployed > New deploy created for #{application} to #{stage} with version: #{release_name}"
56
- logger.trace "IsItDeployed > URL is #{Capistrano::Isitdeployed::ENDPOINT}/p/#{Capistrano::Isitdeployed::CONFIG['isitdeployed_pid']}"
57
- set(:isitdeployed_did, response)
56
+ logger.trace "IsItDeployed > URL is #{Capistrano::Isitdeployed::ENDPOINT}/p/#{Capistrano::Isitdeployed::CONFIG['project_id']}"
57
+ logger.trace "IsItDeployed > #{response.gsub(/\s+/, "")}"
58
+ set(:isitdeployed_did, response.gsub(/\s+/, ""))
58
59
  set(:isitdeployed_started, started)
59
60
  set(:isitdeployed_created, 1)
60
61
  when 401
61
- logger.trace "IsItDeployed > ERROR: Invalid token. Check your 'isitdeployed.yml'"
62
+ logger.trace "IsItDeployed > ERROR: Invalid 'api_secret'. Check your 'isitdeployed.yml'"
63
+ set(:isitdeployed_created, 0)
64
+ when 404
65
+ logger.trace "IsItDeployed > ERROR: Invalid 'project_id'. Check your 'isitdeployed.yml'"
62
66
  set(:isitdeployed_created, 0)
63
67
  else
64
68
  logger.trace "IsItDeployed > ERROR: Can't create deploy, server returned code #{response.code}"
@@ -84,12 +88,14 @@ module Capistrano
84
88
  if isitdeployed_created === 1
85
89
  stopped = Capistrano::Isitdeployed.timestamp
86
90
  duration = stopped.to_i - isitdeployed_started.to_i
87
- RestClient.put(Capistrano::Isitdeployed::ENDPOINT + "/p/#{Capistrano::Isitdeployed::CONFIG['isitdeployed_pid']}/d/#{isitdeployed_did}", { :status => isitdeployed_status, :stopped => stopped, :duration => duration, :token => Capistrano::Isitdeployed::CONFIG['isitdeployed_token'] }.to_json, :content_type => :json, :accept => :json, :timeout => 5, :open_timeout => 5){ |response, request, result| response
91
+ RestClient.put(Capistrano::Isitdeployed::ENDPOINT + "/p/#{Capistrano::Isitdeployed::CONFIG['project_id']}/d/#{isitdeployed_did}", { :status => isitdeployed_status, :stopped => stopped, :duration => duration, :token => Capistrano::Isitdeployed::CONFIG['api_secret'] }.to_json, :content_type => :json, :accept => :json, :timeout => 5, :open_timeout => 5){ |response, request, result| response
88
92
  case response.code
89
93
  when 204
90
94
  logger.trace "IsItDeployed > Deploy ##{isitdeployed_did} has been updated for #{application} to #{stage}."
91
95
  when 401
92
- logger.trace "IsItDeployed > ERROR: Invalid token. Check your 'isitdeployed.yml'"
96
+ logger.trace "IsItDeployed > ERROR: Invalid 'api_secret'. Check your 'isitdeployed.yml'"
97
+ when 404
98
+ logger.trace "IsItDeployed > ERROR: Invalid 'project_id'. Check your 'isitdeployed.yml'"
93
99
  else
94
100
  logger.trace "IsItDeployed > ERROR: Can't create deploy, server returned #{response.code}"
95
101
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-isitdeployed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas VIAL
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2013-03-27 00:00:00 Z
12
+ date: 2013-04-02 00:00:00 Z
13
13
  dependencies: []
14
14
 
15
15
  description: This is a pre-alpha build for test purpose.