capistrano-nomad 0.8.5 → 0.8.6

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: b641a6e0ac6d6778ee9fdf8a853064af0ee786a030d22f423d3dc8074631353a
4
- data.tar.gz: b0d9915430395e20e39c42911c9c4932c5ec7b7def2375241d7504cdc9186666
3
+ metadata.gz: 38466c64a01144c2504b25cffc4d0a504323d8426a6d266b8596afbde174cc3b
4
+ data.tar.gz: 4f1921130d34135d6399dc66014ae09fef023a32d468729c001da69b46677b6f
5
5
  SHA512:
6
- metadata.gz: 3dedf6b7a506bae167292287bc837cdadf510fcd94ff7eec752ca42c8c0a0f0a48ccc8e606fed1923e5c20d2a0223a9fef7c7852ebee229fc40e4fc4593d2d8a
7
- data.tar.gz: '0208bde44339dfa1847e8f98eb059d48aea510e3eb4fb9e749eded6fa761478976d5bd07974af1550d396c90bdf233390168a948e47476cc7b5c076a287d1e37'
6
+ metadata.gz: b19ed0fa9f0bd9f69b2679b26d282f2263307313b6376f95f32e65eb7ba08b7645e93d3e83232718a05abd5e8fc4ad378ba301d59a0fa6605cf0b5a30d08ffbf
7
+ data.tar.gz: 9ea11f2baf2ba068b5150b0294dfbba1142e5a89bdec74fa692e338cc02f05a1bbb313633e80d496f7f0b4350f14a4659003c4e1c9be41339c45c3b2381c7799
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-nomad (0.8.5)
4
+ capistrano-nomad (0.8.6)
5
5
  activesupport (<= 7.0.8)
6
6
  byebug
7
7
  capistrano (~> 3.0)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "capistrano-nomad"
5
- spec.version = "0.8.5"
5
+ spec.version = "0.8.6"
6
6
  spec.authors = ["James Hu"]
7
7
 
8
8
  spec.summary = "Capistrano plugin for deploying and managing Nomad jobs"
@@ -4,6 +4,10 @@ def capistrano_nomad_git
4
4
  @capistrano_nomad_git ||= Git.open(".")
5
5
  end
6
6
 
7
+ def capistrano_nomad_git_commit
8
+ @capistrano_nomad_git_commit ||= capistrano_nomad_git.log.first
9
+ end
10
+
7
11
  def capistrano_nomad_git_commit_id
8
- @capistrano_nomad_git_commit_id ||= capistrano_nomad_git.log.first.sha
12
+ @capistrano_nomad_git_commit_id ||= capistrano_nomad_git_commit.sha
9
13
  end
@@ -325,6 +325,20 @@ def capistrano_nomad_define_group_tasks(namespace:)
325
325
  end
326
326
  end
327
327
 
328
+ desc "Restart #{namespace} jobs"
329
+ task :restart do
330
+ capistrano_nomad_fetch_jobs_names_by_namespace(namespace: namespace).each do |namespace_by, names|
331
+ capistrano_nomad_restart_jobs(names, namespace: namespace_by)
332
+ end
333
+ end
334
+
335
+ desc "Stop #{namespace} jobs"
336
+ task :stop do
337
+ capistrano_nomad_fetch_jobs_names_by_namespace(namespace: namespace).each do |namespace_by, names|
338
+ capistrano_nomad_stop_jobs(names, namespace: namespace_by)
339
+ end
340
+ end
341
+
328
342
  desc "Purge #{namespace} jobs"
329
343
  task :purge do
330
344
  capistrano_nomad_fetch_jobs_names_by_namespace(namespace: namespace).each do |namespace_by, names|
@@ -453,15 +467,15 @@ def capistrano_nomad_deploy_jobs(names, **options)
453
467
  capistrano_nomad_upload_run_jobs(names, **general_options.merge(options))
454
468
  end
455
469
 
456
- def capistrano_nomad_stop_jobs(names, **options)
470
+ def capistrano_nomad_restart_jobs(names, **options)
457
471
  names.each do |name|
458
- capistrano_nomad_execute_nomad_command(:job, :stop, options, name)
472
+ capistrano_nomad_execute_nomad_command(:job, :restart, options, name)
459
473
  end
460
474
  end
461
475
 
462
- def capistrano_nomad_restart_jobs(names, **options)
476
+ def capistrano_nomad_stop_jobs(names, **options)
463
477
  names.each do |name|
464
- capistrano_nomad_execute_nomad_command(:job, :restart, options, name)
478
+ capistrano_nomad_execute_nomad_command(:job, :stop, options, name)
465
479
  end
466
480
  end
467
481
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-nomad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Hu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-16 00:00:00.000000000 Z
11
+ date: 2024-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport