shipit-engine 0.20.1 → 0.21.0

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.
Files changed (109) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +43 -6
  3. data/app/assets/stylesheets/_base/_base.scss +4 -0
  4. data/app/assets/stylesheets/_pages/_commits.scss +3 -1
  5. data/app/assets/stylesheets/_pages/_deploy.scss +4 -2
  6. data/app/controllers/concerns/shipit/authentication.rb +1 -1
  7. data/app/controllers/shipit/api/base_controller.rb +6 -1
  8. data/app/controllers/shipit/api/pull_requests_controller.rb +1 -1
  9. data/app/controllers/shipit/commit_checks_controller.rb +1 -1
  10. data/app/controllers/shipit/shipit_controller.rb +1 -5
  11. data/app/controllers/shipit/stacks_controller.rb +2 -0
  12. data/app/controllers/shipit/tasks_controller.rb +1 -1
  13. data/app/controllers/shipit/webhooks_controller.rb +2 -2
  14. data/app/helpers/shipit/deploys_helper.rb +9 -0
  15. data/app/helpers/shipit/shipit_helper.rb +17 -15
  16. data/app/helpers/shipit/stacks_helper.rb +6 -1
  17. data/app/jobs/shipit/destroy_stack_job.rb +4 -2
  18. data/app/jobs/shipit/fetch_deployed_revision_job.rb +1 -1
  19. data/app/jobs/shipit/github_sync_job.rb +1 -1
  20. data/app/jobs/shipit/merge_pull_requests_job.rb +3 -3
  21. data/app/jobs/shipit/perform_task_job.rb +3 -0
  22. data/app/jobs/shipit/purge_old_deliveries_job.rb +1 -0
  23. data/app/models/shipit/api_client.rb +1 -1
  24. data/app/models/shipit/commit.rb +29 -6
  25. data/app/models/shipit/commit_deployment.rb +1 -1
  26. data/app/models/shipit/commit_deployment_status.rb +1 -1
  27. data/app/models/shipit/deploy_spec.rb +19 -2
  28. data/app/models/shipit/deploy_spec/bundler_discovery.rb +1 -10
  29. data/app/models/shipit/deploy_spec/file_system.rb +6 -0
  30. data/app/models/shipit/deploy_spec/kubernetes_discovery.rb +1 -1
  31. data/app/models/shipit/deploy_spec/lerna_discovery.rb +85 -0
  32. data/app/models/shipit/deploy_spec/npm_discovery.rb +103 -5
  33. data/app/models/shipit/deploy_spec/pypi_discovery.rb +4 -2
  34. data/app/models/shipit/deploy_spec/rubygems_discovery.rb +4 -2
  35. data/app/models/shipit/duration.rb +1 -1
  36. data/app/models/shipit/github_status.rb +1 -1
  37. data/app/models/shipit/hook.rb +4 -5
  38. data/app/models/shipit/output_chunk.rb +1 -1
  39. data/app/models/shipit/pull_request.rb +36 -15
  40. data/app/models/shipit/stack.rb +15 -9
  41. data/app/models/shipit/status/common.rb +4 -0
  42. data/app/models/shipit/status/group.rb +4 -0
  43. data/app/models/shipit/task.rb +20 -8
  44. data/app/models/shipit/task_definition.rb +2 -2
  45. data/app/models/shipit/undeployed_commit.rb +13 -2
  46. data/app/models/shipit/user.rb +1 -1
  47. data/app/serializers/shipit/pull_request_serializer.rb +1 -1
  48. data/app/serializers/shipit/tail_task_serializer.rb +1 -1
  49. data/app/views/shipit/ccmenu/project.xml.builder +9 -8
  50. data/app/views/shipit/deploys/_deploy.html.erb +3 -2
  51. data/app/views/shipit/stacks/_banners.html.erb +4 -1
  52. data/app/views/shipit/stacks/settings.html.erb +4 -0
  53. data/app/views/shipit/statuses/_group.html.erb +1 -1
  54. data/app/views/shipit/statuses/_status.html.erb +1 -1
  55. data/app/views/shipit/tasks/_task.html.erb +1 -2
  56. data/config/locales/en.yml +2 -0
  57. data/config/secrets.development.example.yml +0 -4
  58. data/config/secrets.development.shopify.yml +1 -5
  59. data/db/migrate/20170904103242_reindex_deliveries.rb +7 -0
  60. data/db/migrate/20171120161420_add_base_info_to_pull_request.rb +7 -0
  61. data/db/migrate/20180202220850_add_aborted_by_to_tasks.rb +5 -0
  62. data/lib/shipit.rb +15 -23
  63. data/lib/shipit/command.rb +11 -3
  64. data/lib/shipit/engine.rb +0 -4
  65. data/lib/shipit/stack_commands.rb +3 -1
  66. data/lib/shipit/version.rb +1 -1
  67. data/lib/snippets/assert-lerna-fixed-version-tag +21 -0
  68. data/lib/snippets/assert-lerna-independent-version-tags +28 -0
  69. data/lib/snippets/generate-local-npmrc +19 -0
  70. data/lib/snippets/misconfigured-npm-publish-config +8 -0
  71. data/lib/snippets/publish-lerna-independent-packages +39 -0
  72. data/lib/snippets/push-to-heroku +5 -5
  73. data/lib/tasks/cron.rake +1 -1
  74. data/lib/tasks/dev.rake +1 -1
  75. data/test/controllers/api/deploys_controller_test.rb +19 -0
  76. data/test/controllers/api/stacks_controller_test.rb +1 -1
  77. data/test/controllers/github_authentication_controller_test.rb +1 -1
  78. data/test/controllers/stacks_controller_test.rb +10 -0
  79. data/test/controllers/tasks_controller_test.rb +2 -0
  80. data/test/controllers/webhooks_controller_test.rb +0 -7
  81. data/test/dummy/config/secrets.yml +0 -2
  82. data/test/dummy/db/development.sqlite3 +0 -0
  83. data/test/dummy/db/schema.rb +5 -3
  84. data/test/dummy/db/test.sqlite3 +0 -0
  85. data/test/fixtures/shipit/commits.yml +53 -0
  86. data/test/fixtures/shipit/pull_requests.yml +52 -0
  87. data/test/fixtures/shipit/stacks.yml +35 -0
  88. data/test/fixtures/shipit/statuses.yml +27 -0
  89. data/test/fixtures/shipit/tasks.yml +14 -0
  90. data/test/helpers/queries_helper.rb +1 -1
  91. data/test/jobs/merge_pull_requests_job_test.rb +19 -2
  92. data/test/jobs/perform_task_job_test.rb +26 -2
  93. data/test/models/commits_test.rb +55 -6
  94. data/test/models/deploy_spec_test.rb +288 -52
  95. data/test/models/deploys_test.rb +7 -7
  96. data/test/models/hook_test.rb +4 -3
  97. data/test/models/pull_request_test.rb +78 -24
  98. data/test/models/stacks_test.rb +21 -17
  99. data/test/models/status/group_test.rb +6 -0
  100. data/test/models/undeployed_commits_test.rb +9 -0
  101. data/test/models/users_test.rb +2 -2
  102. data/test/test_helper.rb +1 -1
  103. metadata +211 -222
  104. data/app/assets/javascripts/shipit_bs.js.coffee +0 -2
  105. data/app/assets/stylesheets/shipit_bs.scss +0 -22
  106. data/app/views/bootstrap/shipit/missing_settings.html.erb +0 -97
  107. data/app/views/bootstrap/shipit/stacks/new.html.erb +0 -44
  108. data/app/views/layouts/shipit_bootstrap.html.erb +0 -44
  109. data/lib/shipit/template_renderer_extension.rb +0 -16
@@ -44,6 +44,7 @@ module Shipit
44
44
 
45
45
  before_validation :update_defaults
46
46
  before_destroy :clear_local_files
47
+ before_save :set_locked_since
47
48
  after_commit :emit_lock_hooks
48
49
  after_commit :emit_added_hooks, on: :create
49
50
  after_commit :emit_updated_hooks, on: :update
@@ -255,11 +256,7 @@ module Shipit
255
256
  end
256
257
 
257
258
  def last_deployed_commit
258
- if deploy = last_successful_deploy
259
- deploy.until_commit
260
- else
261
- NoDeployedCommit
262
- end
259
+ last_successful_deploy.try!(:until_commit) || NoDeployedCommit
263
260
  end
264
261
 
265
262
  def deployable?
@@ -287,7 +284,7 @@ module Shipit
287
284
  end
288
285
 
289
286
  def base_path
290
- Rails.root.join('data/stacks', repo_owner, repo_name, environment)
287
+ Rails.root.join('data', 'stacks', repo_owner, repo_name, environment)
291
288
  end
292
289
 
293
290
  def deploys_path
@@ -362,7 +359,6 @@ module Shipit
362
359
 
363
360
  def lock(reason, user)
364
361
  params = {lock_reason: reason, lock_author: user}
365
- params[:locked_since] = Time.current if locked_since.nil?
366
362
  update!(params)
367
363
  end
368
364
 
@@ -384,8 +380,8 @@ module Shipit
384
380
  end
385
381
 
386
382
  delegate :plugins, :task_definitions, :hidden_statuses, :required_statuses, :soft_failing_statuses,
387
- :deploy_variables, :filter_task_envs, :filter_deploy_envs, :maximum_commits_per_deploy,
388
- :pause_between_deploys, to: :cached_deploy_spec
383
+ :blocking_statuses, :deploy_variables, :filter_task_envs, :filter_deploy_envs,
384
+ :maximum_commits_per_deploy, :pause_between_deploys, to: :cached_deploy_spec
389
385
 
390
386
  def monitoring?
391
387
  monitoring.present?
@@ -486,6 +482,16 @@ module Shipit
486
482
  self.branch = 'master' if branch.blank?
487
483
  end
488
484
 
485
+ def set_locked_since
486
+ return unless lock_reason_changed?
487
+
488
+ if lock_reason.blank?
489
+ self.locked_since = nil
490
+ else
491
+ self.locked_since ||= Time.now
492
+ end
493
+ end
494
+
489
495
  def schedule_merges_if_necessary
490
496
  if previous_changes.include?('lock_reason') && previous_changes['lock_reason'].last.blank?
491
497
  schedule_merges
@@ -37,6 +37,10 @@ module Shipit
37
37
  commit.hidden_statuses.include?(context)
38
38
  end
39
39
 
40
+ def blocking?
41
+ !success? && commit.blocking_statuses.include?(context)
42
+ end
43
+
40
44
  def required?
41
45
  commit.required_statuses.include?(context)
42
46
  end
@@ -52,6 +52,10 @@ module Shipit
52
52
  true
53
53
  end
54
54
 
55
+ def blocking?
56
+ statuses.any?(&:blocking?)
57
+ end
58
+
55
59
  private
56
60
 
57
61
  def reject_hidden(statuses)
@@ -7,13 +7,14 @@ module Shipit
7
7
  PRESENCE_CHECK_TIMEOUT = 15
8
8
  ACTIVE_STATUSES = %w(pending running aborting).freeze
9
9
  COMPLETED_STATUSES = %w(success error failed flapping aborted).freeze
10
- UNSUCCESSFUL_STATUSES = %w(error failed aborted flapping).freeze
10
+ UNSUCCESSFUL_STATUSES = %w(error failed aborted flapping timedout).freeze
11
11
 
12
12
  attr_accessor :pid
13
13
 
14
14
  belongs_to :deploy, foreign_key: :parent_id, required: false # required for fixtures
15
15
 
16
16
  belongs_to :user, optional: true
17
+ belongs_to :aborted_by, class_name: 'User', optional: true
17
18
  belongs_to :stack, counter_cache: true
18
19
  belongs_to :until_commit, class_name: 'Commit'
19
20
  belongs_to :since_commit, class_name: 'Commit'
@@ -56,11 +57,11 @@ module Shipit
56
57
  task.started_at ||= Time.now.utc
57
58
  end
58
59
 
59
- before_transition any => %i(success failed error) do |task|
60
+ before_transition any => %i(success failed error timedout) do |task|
60
61
  task.ended_at ||= Time.now.utc
61
62
  end
62
63
 
63
- after_transition any => %i(success failed error) do |task|
64
+ after_transition any => %i(success failed error timedout) do |task|
64
65
  task.async_refresh_deployed_revision
65
66
  end
66
67
 
@@ -88,6 +89,10 @@ module Shipit
88
89
  transition all => :error
89
90
  end
90
91
 
92
+ event :giveup do # :timeout would cause a name clash
93
+ transition all => :timedout
94
+ end
95
+
91
96
  event :aborting do
92
97
  transition all - %i(aborted) => :aborting
93
98
  end
@@ -97,7 +102,7 @@ module Shipit
97
102
  end
98
103
 
99
104
  event :flap do
100
- transition %i(failed error success) => :flapping
105
+ transition %i(failed error timedout success) => :flapping
101
106
  end
102
107
 
103
108
  state :pending
@@ -105,6 +110,7 @@ module Shipit
105
110
  state :failed
106
111
  state :success
107
112
  state :error
113
+ state :timedout
108
114
  state :aborting
109
115
  state :aborted
110
116
  state :flapping
@@ -114,15 +120,21 @@ module Shipit
114
120
  status.in?(ACTIVE_STATUSES)
115
121
  end
116
122
 
117
- def report_failure!(_error)
123
+ def report_failure!(error)
118
124
  reload
119
125
  if aborting?
120
126
  aborted!
127
+ elsif error.respond_to?(:exit_code) && Shipit.timeout_exit_codes.include?(error.exit_code)
128
+ giveup!
121
129
  else
122
130
  failure!
123
131
  end
124
132
  end
125
133
 
134
+ def report_timeout!(_error)
135
+ giveup!
136
+ end
137
+
126
138
  def report_error!(error)
127
139
  write("#{error.class}: #{error.message}\n\t#{error.backtrace.join("\n\t")}\n")
128
140
  error!
@@ -177,7 +189,7 @@ module Shipit
177
189
  def output
178
190
  gzip = self[:gzip_output]
179
191
 
180
- if gzip.nil? || gzip.empty?
192
+ if gzip.blank?
181
193
  ''
182
194
  else
183
195
  ActiveSupport::Gzip.decompress(gzip)
@@ -236,8 +248,8 @@ module Shipit
236
248
  end
237
249
  end
238
250
 
239
- def abort!(rollback_once_aborted: false)
240
- update!(rollback_once_aborted: rollback_once_aborted)
251
+ def abort!(rollback_once_aborted: false, aborted_by:)
252
+ update!(rollback_once_aborted: rollback_once_aborted, aborted_by_id: aborted_by.id)
241
253
 
242
254
  if alive?
243
255
  aborting
@@ -4,13 +4,13 @@ module Shipit
4
4
 
5
5
  class << self
6
6
  def load(payload)
7
- return unless payload.present?
7
+ return if payload.blank?
8
8
  json = JSON.parse(payload)
9
9
  new(json.delete('id'), json)
10
10
  end
11
11
 
12
12
  def dump(definition)
13
- return unless definition.present?
13
+ return if definition.blank?
14
14
  JSON.dump(definition.as_json)
15
15
  end
16
16
  end
@@ -9,9 +9,15 @@ module Shipit
9
9
 
10
10
  def deploy_state(bypass_safeties = false)
11
11
  state = deployable? ? 'allowed' : status.state
12
+
12
13
  unless bypass_safeties
13
- state = 'deploying' if stack.active_task?
14
- state = 'locked' if locked?
14
+ if blocked?
15
+ state = 'blocked'
16
+ elsif locked?
17
+ state = 'locked'
18
+ elsif stack.active_task?
19
+ state = 'deploying'
20
+ end
15
21
  end
16
22
  state
17
23
  end
@@ -31,5 +37,10 @@ module Shipit
31
37
  def deploy_discouraged?
32
38
  stack.maximum_commits_per_deploy && index >= stack.maximum_commits_per_deploy
33
39
  end
40
+
41
+ def blocked?
42
+ return @blocked if defined?(@blocked)
43
+ @blocked = super
44
+ end
34
45
  end
35
46
  end
@@ -71,7 +71,7 @@ module Shipit
71
71
  end
72
72
 
73
73
  def refresh_from_github!
74
- update!(github_user: Shipit.github_api.user(login))
74
+ update!(github_user: Shipit.github_api.user(github_id))
75
75
  rescue Octokit::NotFound
76
76
  identify_renamed_user!
77
77
  end
@@ -7,7 +7,7 @@ module Shipit
7
7
  has_one :head, serializer: ShortCommitSerializer
8
8
 
9
9
  attributes :id, :number, :title, :github_id, :additions, :deletions, :state, :merge_status, :mergeable,
10
- :merge_requested_at, :rejection_reason, :html_url
10
+ :merge_requested_at, :rejection_reason, :html_url, :branch, :base_ref
11
11
 
12
12
  def html_url
13
13
  github_pull_request_url(object)
@@ -11,7 +11,7 @@ module Shipit
11
11
  end
12
12
 
13
13
  def include_url?
14
- !url.blank?
14
+ url.present?
15
15
  end
16
16
 
17
17
  def output
@@ -2,12 +2,13 @@
2
2
  status_map = {'backlogged' => 'failure', 'locked' => 'failure'}
3
3
  xml.instruct!
4
4
  xml.Projects do
5
- xml.Project '', {
6
- :name => stack.to_param,
7
- :lastBuildStatus => status_map.fetch(stack.merge_status, stack.merge_status).capitalize,
8
- :activity => deploy.running? ? 'Building' : 'Sleeping',
9
- :lastBuildTime => deploy.ended_at || deploy.started_at || deploy.created_at,
10
- :lastBuildLabel => deploy.id,
11
- :webUrl => stack_url(stack),
12
- }
5
+ xml.Project(
6
+ '',
7
+ name: stack.to_param,
8
+ lastBuildStatus: status_map.fetch(stack.merge_status, stack.merge_status).capitalize,
9
+ activity: deploy.running? ? 'Building' : 'Sleeping',
10
+ lastBuildTime: deploy.ended_at || deploy.started_at || deploy.created_at,
11
+ lastBuildLabel: deploy.id,
12
+ webUrl: stack_url(stack),
13
+ )
13
14
  end
@@ -5,9 +5,9 @@
5
5
  <% cache deploy.author do %>
6
6
  <%= render 'shipit/shared/author', author: deploy.author %>
7
7
  <% end %>
8
- <a href="<%= stack_deploy_path(@stack, deploy) %>" class="status status--<%= deploy.status %>" data-tooltip="<%= deploy.status.capitalize %>">
8
+ <a href="<%= stack_deploy_path(@stack, deploy) %>" class="status status--<%= deploy.status %>" data-tooltip="<%= deploy_status_in_words(deploy.status) %>">
9
9
  <i class="status__icon"></i>
10
- <span class="visually-hidden"><%= deploy.status %></span>
10
+ <span class="visually-hidden"><%= deploy_status_in_words(deploy.status) %></span>
11
11
  </a>
12
12
  <div class="commit-details">
13
13
  <span class="commit-title">
@@ -21,6 +21,7 @@
21
21
  <span class="code-additions">+<%= deploy.additions %></span>
22
22
  <span class="code-deletions">-<%= deploy.deletions %></span>
23
23
  <% if deploy.ignored_safeties? %><span class="ignored-safeties">ignoring safeties</span><% end %>
