affogata_love_muffins 0.6.9 → 0.9.9

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
  SHA256:
3
- metadata.gz: ea36add1abadb8db319ae45e6e1975aea5a18eb4eeac247cf84b8e31293c67aa
4
- data.tar.gz: df137bdfd966ef57333c6c17268cb4946a69d754f59e987c4fffac5871485a0e
3
+ metadata.gz: 6756fb3ebe2ee626e40a67b671364157906c12cce36e885d4779a3139559c9dc
4
+ data.tar.gz: 39f448297a0e8933ba07482330f46640528686b19c1bc1b848edad796ba177d3
5
5
  SHA512:
6
- metadata.gz: af108a0f36e5214ff3709f392d834402cf03f2a75d0c68b8dd461d21325b158a728d845bfd33d683ea3554f7dbeae64a5d7772ada3a5bd9ed7fd0dc34c25b7f1
7
- data.tar.gz: 440bc46e0eb792309b9f5cd7773d7328104301c9a7a49a0da7c6119b1b9f5c965103430e52b004f80c6d4e42f3849c2d643afe035867fc60f4a5d3764718fe1e
6
+ metadata.gz: b4a09190d27845f7afccc056574c70bca472a9ea9cd397212c1028a3e597cad33aea9b94e20366fba707acd0a0929ce075a0e8f6a3fdfdc32aebf0a2e24752da
7
+ data.tar.gz: 2ae45e5e8bfab8aff4fb8cf366af0114bdacd151eebec1730670a5aa4f4d136fa296cc173c10ad18963141a7038cc911227949a2dce179c531d7d1579a210c40
@@ -1,3 +1,3 @@
1
1
  module AffogataLoveMuffins
2
- VERSION = "0.6.9"
2
+ VERSION = "0.9.9"
3
3
  end
@@ -2,6 +2,8 @@ module AffogataLoveMuffins
2
2
  class Config
3
3
  attr_accessor :herochestrator_url
4
4
  attr_accessor :data
5
+ attr_accessor :slack_url
6
+
5
7
  def initialize
6
8
  @herochestrator_url = ENV['HEROCHESTRATOR_URL']
7
9
  end
@@ -15,7 +17,11 @@ module AffogataLoveMuffins
15
17
  app_name: ENV['HEROKU_APP_NAME'],
16
18
  dyno_id: ENV['HEROKU_DYNO_ID'],
17
19
  parent_app_name: ENV['HEROKU_PARENT_APP_NAME'],
18
- repo_url: json['repository']
20
+ pr_number: ENV['HEROKU_PR_NUMBER'],
21
+ branch: ENV['HEROKU_BRANCH'],
22
+ rails_env: ENV['RAILS_ENV'],
23
+ repo_url: json['repository'],
24
+ slack_url: slack_url
19
25
  }
20
26
  end
21
27
  end
@@ -1,32 +1,32 @@
1
1
  require 'net/http'
2
2
  require 'uri'
3
3
 
4
+
4
5
  namespace :affogata do
6
+ def handle(step)
7
+ puts "affogata:#{step} has been invoked"
8
+ uri = URI("#{AffogataLoveMuffins.config.herochestrator_url}/webhooks/apps?step=#{step}")
9
+ res = Net::HTTP.post_form(uri, AffogataLoveMuffins.config.data.map { |k,v| [k.to_s, v] }.to_h)
10
+ puts "affogata:#{step} was sent #{res.code}: #{res.body.inspect}"
11
+ end
12
+
5
13
  desc "Fires when the initial app is created"
6
14
  task created: :environment do
7
- uri = URI("#{AffogataLoveMuffins.config.herochestrator_url}/webhooks/apps?step=created")
8
- res = Net::HTTP.post_form(uri, AffogataLoveMuffins.config.data.map { |k,v| [k.to_s, v] }.to_h)
9
- puts res.body
15
+ handle(:created)
10
16
  end
11
17
 
12
18
  desc "Fires when the app has all platform-specific settings configured"
13
19
  task provisioned: :environment do
14
- uri = URI("#{AffogataLoveMuffins.config.herochestrator_url}/webhooks/apps?step=provisioned")
15
- res = Net::HTTP.post_form(uri, AffogataLoveMuffins.config.data.map { |k,v| [k.to_s, v] }.to_h)
16
- puts res.body
20
+ handle(:provisioned)
17
21
  end
18
22
 
19
23
  desc "Idk when this fires but it seems like a good idea to have it"
20
24
  task post_setup: :environment do
21
- uri = URI("#{AffogataLoveMuffins.config.herochestrator_url}/webhooks/apps?step=post_setup")
22
- res = Net::HTTP.post_form(uri, AffogataLoveMuffins.config.data.map { |k,v| [k.to_s, v] }.to_h)
23
- puts res.body
25
+ handle(:post_setup)
24
26
  end
25
27
 
26
28
  desc "Fires when this instance is being removed from the platform"
27
29
  task destroyed: :environment do
28
- uri = URI("#{AffogataLoveMuffins.config.herochestrator_url}/webhooks/apps?step=destroyed")
29
- res = Net::HTTP.post_form(uri, AffogataLoveMuffins.config.data.map { |k,v| [k.to_s, v] }.to_h)
30
- puts res.body
30
+ handle(:destroyed)
31
31
  end
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: affogata_love_muffins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Partytray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-25 00:00:00.000000000 Z
11
+ date: 2022-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails