shipit-engine 0.12.0 → 0.12.1

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: 38e2344717e450b3db3cb9248f16c2b475b2955b
4
- data.tar.gz: cc5af413a0c7a25602639dd52be6d620220880e8
3
+ metadata.gz: a30e953800b45a4493e91c7e8caa2ad53f3dc447
4
+ data.tar.gz: 16b5dabad1863d6982dbd8736152e37e19a3a671
5
5
  SHA512:
6
- metadata.gz: b27627cdf81dd03bb8f4f0db181d4e9e00759469350f67d793c99c02fb6dfd9518edda0673bb79c234efb5d5025916b581f0c99b8fb62d1159e9420028c35cec
7
- data.tar.gz: 7932b8299a15e244982322f760e700138feb36dfbe2bac6818b547a06c9b82dad57edc82aa7835744fcb0d9c061810e0e129a3c2be2e3445e7e5af76f50d23e0
6
+ metadata.gz: cb4027d810267d4c983dd26fa0a602af2db1a5015e3371b2b02e2d8d8636d791a596517a5528df4c89b9d95cc6b638a2ee7676a14215eae60fa2cfa9b8e67d27
7
+ data.tar.gz: 10ff1beb9b067253a7814300ec69b9f7ef7e3c312d3c3b2c122183d0d90a0a97e84f8f267249dc393866fc9374986ce8b0c874d8a97d040e060c64d872ced214
@@ -20,19 +20,26 @@
20
20
  $(document).on 'click', '.disabled, .btn--disabled', (event) ->
21
21
  event.preventDefault()
22
22
 
23
- $(document).on 'click', '.enable-notifications .banner__dismiss', (event) ->
23
+ $(document).on 'click', '.banner__dismiss', (event) ->
24
24
  $(event.target).closest('.banner').addClass('hidden')
25
+
26
+ $(document).on 'click', '.enable-notifications .banner__dismiss', (event) ->
25
27
  localStorage.setItem("dismissed-enable-notifications", true)
26
28
 
29
+ $(document).on 'click', '.github-status .banner__dismiss', (event) ->
30
+ localStorage.setItem("dismissed-github-status", true)
31
+
27
32
  jQuery ->
28
- if(localStorage.getItem("dismissed-enable-notifications"))
29
- return
30
- $notificationNotice = $('.enable-notifications')
31
-
32
- if $.notifyCheck() == $.NOTIFY_NOT_ALLOWED
33
- $button = $notificationNotice.find('button')
34
- $button.on 'click', ->
35
- $.notifyRequest()
36
- $notificationNotice.addClass('hidden')
37
- $notificationNotice.removeClass('hidden')
33
+ unless(localStorage.getItem("dismissed-enable-notifications"))
34
+ $notificationNotice = $('.enable-notifications')
35
+
36
+ if $.notifyCheck() == $.NOTIFY_NOT_ALLOWED
37
+ $button = $notificationNotice.find('button')
38
+ $button.on 'click', ->
39
+ $.notifyRequest()
40
+ $notificationNotice.addClass('hidden')
41
+ $notificationNotice.removeClass('hidden')
42
+
43
+ unless(localStorage.getItem("dismissed-github-status"))
44
+ $('.github-status').removeClass('hidden')
38
45
 
@@ -6,6 +6,7 @@ module Shipit
6
6
 
7
7
  def perform(stack)
8
8
  return unless stack.continuous_deployment?
9
+ return if stack.active_task?
9
10
  stack.trigger_continuous_delivery
10
11
  end
11
12
  end
@@ -0,0 +1,15 @@
1
+ module Shipit
2
+ module GithubStatus
3
+ CACHE_KEY = 'github::status'.freeze
4
+
5
+ class << self
6
+ def status
7
+ Rails.cache.read(CACHE_KEY)
8
+ end
9
+
10
+ def refresh_status
11
+ Rails.cache.write(CACHE_KEY, Shipit.github_api.github_status)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -26,6 +26,23 @@
26
26
  </div>
27
27
  </div>
28
28
 
29
+ <% github_status = Shipit::GithubStatus.status
30
+ unless github_status.nil? || github_status[:status] == 'good' %>
31
+ <div class="banner github-status banner--orange hidden">
32
+ <div class="banner__inner wrapper">
33
+ <div class="banner__content">
34
+ <h2 class="banner__title">GitHub is having issues</h2>
35
+ "<i><%= github_status[:body] %></i>"
36
+ <% unless github_status[:last_updated].nil? %>
37
+ <%= time_ago_in_words(github_status[:last_updated]) %> ago
38
+ <% end %>
39
+ </div>
40
+
41
+ <a class="banner__dismiss">&times;</a>
42
+ </div>
43
+ </div>
44
+ <% end %>
45
+
29
46
  <header class="header">
30
47
  <%= link_to "Shipit v#{Shipit::VERSION}", "https://github.com/Shopify/shipit-engine/tree/v#{Shipit::VERSION}", class: 'powered-by' %>
31
48
  <div class="wrapper">
@@ -13,7 +13,6 @@
13
13
  <%= button_to "Ignore CI", stack_path(@stack, stack: {ignore_ci: true}, return_to: stack_path(@stack)), method: :patch, class: 'banner__btn btn' %>
14
14
  </div>
15
15
  </div>
16
- <a class="banner__dismiss">&times;</a>
17
16
  </div>
18
17
  <% end %>
19
18
 
@@ -1,3 +1,3 @@
1
1
  module Shipit
2
- VERSION = '0.12.0'.freeze
2
+ VERSION = '0.12.1'.freeze
3
3
  end
data/lib/tasks/cron.rake CHANGED
@@ -3,6 +3,7 @@ namespace :cron do
3
3
  task minutely: :environment do
4
4
  Shipit::Stack.refresh_deployed_revisions
5
5
  Shipit::Stack.schedule_continuous_delivery
6
+ Shipit::GithubStatus.refresh_status
6
7
  end
7
8
 
8
9
  desc "Rolls-up output chunks for completed deploys older than an hour"
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipit-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2016-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -624,6 +624,7 @@ files:
624
624
  - app/models/shipit/duration.rb
625
625
  - app/models/shipit/ephemeral_commit_checks.rb
626
626
  - app/models/shipit/github_hook.rb
627
+ - app/models/shipit/github_status.rb
627
628
  - app/models/shipit/hook.rb
628
629
  - app/models/shipit/membership.rb
629
630
  - app/models/shipit/missing_status.rb