shipit-engine 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/jobs/shipit/perform_task_job.rb +29 -1
  3. data/app/models/shipit/task.rb +46 -15
  4. data/app/views/shipit/commits/_commit_author.html.erb +2 -2
  5. data/db/migrate/20160426155146_add_index_for_stack_active_task.rb +5 -0
  6. data/lib/shipit/command.rb +46 -19
  7. data/lib/shipit/version.rb +1 -1
  8. data/test/controllers/tasks_controller_test.rb +2 -2
  9. data/test/dummy/db/development.sqlite3 +0 -0
  10. data/test/dummy/db/schema.rb +2 -1
  11. data/test/dummy/db/test.sqlite3 +0 -0
  12. data/test/fixtures/timeout +15 -0
  13. data/test/jobs/perform_task_job_test.rb +3 -3
  14. data/test/models/deploys_test.rb +22 -29
  15. data/test/test_command_integration.rb +28 -0
  16. data/test/unit/command_test.rb +10 -1
  17. metadata +7 -50
  18. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/bar.txt +0 -2
  19. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/dkfdsf +0 -0
  20. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/dskjfsd +0 -0
  21. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/dslkjfjsdf +0 -0
  22. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/plopfizz +0 -0
  23. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/sd +0 -0
  24. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/sdkfjsdf +0 -1
  25. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/sdlfjsdfdsfj +0 -0
  26. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/sdlkfjsdlkfjsdlkfjdsfsdfksdfjsldkfjsdlkfjsdf +0 -0
  27. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/shipit.yml +0 -32
  28. data/test/dummy/data/stacks/byroot/junk/production/deploys/83/toto.txt +0 -2
  29. data/test/dummy/data/stacks/byroot/junk/production/git/bar.txt +0 -2
  30. data/test/dummy/data/stacks/byroot/junk/production/git/dkfdsf +0 -0
  31. data/test/dummy/data/stacks/byroot/junk/production/git/dskjfsd +0 -0
  32. data/test/dummy/data/stacks/byroot/junk/production/git/dslkjfjsdf +0 -0
  33. data/test/dummy/data/stacks/byroot/junk/production/git/plopfizz +0 -0
  34. data/test/dummy/data/stacks/byroot/junk/production/git/sd +0 -0
  35. data/test/dummy/data/stacks/byroot/junk/production/git/sdkfjsdf +0 -1
  36. data/test/dummy/data/stacks/byroot/junk/production/git/sdlfjsdfdsfj +0 -0
  37. data/test/dummy/data/stacks/byroot/junk/production/git/sdlkfjsdlkfjsdlkfjdsfsdfksdfjsldkfjsdlkfjsdf +0 -0
  38. data/test/dummy/data/stacks/byroot/junk/production/git/shipit.yml +0 -32
  39. data/test/dummy/data/stacks/byroot/junk/production/git/toto.txt +0 -2
  40. data/test/dummy/data/stacks/byroot/test/production/git/README.md +0 -1
  41. data/test/dummy/db/test.sqlite3-journal +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22eb132c6bbb6e9af2fdfca03481022aa47ccbeb
4
- data.tar.gz: 6415095a2772724f3b2ad364411ad3d5956039f4
3
+ metadata.gz: af8d2464cc17caa2786a2a0a9500583b5ed0c7f3
4
+ data.tar.gz: e00c5b97da7d17dfc23e449630f158e724a5910f
5
5
  SHA512:
6
- metadata.gz: 2d5f6b17d2f1b9f4a52b4ed208524dd13f4ddddd8d178e0235eaeecd318c872ee29b480b87f5f905bfc9990274e82e1addca61feefa98aa373b09f03d245176a
7
- data.tar.gz: d17ad59449f3a8a801689d991ff4092efe67c6c88ea83f51de1c70257fdf3c919ea0181d1d206099fea76550824602c65b85432cdf88e879c770d99954a5a709
6
+ metadata.gz: 4bff19eadd58b4c9e0bc84c7facd5aaf4dfdc85000c19e1ba50754b7d011a4133ad620e92fef5c6863709643a299c31ecdbcb94634fcd23a48ee137b1fc2fd48
7
+ data.tar.gz: 9a9ef4184bac10c36545cb0c14105d6c7600a1c528bfa087295542f7d3cf01c1f435ed748ee543bf0cd451bc2707662b85d757496eae2d138bcd0a72ba228c0b
@@ -24,6 +24,31 @@ module Shipit
24
24
  @task.report_failure!(error)
25
25
  rescue StandardError => error
26
26
  @task.report_error!(error)
27
+ rescue Exception => error
28
+ @task.report_error!(error)
29
+ raise
30
+ end
31
+
32
+ def abort!(signal: 'TERM')
33
+ pid = @task.pid
34
+ if pid
35
+ @task.write("$ kill #{pid}\n")
36
+ Process.kill(signal, pid)
37
+ else
38
+ @task.write("Can't abort, no recorded pid, WTF?\n")
39
+ end
40
+ rescue SystemCallError => error
41
+ @task.write("kill: (#{pid}) - #{error.message}\n")
42
+ end
43
+
44
+ def check_for_abort
45
+ @task.should_abort? do |times_killed|
46
+ if times_killed > 3
47
+ abort!(signal: 'KILL')
48
+ else
49
+ abort!
50
+ end
51
+ end
27
52
  end
28
53
 
29
54
  def perform_task
@@ -46,7 +71,10 @@ module Shipit
46
71
  end
47
72
 
48
73
  def capture(command)
49
- command.start
74
+ command.start do
75
+ @task.ping
76
+ check_for_abort
77
+ end
50
78
  @task.write("$ #{command}\npid: #{command.pid}\n")
51
79
  @task.pid = command.pid
52
80
  command.stream! do |line|
@@ -1,8 +1,11 @@
1
1
  module Shipit
2
2
  class Task < ActiveRecord::Base
3
+ PRESENCE_CHECK_TIMEOUT = 15
3
4
  ACTIVE_STATUSES = %w(pending running aborting).freeze
4
5
  COMPLETED_STATUSES = %w(success error failed flapping aborted).freeze
5
6
 
7
+ attr_accessor :pid
8
+
6
9
  belongs_to :deploy, foreign_key: :parent_id, required: false # required for fixtures
7
10
 
8
11
  belongs_to :user
@@ -177,27 +180,45 @@ module Shipit
177
180
  !pending? && !running? && !aborting?
178
181
  end
179
182
 
180
- def pid
181
- pid = Shipit.redis.get("task:#{id}:pid")
182
- pid.presence && pid.to_i
183
+ def ping
184
+ Shipit.redis.set(status_key, 'alive', ex: PRESENCE_CHECK_TIMEOUT)
183
185
  end
184
186
 
185
- def pid=(pid)
186
- Shipit.redis.set("task:#{id}:pid", pid, ex: 1.hour.to_i)
187
+ def alive?
188
+ Shipit.redis.get(status_key) == 'alive'
187
189
  end
188
190
 
189
- def abort!(rollback_once_aborted: false)
190
- target_pid = pid
191
- return write("\nAbort: failed, PID unknown\n") unless target_pid.present?
191
+ def report_dead!
192
+ write("ERROR: Background job hasn't reported back in #{PRESENCE_CHECK_TIMEOUT} seconds.")
193
+ error!
194
+ end
195
+
196
+ def should_abort?
197
+ @last_abort_count ||= 1
198
+ (@last_abort_count..Shipit.redis.get(abort_key).to_i).each do |count|
199
+ @last_abort_count = count + 1
200
+ yield count
201
+ end
202
+ end
203
+
204
+ def request_abort
205
+ Shipit.redis.pipelined do
206
+ Shipit.redis.incr(abort_key)
207
+ Shipit.redis.expire(abort_key, 1.month.to_i)
208
+ end
209
+ end
192
210
 
