capistrano-nomad 0.4.1 → 0.4.2

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: 8e086bb0968563ebe8bc50d27aeae5fbf26c91c484e6bb4ff3774e06da3d013a
4
- data.tar.gz: 190a466a7334240004d6e7ed7056555ad3872a331e22b2745124fb7394e166ec
3
+ metadata.gz: 02c77eac2e5164a6644400d4eca6b03b57dffac252ad90d224f3b2c184bbda6c
4
+ data.tar.gz: da268efd0e1118b5fab7b1190469b3b3154221dfedf641a4f2fd41b416f9cb94
5
5
  SHA512:
6
- metadata.gz: 74a497827c062c431a59a9b102e4a1f6a3cb4a8c47a700c1acd2f6e6b3591c78aad734867dc649da9b0f616021949bdd9e69cc8031481086d29c7e0e9380d1b7
7
- data.tar.gz: f765b3cf57ddf929bf1fb324218be5e093e9709f9bb56a3aef1c8ede338f33c5bbdcbe6c14b9a884fa046680164d9739c23c42fa2b27a843cf87f86b06e17fd6
6
+ metadata.gz: c5b1c53a098c84fa455ed9774376fe646a154436e96d2807050b0cb510484073d7993040571ba231f547478e4a43ee3f105690d7899f8f6a38dac3992567e88f
7
+ data.tar.gz: a3936fbea10215f136ef8630d5ca0d8253991af7bf16d02b5a7d1615eeaaa11fc6ed38376608a0cfe21b301d34d245196adb5941749fad885f2d574bbd2f523d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-nomad (0.4.1)
4
+ capistrano-nomad (0.4.2)
5
5
  activesupport (<= 7.0.8)
6
6
  byebug
7
7
  capistrano (~> 3.0)
data/README.md CHANGED
@@ -42,7 +42,7 @@ nomad_namespace :analytics do
42
42
  end
43
43
  ```
44
44
 
45
- Utilize tasks
45
+ Deploy with
46
46
 
47
47
  ```shell
48
48
  cap production nomad:app:deploy
@@ -50,6 +50,14 @@ cap production nomad:redis:purge
50
50
  cap production nomad:analytics:grafana:deploy
51
51
  ```
52
52
 
53
+ Open console with
54
+
55
+ ```shell
56
+ cap production nomad:app:console
57
+ cap production nomad:app:console TASK=custom-task-name
58
+ cap production nomad:analytics:grafana:console
59
+ ```
60
+
53
61
  ## Development
54
62
 
55
63
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "capistrano-nomad"
5
- spec.version = "0.4.1"
5
+ spec.version = "0.4.2"
6
6
  spec.authors = ["James Hu"]
7
7
 
8
8
  spec.summary = "Capistrano plugin for deploying and managing Nomad jobs"
@@ -107,9 +107,9 @@ def nomad_job(name, attributes = {})
107
107
  end
108
108
  end
109
109
 
110
- desc "Open console to #{description_name} job"
110
+ desc "Open console to #{description_name} job. Specify task by passing TASK environment variable"
111
111
  task :console do
112
- capistrano_nomad_exec_within_job(name, "/bin/bash", namespace: namespace)
112
+ capistrano_nomad_exec_within_job(name, "/bin/bash", namespace: namespace, task: ENV["TASK"].presence)
113
113
  end
114
114
  end
115
115
  end
@@ -105,8 +105,14 @@ def capistrano_nomad_execute_nomad_command(*args)
105
105
  end
106
106
  end
107
107
 
108
- def capistrano_nomad_exec_within_job(name, command, namespace: nil)
109
- capistrano_nomad_execute_nomad_command(:alloc, :exec, { namespace: namespace, task: name, job: true }, name, command)
108
+ def capistrano_nomad_exec_within_job(name, command, namespace: nil, task: nil)
109
+ capistrano_nomad_execute_nomad_command(
110
+ :alloc,
111
+ :exec,
112
+ { namespace: namespace, task: task || name, job: true },
113
+ name,
114
+ command,
115
+ )
110
116
  end
111
117
 
112
118
  def capistrano_nomad_upload_file(local_path:, remote_path:, erb_vars: {})
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Hu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-11 00:00:00.000000000 Z
11
+ date: 2023-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport