capistrano-isitdeployed 0.0.2 → 0.0.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1e80dc7f4fbe2d68fe7e757435d40ffc1be3edf
|
4
|
+
data.tar.gz: 375bfa6616de5284e778a5508b1133661bfc74b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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://
|
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
|
|
@@ -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['
|
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['
|
57
|
-
|
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
|
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['
|
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
|
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.
|
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-
|
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.
|