211
+ def abort!(rollback_once_aborted: false)
193
212
  update!(rollback_once_aborted: rollback_once_aborted)
194
- aborting!
195
- write("\nAbort: sending SIGTERM to pid #{target_pid}\n")
196
- Process.kill('TERM', target_pid)
197
- rescue Errno::ESRCH
198
- write("\nAbort: PID #{target_pid} ESRCH: No such process\n")
199
- aborted!
200
- true
213
+
214
+ if alive?
215
+ aborting
216
+ request_abort
217
+ elsif aborting? || aborted?
218
+ aborted
219
+ elsif !finished?
220
+ report_dead!
221
+ end
201
222
  end
202
223
 
203
224
  def working_directory
@@ -217,5 +238,15 @@ module Shipit
217
238
  def hook_event
218
239
  self.class.name.demodulize.underscore.to_sym
219
240
  end
241
+
242
+ private
243
+
244
+ def status_key
245
+ "shipit:task:#{id}"
246
+ end
247
+
248
+ def abort_key
249
+ "#{status_key}:aborting"
250
+ end
220
251
  end
221
252
  end
@@ -1,7 +1,7 @@
1
- <div class="commit-author">
1
+ <a href="<%= github_user_url(commit.author.login) %>" class="commit-author">
2
2
  <%= github_avatar(commit.author, size: 80, class: 'commit-author__avatar') %>
3
3
  <div class="commit-author__name">
4
4
  <span class="commit-author__name__real-name"><%= commit.author.name %></span>
5
5
  <span class="commit-author__name__username"><%= commit.author.login %></span>
6
6
  </div>
7
- </div>
7
+ </a>
@@ -0,0 +1,5 @@
1
+ class AddIndexForStackActiveTask < ActiveRecord::Migration
2
+ def change
3
+ add_index :tasks, [:status, :stack_id, :allow_concurrency], name: :index_active_tasks
4
+ end
5
+ end
@@ -11,6 +11,7 @@ module Shipit
11
11
  Failed = Class.new(Error)
12
12
  NotFound = Class.new(Error)
13
13
  Denied = Class.new(Error)
14
+ TimedOut = Class.new(Error)
14
15
 
15
16
  attr_reader :out, :code, :chdir, :env, :args, :pid, :timeout
16
17
 
@@ -21,6 +22,14 @@ module Shipit
21
22
  @chdir = chdir.to_s
22
23
  end
23
24
 
25
+ def with_timeout(new_timeout)
26
+ old_timeout = timeout
27
+ @timeout = new_timeout
28
+ yield
29
+ ensure
30
+ @timeout = old_timeout
31
+ end
32
+
24
33
  def to_s
25
34
  @args.join(' ')
26
35
  end
@@ -70,8 +79,9 @@ module Shipit
70
79
  interpolate_environment_variables(@args)
71
80
  end
72
81
 
73
- def start
82
+ def start(&block)
74
83
  return if @started
84
+ @control_block = block
75
85
  child_in = @out = @pid = nil
76
86
  FileUtils.mkdir_p(@chdir)
77
87
  with_full_path do
@@ -92,7 +102,7 @@ module Shipit
92
102
  start
93
103
  begin
94
104
  read_stream(@out, &block)
95
- rescue Timeout::Error => error
105
+ rescue TimedOut => error
96
106
  @code = 'timeout'
97
107
  yield red("No output received in the last #{timeout} seconds.") + "\n"
98
108
  terminate!(&block)
@@ -115,28 +125,42 @@ module Shipit
115
125
  self
116
126
  end
117
127
 
