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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b67127c55c2b9a14d88f45be88d7f347eb0c0c52
4
- data.tar.gz: 1409a081c59fe56167dd504d9b335cc1f7ce8dfe
3
+ metadata.gz: 5c0b462238dada510c29f8e4ef5f98083a0f79c3
4
+ data.tar.gz: a2c36bd9a30b4bd5cc16917e3b674008d8233906
5
5
  SHA512:
6
- metadata.gz: 463fa18bec3beb2018e8185908a6c4d55f31711d88533549b91da45fb60d89cb9cabf68d6d04c16c6f0512396894c6ac73d3785689ac1574b857b03979ecd569
7
- data.tar.gz: b7930c883d67af747a0635980a510b45e8701ab0ef7f5dbc20e56780d1d308f572c185c9a507978d0cfc0c9c21d815f43e092b7205bb57489082c7c0280040bb
6
+ metadata.gz: 76b090ae93dc03a53490c505812eb3e5115f860c66b2e9b4517348d37bc8c11331c9d2c1383c35b41df5bd6e20d644b7cee1504f4bb7d828b025ccaadcb20160
7
+ data.tar.gz: fc0cf7c34c1e04a42d3db8c68d983ea39ca0993726fbe5260304e0886b4f235630394c027a3ff35bf5a01acded267501ae0c3028b9785112018460187765d2ef
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Stackdeploy
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.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-10 00:00:00.000000000 Z
11
+ date: 2016-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler