stackdeploy 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stackdeploy.rb +31 -0
- data/lib/stackdeploy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c0b462238dada510c29f8e4ef5f98083a0f79c3
|
4
|
+
data.tar.gz: a2c36bd9a30b4bd5cc16917e3b674008d8233906
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76b090ae93dc03a53490c505812eb3e5115f860c66b2e9b4517348d37bc8c11331c9d2c1383c35b41df5bd6e20d644b7cee1504f4bb7d828b025ccaadcb20160
|
7
|
+
data.tar.gz: fc0cf7c34c1e04a42d3db8c68d983ea39ca0993726fbe5260304e0886b4f235630394c027a3ff35bf5a01acded267501ae0c3028b9785112018460187765d2ef
|
data/lib/stackdeploy.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require "stackdeploy/version"
|
2
|
+
require "net/http"
|
3
|
+
require "uri"
|
2
4
|
require "aws-sdk"
|
3
5
|
require "pp"
|
4
6
|
|
@@ -8,6 +10,9 @@ module Stackdeploy
|
|
8
10
|
stack_name = ARGV[1]
|
9
11
|
param_name = ARGV[2]
|
10
12
|
param_value = ARGV[3]
|
13
|
+
sentry_org = ARGV[4]
|
14
|
+
sentry_app = ARGV[5]
|
15
|
+
git_sha = ARGV[6]
|
11
16
|
|
12
17
|
if !region || !stack_name || !param_name || !param_value
|
13
18
|
puts "Usage: stackdeploy region stack param value"
|
@@ -63,5 +68,31 @@ module Stackdeploy
|
|
63
68
|
puts "Update request failed."
|
64
69
|
exit(1)
|
65
70
|
end
|
71
|
+
|
72
|
+
# Notify sentry of the release
|
73
|
+
if sentry_org && sentry_app && git_sha
|
74
|
+
if !ENV['SENTRY_API_TOKEN']
|
75
|
+
puts "Set SENTRY_API_TOKEN to update Sentry."
|
76
|
+
exit(1)
|
77
|
+
end
|
78
|
+
|
79
|
+
uri = URI("https://app.getsentry.com/api/0/projects/#{sentry_org}/#{sentry_app}/releases/")
|
80
|
+
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
81
|
+
request = Net::HTTP::Post.new(uri)
|
82
|
+
request.form_data = {
|
83
|
+
version: param_value,
|
84
|
+
ref: git_sha
|
85
|
+
}
|
86
|
+
request["Authorization"] = "Bearer #{ENV["SENTRY_API_TOKEN"]}"
|
87
|
+
|
88
|
+
response = http.request(request)
|
89
|
+
|
90
|
+
if response.is_a?(Net::HTTPSuccess)
|
91
|
+
puts "Tagged release #{param_value} for revision #{git_sha}"
|
92
|
+
else
|
93
|
+
puts "Tagging release failed: #{response.body}"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
66
97
|
end
|
67
98
|
end
|
data/lib/stackdeploy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stackdeploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|