128
+ def timed_out?
129
+ @last_output_at ||= Time.now.to_i
130
+ (@last_output_at + timeout) < Time.now.to_i
131
+ end
132
+
133
+ def touch_last_output_at
134
+ @last_output_at = Time.now.to_i
135
+ end
136
+
137
+ def yield_control
138
+ @control_block.call if @control_block
139
+ end
140
+
118
141
  def read_stream(io)
142
+ touch_last_output_at
119
143
  loop do
120
- with_timeout do
121
- yield io.readpartial(MAX_READ)
144
+ begin
145
+ yield_control
146
+ yield io.read_nonblock(MAX_READ)
147
+ touch_last_output_at
148
+ rescue IO::WaitReadable
149
+ raise TimedOut if timed_out?
150
+ IO.select([io], nil, nil, 1)
151
+ retry
122
152
  end
123
153
  end
124
154
  rescue EOFError
125
155
  end
126
156
 
127
- def with_timeout(&block)
128
- return yield unless timeout
129
-
130
- Timeout.timeout(timeout, &block)
131
- end
132
-
133
157
  def terminate!(&block)
134
- kill_and_wait('INT', 5, &block)
135
- kill_and_wait('INT', 2, &block)
136
- kill_and_wait('TERM', 5, &block)
137
- kill_and_wait('TERM', 2, &block)
138
- kill('KILL', &block)
139
- rescue Errno::ECHILD
158
+ kill_and_wait('INT', 5, &block) ||
159
+ kill_and_wait('INT', 2, &block) ||
160
+ kill_and_wait('TERM', 5, &block) ||
161
+ kill_and_wait('TERM', 2, &block) ||
162
+ kill('KILL', &block)
163
+ rescue Errno::ECHILD, Errno::ESRCH
140
164
  true # much success
141
165
  ensure
142
166
  begin
@@ -147,10 +171,13 @@ module Shipit
147
171
 
148
172
  def kill_and_wait(sig, wait, &block)
149
173
  kill(sig, &block)
150
- Timeout.timeout(wait) do
151
- read_stream(@out, &block)
174
+ begin
175
+ with_timeout(wait) do
176
+ read_stream(@out, &block)
177
+ end
178
+ rescue TimedOut, Errno::EIO # EIO is somewhat expected on Linux: http://stackoverflow.com/a/10306782
152
179
  end
153
- rescue Timeout::Error, Errno::EIO # Somewhat expected on Linux: http://stackoverflow.com/a/10306782
180
+ Process.wait(@pid, Process::WNOHANG)
154
181
  end
155
182
 
156
183
  def kill(sig)
@@ -1,3 +1,3 @@
1
1
  module Shipit
2
- VERSION = '0.9.0'
2
+ VERSION = '0.10.0'
3
3
  end
@@ -60,7 +60,7 @@ module Shipit
60
60
 
61
61
  test ":abort call abort! on the deploy" do
62
62
  @task = shipit_deploys(:shipit_running)
63
- @task.pid = 42
63
+ @task.ping
64
64
  post :abort, stack_id: @stack.to_param, id: @task.id
65
65
 
66
66
  @task.reload
@@ -71,7 +71,7 @@ module Shipit
71
71
 
72
72
  test ":abort schedule the rollback if `rollback` is present" do
73
73
  @task = shipit_deploys(:shipit_running)
74
- @task.pid = 42
74
+ @task.ping
75
75
  post :abort, stack_id: @stack.to_param, id: @task.id, rollback: 'true'
76
76
 
77
77
  @task.reload
Binary file
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20160324155046) do
14
+ ActiveRecord::Schema.define(version: 20160426155146) do
15
15
 
16
16
  create_table "api_clients", force: :cascade do |t|
17
17
  t.text "permissions", limit: 65535
@@ -187,6 +187,7 @@ ActiveRecord::Schema.define(version: 20160324155046) do
187
187
  add_index "tasks", ["rolled_up", "created_at", "status"], name: "index_tasks_on_rolled_up_and_created_at_and_status"
188
188
  add_index "tasks", ["since_commit_id"], name: "index_tasks_on_since_commit_id"