24
+ <% if deploy.aborted_by %><span class="aborted-by">aborted by <%= deploy.aborted_by.login %></span><% end %>
24
25
  </p>
25
26
  <p class="commit-meta">
26
27
  <% if read_only %>
@@ -36,7 +36,10 @@
36
36
  <div class="banner__content">
37
37
  <h2 class="banner__title">
38
38
  <i class="icon icon--lock"></i>
39
- Deploys are locked by <%= stack.lock_author.name %>
39
+ Deploys were locked by <%= stack.lock_author.name %>
40
+ <% unless stack.locked_since.nil? %>
41
+ <%= timeago_tag(stack.locked_since, force: true) %>
42
+ <% end %>
40
43
  </h2>
41
44
  <p class="banner__text">
42
45
  <%= auto_link emojify(stack.lock_reason) %>
@@ -13,6 +13,10 @@
13
13
  <%= f.text_field :environment, placeholder: 'production' %>
14
14
  </div>
15
15
 
16
+ <div class="field-wrapper">
17
+ <span>Branch: <%= @stack.branch %></span>
18
+ </div>
19
+
16
20
  <div class="field-wrapper">
17
21
  <%= f.label :deploy_url, 'Deploy URL (Where is this stack deployed to?)' %>
18
22
  <%= f.text_field :deploy_url, placeholder: 'https://' %>
@@ -9,7 +9,7 @@
9
9
  <% group.statuses.each do |status| %>
10
10
  <div class="status-item status-item--<%= status.state %> <%= :ignored if status.allowed_to_fail? %>">
11
11
  <i class="status-item__icon"></i>
12
- <a href="<%= status.target_url %>" target="_blank">
12
+ <a href="<%= status.target_url %>" <% unless status.target_url.present? %> disabled class="disabled" <% end %> target="_blank">
13
13
  <strong class="status-item__service"><%= status.context %></strong>
14
14
  </a>
15
15
  <span class="status-item__description">&mdash; <%= status.description %></span>
@@ -1,4 +1,4 @@
1
- <a class="status status--<%= status.state %> <%= :disabled unless status.target_url.present? %>" <% unless status.group? %>data-tooltip="<%= status.description.presence || status.state.capitalize %>"<% end %> href="<%= status.target_url%>" target="_blank">
1
+ <a class="status status--<%= status.state %> <%= 'disabled' unless status.target_url.present? %>" <%= 'disabled' unless status.target_url.present? %> <% unless status.group? %>data-tooltip="<%= status.description.presence || status.state.capitalize %>"<% end %> href="<%= status.target_url%>" target="_blank">
2
2
  <i class="status__icon"></i>
3
3
  <span class="visually-hidden"><%= status.state %></span>
4
4
  </a>
@@ -26,8 +26,7 @@
26
26
  <% else %>
27
27
  <%= timeago_tag(task.created_at, force: true) %>
28
28
  <% end %>
29
-
30
29
  </p>
31
30
  </div>
32
31
  </li>
33
- <% end %>
32
+ <% end %>
@@ -27,6 +27,7 @@ en:
27
27
  deploy_button:
28
28
  hint:
29
29
  max_commits: It is recommended not to deploy more than %{maximum} commits at once.
30
+ blocked: This commit range includes a commit that can't be deployed.
30
31
  caption:
31
32
  pending: Pending CI
32
33
  failure: Failing CI
@@ -36,6 +37,7 @@ en:
36
37
  deploying: A Deploy is in Progress
37
38
  allowed: Deploy
38
39
  missing: Missing CI
40
+ blocked: Blocked
39
41
  redeploy_button:
40
42
  caption:
41
43
  deploying: A Deploy is in Progress
@@ -13,10 +13,6 @@ github_oauth:
13
13
  secret:
14
14
  # teams: # Optional
15
15
 
16
- # To work on the beta bootstrap re-write
17
- # features:
18
- # - bootstrap
19
-
20
16
  # To work on the kubernetes deploy script
21
17
  # env:
22
18
  # KUBECONFIG: # Path of the kubeconfig you want to use.
@@ -1,4 +1,4 @@
1
- host: 'http://shipit-engine.localhost'
1
+ host: 'https://shipit-engine.myshopify.io'
2
2
  redis_url: 'redis://shipit-engine.railgun:6379'
3
3
 
4
4
  github_api:
@@ -13,10 +13,6 @@ github_oauth:
13
13
  secret:
14
14
  # teams: # Optional
15
15
 
16
- # To work on the beta bootstrap re-write
17
- # features:
18
- # - bootstrap
19
-
20
16
  # To work on the kubernetes deploy script
21
17
  # env:
22
18
  # KUBECONFIG: # Path of the kubeconfig you want to use.
@@ -0,0 +1,7 @@
1
+ class ReindexDeliveries < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_index :deliveries, [:hook_id, :status]
4
+ remove_index :deliveries, [:created_at]
5
+ remove_index :deliveries, [:status, :event]
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ class AddBaseInfoToPullRequest < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :pull_requests, :base_ref, :string, limit: 1024
4
+ add_column :pull_requests, :base_commit_id, :integer
5
+ add_foreign_key :pull_requests, :commits, column: :base_commit_id
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class AddAbortedByToTasks < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :tasks, :aborted_by_id, :integer
4
+ end
5
+ end
data/lib/shipit.rb CHANGED
@@ -30,8 +30,6 @@ require 'faraday-http-cache'
30
30
 
31
31
  require 'shipit/version'
32
32
 
33
- require 'shipit/template_renderer_extension'
34
-
35
33
  require 'shipit/paginator'
36
34
  require 'shipit/null_serializer'
37
35
  require 'shipit/csv_serializer'
@@ -56,8 +54,9 @@ module Shipit
56
54
 
57
55
  delegate :table_name_prefix, to: :secrets
58
56
 
59
- attr_accessor :disable_api_authentication
60
- attr_writer :automatically_prepend_bundle_exec
57
+ attr_accessor :disable_api_authentication, :timeout_exit_codes
58
+
59
+ self.timeout_exit_codes = [].freeze
61
60
 
62
61
  def app_name
63
62
  @app_name ||= secrets.app_name || Rails.application.class.name.split(':').first || 'Shipit'
@@ -138,6 +137,18 @@ module Shipit
138
137
  secrets.host.presence
139
138
  end
140
139
 
140
+ def enforce_publish_config
141
+ secrets.enforce_publish_config.presence
142
+ end
143
+
144
+ def npm_org_scope
145
+ secrets.npm_org_scope.presence
146
+ end
147
+
148
+ def private_npm_registry
149
+ secrets.private_npm_registry.presence
150
+ end
151
+
141
152
  def github_teams
142
153
  @github_teams ||= github_teams_handles.map { |t| Team.find_or_create_by_handle(t) }
143
154
  end
@@ -195,29 +206,10 @@ module Shipit
195
206
  end
196
207
  end
197
208
 
198
- def feature_bootstrap?
199
- secrets.features.try!(:include?, 'bootstrap')
200
- end
201
-
202
- def bootstrap_view_path
203
- @bootstrap_view_path ||= Engine.root.join('app/views/bootstrap')
204
- end
205
-
206
209
  def default_inactivity_timeout
207
210
  secrets.commands_inactivity_timeout || 5.minutes.to_i
208
211
  end
209
212
 
210
- def automatically_prepend_bundle_exec
211
- unless defined?(@automatically_prepend_bundle_exec)
212
- ActiveSupport::Deprecation.warn(
213
- 'Automatically prepending `bundle exec` will be removed in a future version of Shipit, '\
214
- 'set `Shipit.automatically_prepend_bundle_exec = false` to test the new behaviour.',
215
- )
216
- @automatically_prepend_bundle_exec = true
217
- end
218
- @automatically_prepend_bundle_exec
219
- end
220
-
221
213
  protected
222
214
 
223
215
  def revision_file