capistrano-nomad 0.6.0 → 0.6.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f5358b24228c869a704b8ed79aa76d76b2aeb559ffcd7bd3bced8aa7d3281d1
4
- data.tar.gz: 95f8c93adc89fdbcffe9f40bc5d18433ccfc4b743cfcb194a2b7b2e9468f6bb5
3
+ metadata.gz: fd8143ad35ea4f16a890256e65a5a73fab979acd0e63fa5471e8c75248c5fad8
4
+ data.tar.gz: cdf8f7552d3512ea4968208690ec537040915e42a59b51aef4bd8c85c81e95a1
5
5
  SHA512:
6
- metadata.gz: 834ccd5183128e4c3b4bed1067457b1a2a0036ed21c8ca954f82f25298aca61d6a108460b22c17cbe9f2fa561e02e4189942ddb99d784792ed7422b70e05ba0f
7
- data.tar.gz: 1a4ade283a947f6243fb8c728ca3c3fcac55fac0471cad47b2fbabec66b66a7287fd342c29610bcad5a67d847a0251eb2ee66847ca27de449b963734d5a0d55d
6
+ metadata.gz: 52b3e33004964a0ea317bcd55478d02aa2088ded9c7df715be7119028588b9c3f848e63fd4fa8a85f3345c9e5203579428a71b79c3debfe16e5028b37183d477
7
+ data.tar.gz: f972389f3c4411a75162961f0545605ab87c92d6a81d4192db78e457bd320c8a87bccdcf3a61bb9f9e556c6f64d4b99cb3347752113951612edeb89b3fb9d2e4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-nomad (0.6.0)
4
+ capistrano-nomad (0.6.1)
5
5
  activesupport (<= 7.0.8)
6
6
  byebug
7
7
  capistrano (~> 3.0)
data/README.md CHANGED
@@ -34,10 +34,21 @@ install_plugin Capistrano::Nomad
34
34
  Within `deploy.rb`
35
35
 
36
36
  ```ruby
37
+ set :nomad_jobs_path, "nomad/jobs"
38
+ set :nomad_var_files_path, "nomad/vars"
39
+
40
+ # Accessible in all .erb files
41
+ set :nomad_erb_vars, (lambda do
42
+ {
43
+ env_name: fetch(:stage).to_sym,
44
+ domain: fetch(:domain),
45
+ foo: "bar,"
46
+ }
47
+ end)
37
48
 
38
49
  # Docker image types
39
- nomad_docker_image_type :app,
40
- path: "backend",
50
+ nomad_docker_image_type :backend,
51
+ path: "local/path/backend",
41
52
  alias: ->(image_type:) { "gcr.io/axsuul/#{image_type}" },
42
53
  target: "release",
43
54
  build_args: { foo: "bar" }
@@ -46,11 +57,13 @@ nomad_docker_image_type :redis,
46
57
  alias: "gcr.io/axsuul/redis"
47
58
 
48
59
  # Jobs
49
- nomad_job :app
60
+ nomad_job :frontend
61
+ nomad_job :backend, docker_image_types: [:backend], var_files: [:rails]
50
62
  nomad_job :redis, docker_image_types: [:redis]
51
63
 
52
64
  nomad_namespace :analytics do
53
65
  nomad_job :grafana
66
+ nomad_job :"node-exporter"
54
67
  end
55
68
  ```
56
69
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "capistrano-nomad"
5
- spec.version = "0.6.0"
5
+ spec.version = "0.6.1"
6
6
  spec.authors = ["James Hu"]
7
7
 
8
8
  spec.summary = "Capistrano plugin for deploying and managing Nomad jobs"
@@ -35,6 +35,10 @@ class CapistranoNomadErbNamespace
35
35
  # rubocop:enable Style/MissingRespondToMissing
36
36
  end
37
37
 
38
+ def capistrano_nomad_ensure_absolute_path(path)
39
+ path[0] == "/" ? path : "/#{path}"
40
+ end
41
+
38
42
  def capistrano_nomad_build_file_path(parent_path, basename, namespace: nil)
39
43
  segments = [parent_path]
40
44
  segments << namespace if namespace
@@ -71,11 +75,11 @@ def capistrano_nomad_build_local_var_file_path(name, *args)
71
75
  end
72
76
 
73
77
  def capistrano_nomad_build_release_job_path(*args)
74
- "#{release_path}#{capistrano_nomad_build_base_job_path(*args)}"
78
+ "#{release_path}#{capistrano_nomad_ensure_absolute_path(capistrano_nomad_build_base_job_path(*args))}"
75
79
  end
76
80
 
77
81
  def capistrano_nomad_build_release_var_file_path(*args)
78
- "#{release_path}#{capistrano_nomad_build_base_var_file_path(*args)}"
82
+ "#{release_path}#{capistrano_nomad_ensure_absolute_path(capistrano_nomad_build_base_var_file_path(*args))}"
79
83
  end
80
84
 
81
85
  def capistrano_nomad_run_nomad_command(kind, *args)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-nomad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Hu