189
189
  add_index "tasks", ["stack_id"], name: "index_tasks_on_stack_id"
190
+ add_index "tasks", ["status", "stack_id", "allow_concurrency"], name: "index_active_tasks"
190
191
  add_index "tasks", ["type", "stack_id", "parent_id"], name: "index_tasks_by_stack_and_parent"
191
192
  add_index "tasks", ["type", "stack_id", "status"], name: "index_tasks_by_stack_and_status"
192
193
  add_index "tasks", ["until_commit_id"], name: "index_tasks_on_until_commit_id"
Binary file
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ trap('INT') do
4
+ puts "Recieved SIGINT, aborting."
5
+ exit 1
6
+ end
7
+
8
+ trap('TERM') do
9
+ puts "Recieved SIGTERM, aborting."
10
+ exit 1
11
+ end
12
+
13
+ puts "Sleeping for 10 seconds"
14
+ sleep 10
15
+ puts "I wasn't killed? WTF"
@@ -65,13 +65,13 @@ module Shipit
65
65
  end
66
66
 
67
67
  test "mark deploy as error if a command timeout" do
68
- Timeout.expects(:timeout).raises(Timeout::Error.new)
68
+ Command.any_instance.expects(:timed_out?).returns(true)
69
69
  Command.any_instance.expects(:terminate!)
70
70
  assert_nothing_raised do
71
71
  @job.perform(@deploy)
72
72
  end
73
- assert @deploy.reload.error?
74
- assert_includes @deploy.chunk_output, 'Timeout::Error'
73
+ assert_equal 'failed', @deploy.reload.status
74
+ assert_includes @deploy.chunk_output, 'TimedOut'
75
75
  end
76
76
 
77
77
  test "records stack support for rollbacks and fetching deployed revision" do
@@ -241,6 +241,7 @@ module Shipit
241
241
 
242
242
  test "transitioning to aborted schedule a rollback if required" do
243
243
  @deploy = shipit_deploys(:shipit_running)
244
+ @deploy.ping
244
245
  @deploy.pid = 42
245
246
  @deploy.abort!(rollback_once_aborted: true)
246
247
 
@@ -317,51 +318,37 @@ module Shipit
317
318
  assert_equal @user, @stack.lock_author
318
319
  end
319
320
 
320
- test "pid is persisted" do
321
- clone = Deploy.find(@deploy.id)
322
- assert_equal 42, clone.pid
323
- end
324
-
325
321
  test "abort! transition to `aborting`" do
322
+ @deploy.ping
326
323
  @deploy.abort!
327
324
  assert_equal 'aborting', @deploy.status
328
325
  end
329
326
 
330
327
  test "abort! schedule the rollback if `rollback_once_aborted` is true" do
331
328
  @deploy.abort!(rollback_once_aborted: true)
332
- assert @deploy.reload.rollback_once_aborted?
329
+ assert_predicate @deploy.reload, :rollback_once_aborted?
333
330
  end
334
331
 
335
- test "abort! sends a SIGTERM to the recorded PID" do
336
- Process.expects(:kill).with('TERM', @deploy.pid)
332
+ test "abort! record the abort order if the task is alive" do
333
+ @deploy.ping
334
+ aborts = []
335
+
337
336
  @deploy.abort!
338
- end
337
+ @deploy.should_abort? { |abort_count| aborts << abort_count }
338
+ assert_equal [1], aborts
339
339
 
340
- test "abort! still succeeds if the process is already dead" do
341
- Process.expects(:kill).with('TERM', @deploy.pid).raises(Errno::ESRCH)
342
- assert_nothing_raised do
343
- @deploy.abort!
344
- end
340
+ 3.times { @deploy.abort! }
341
+ @deploy.should_abort? { |abort_count| aborts << abort_count }
342
+ assert_equal [1, 2, 3, 4], aborts
345
343
  end
346
344
 
347
- test "abort! transition to `aborted` if the process is already dead" do
345
+ test "abort! mark the deploy as error if it isn't alive and isn't finished" do
348
346
  @deploy = shipit_deploys(:shipit_running)
349
- @deploy.pid = 42
350
-
351
- @deploy.abort!
352
- assert_equal 'aborting', @deploy.status
347
+ refute_predicate @deploy, :alive?
348
+ refute_predicate @deploy, :finished?
353
349
 
354
- Process.expects(:kill).with('TERM', @deploy.pid).raises(Errno::ESRCH)
355
350
  @deploy.abort!
356
- assert_equal 'aborted', @deploy.status
357
- end
358
-
359
- test "abort! bails out if the PID is nil" do
360
- Process.expects(:kill).never
361
- @deploy.pid = nil
362
- assert_nothing_raised do
363
- @deploy.abort!
364
- end
351
+ assert_predicate @deploy, :error?
365
352
  end
366
353
 
367
354
  test "destroy deletes the related output chunks" do
@@ -437,6 +424,12 @@ module Shipit
437
424
  assert_predicate @deploy, :flapping?
438
425
  end
439
426
 
427
+ test "#ping updates the task status key" do
428
+ refute_predicate @deploy, :alive?
429
+ @deploy.ping
430
+ assert_predicate @deploy, :alive?
431
+ end
432
+
440
433
  private
441
434
 
442
435
  def expect_event(deploy)
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = './fixtures/timeout'
4
+ buffer = []
5
+ command = Shipit::Command.new({path => {'timeout' => 2}}, env: {}, chdir: __dir__)
6
+ begin
7
+ command.stream! do |chunk|
8
+ buffer << chunk
9
+ end
10
+ rescue Shipit::Command::TimedOut
11
+ # expected
12
+ end
13
+
14
+ expected_output = [
15
+ "Sleeping for 10 seconds\r\n",
16
+ "\e[1;31mNo output received in the last 2 seconds.\e[0m\n",
17
+ "\e[1;31mSending SIGINT to PID #{command.pid}\n\e[0m",
18
+ "Recieved SIGINT, aborting.\r\n",
19
+ ]
20
+
21
+ unless buffer.join == expected_output.join
22
+ puts "Expected: -------"
23
+ puts expected_output.map(&:inspect).join("\n")
24
+ puts "Got: ------------"
25
+ puts buffer.map(&:inspect).join("\n")
26
+ puts "-----------------"
27
+ exit 1
28
+ end
@@ -39,11 +39,20 @@ module Shipit
39
39
  assert_equal 5, command.timeout
40
40
  end
41
41
 
42
- test "#timeout returnsthe command option timeout over the `default_timeout` if present" do
42
+ test "#timeout returns the command option timeout over the `default_timeout` if present" do
43
43
  command = Command.new({'cap $LANG deploy' => {'timeout' => 10}}, default_timeout: 5, env: {}, chdir: '.')
44
44
  assert_equal 10, command.timeout
45
45
  end
46
46
 
47
+ test "the process is properly terminated if it times out" do
48
+ # Minitest being run in an at_exit callback, signal handling etc is unreliable
49
+ assert system(
50
+ Engine.root.join('test/dummy/bin/rails').to_s,
51
+ 'runner',
52
+ Engine.root.join('test/test_command_integration.rb').to_s,
53
+ )
54
+ end
55
+
47
56
  test "command not found" do
48
57
  error = assert_raises Command::NotFound do
49
58
  Command.new('does-not-exist foo bar', env: {}, chdir: '.').run
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.9.0
4
+ version: 0.10.0
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-04-19 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -632,6 +632,7 @@ files:
632
632
  - db/migrate/20160303170913_create_shipit_commit_deployment_statuses.rb
633
633
  - db/migrate/20160303203940_add_encrypted_token_to_users.rb
634
634
  - db/migrate/20160324155046_add_started_at_and_ended_at_on_tasks.rb
635
+ - db/migrate/20160426155146_add_index_for_stack_active_task.rb
635
636
  - db/schema.rb
636
637
  - lib/shipit-engine.rb
637
638
  - lib/shipit.rb
@@ -709,34 +710,10 @@ files:
709
710
  - test/dummy/config/routes.rb
710
711
  - test/dummy/config/secrets.example.yml
711
712
  - test/dummy/config/secrets.yml
712
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/bar.txt
713
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/dkfdsf
714
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/dskjfsd
715
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/dslkjfjsdf
716
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/plopfizz
717
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/sd
718
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/sdkfjsdf
719
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/sdlfjsdfdsfj
720
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/sdlkfjsdlkfjsdlkfjdsfsdfksdfjsldkfjsdlkfjsdf
721
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/shipit.yml
722
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/toto.txt
723
- - test/dummy/data/stacks/byroot/junk/production/git/bar.txt
724
- - test/dummy/data/stacks/byroot/junk/production/git/dkfdsf
725
- - test/dummy/data/stacks/byroot/junk/production/git/dskjfsd
726
- - test/dummy/data/stacks/byroot/junk/production/git/dslkjfjsdf
727
- - test/dummy/data/stacks/byroot/junk/production/git/plopfizz
728
- - test/dummy/data/stacks/byroot/junk/production/git/sd
729
- - test/dummy/data/stacks/byroot/junk/production/git/sdkfjsdf
730
- - test/dummy/data/stacks/byroot/junk/production/git/sdlfjsdfdsfj
731
- - test/dummy/data/stacks/byroot/junk/production/git/sdlkfjsdlkfjsdlkfjdsfsdfksdfjsldkfjsdlkfjsdf
732
- - test/dummy/data/stacks/byroot/junk/production/git/shipit.yml
733
- - test/dummy/data/stacks/byroot/junk/production/git/toto.txt
734
- - test/dummy/data/stacks/byroot/test/production/git/README.md
735
713
  - test/dummy/db/development.sqlite3
736
714
  - test/dummy/db/schema.rb
737
715
  - test/dummy/db/seeds.rb
738
716
  - test/dummy/db/test.sqlite3
739
- - test/dummy/db/test.sqlite3-journal
740
717
  - test/dummy/public/404.html
741
718
  - test/dummy/public/422.html
742
719
  - test/dummy/public/500.html
@@ -758,6 +735,7 @@ files:
758
735
  - test/fixtures/shipit/tasks.yml
759
736
  - test/fixtures/shipit/teams.yml
760
737
  - test/fixtures/shipit/users.yml
738
+ - test/fixtures/timeout
761
739
  - test/helpers/api_helper.rb
762
740
  - test/helpers/fixture_aliases_helper.rb
763
741
  - test/helpers/hooks_helper.rb
@@ -797,6 +775,7 @@ files:
797
775
  - test/models/task_definitions_test.rb
798
776
  - test/models/team_test.rb
799
777
  - test/models/users_test.rb
778
+ - test/test_command_integration.rb
800
779
  - test/test_helper.rb
801
780
  - test/unit/command_test.rb
802
781
  - test/unit/commands_test.rb
@@ -883,34 +862,10 @@ test_files:
883
862
  - test/dummy/config/secrets.example.yml
884
863
  - test/dummy/config/secrets.yml
885
864
  - test/dummy/config.ru
886
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/bar.txt
887
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/dkfdsf
888
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/dskjfsd
889
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/dslkjfjsdf
890
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/plopfizz
891
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/sd
892
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/sdkfjsdf
893
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/sdlfjsdfdsfj
894
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/sdlkfjsdlkfjsdlkfjdsfsdfksdfjsldkfjsdlkfjsdf
895
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/shipit.yml
896
- - test/dummy/data/stacks/byroot/junk/production/deploys/83/toto.txt
897
- - test/dummy/data/stacks/byroot/junk/production/git/bar.txt
898
- - test/dummy/data/stacks/byroot/junk/production/git/dkfdsf
899
- - test/dummy/data/stacks/byroot/junk/production/git/dskjfsd
900
- - test/dummy/data/stacks/byroot/junk/production/git/dslkjfjsdf
901
- - test/dummy/data/stacks/byroot/junk/production/git/plopfizz
902
- - test/dummy/data/stacks/byroot/junk/production/git/sd
903
- - test/dummy/data/stacks/byroot/junk/production/git/sdkfjsdf
904
- - test/dummy/data/stacks/byroot/junk/production/git/sdlfjsdfdsfj
905
- - test/dummy/data/stacks/byroot/junk/production/git/sdlkfjsdlkfjsdlkfjdsfsdfksdfjsldkfjsdlkfjsdf
906
- - test/dummy/data/stacks/byroot/junk/production/git/shipit.yml
907
- - test/dummy/data/stacks/byroot/junk/production/git/toto.txt
908
- - test/dummy/data/stacks/byroot/test/production/git/README.md
909
865
  - test/dummy/db/development.sqlite3
910
866
  - test/dummy/db/schema.rb
911
867
  - test/dummy/db/seeds.rb
912
868
  - test/dummy/db/test.sqlite3
913
- - test/dummy/db/test.sqlite3-journal
914
869
  - test/dummy/public/404.html
915
870
  - test/dummy/public/422.html
916
871
  - test/dummy/public/500.html
@@ -933,6 +888,7 @@ test_files:
933
888
  - test/fixtures/shipit/tasks.yml
934
889
  - test/fixtures/shipit/teams.yml
935
890
  - test/fixtures/shipit/users.yml
891
+ - test/fixtures/timeout
936
892
  - test/helpers/api_helper.rb
937
893
  - test/helpers/fixture_aliases_helper.rb
938
894
  - test/helpers/hooks_helper.rb
@@ -972,6 +928,7 @@ test_files:
972
928
  - test/models/task_definitions_test.rb
973
929
  - test/models/team_test.rb
974
930
  - test/models/users_test.rb
931
+ - test/test_command_integration.rb
975
932
  - test/test_helper.rb
976
933
  - test/unit/command_test.rb
977
934
  - test/unit/commands_test.rb
@@ -1,32 +0,0 @@
1
- review:
2
- checklist:
3
- - Blah Blah
4
- checks:
5
- - echo 42
6
-
7
- deploy:
8
- variables:
9
- -
10
- name: REBUILD
11
- title: Force artifacts rebuild
12
- default: '0'
13
- pre:
14
- - echo pre
15
- override:
16
- - echo 1
17
- - env
18
- - sleep 10
19
- post:
20
- - echo post
21
-
22
- rollback:
23
- override:
24
- - echo done
25
-
26
-
27
- tasks:
28
- restart:
29
- action: Restart application
30
- description: Trigger the restart of both app and jobs servers
31
- steps:
32
- - cap $ENVIRONMENT deploy:restart
@@ -1,2 +0,0 @@
1
- foo
2
- sadsadasd
File without changes
@@ -1,32 +0,0 @@
1
- review:
2
- checklist:
3
- - Blah Blah
4
- checks:
5
- - echo 42
6
-
7
- deploy:
8
- variables:
9
- -
10
- name: REBUILD
11
- title: Force artifacts rebuild
12
- default: '0'
13
- pre:
14
- - echo pre
15
- override:
16
- - echo 1
17
- - env
18
- - sleep 10
19
- post:
20
- - echo post
21
-
22
- rollback:
23
- override:
24
- - echo done
25
-
26
-
27
- tasks:
28
- restart:
29
- action: Restart application
30
- description: Trigger the restart of both app and jobs servers
31
- steps:
32
- - cap $ENVIRONMENT deploy:restart
Binary file