shiplane 0.2.27 → 0.2.29

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: f9a0a4b3feca2d829d43782111be72f5fe294beca9f176e1d99d67467b819f6b
4
- data.tar.gz: 6d4e2040df19626fa869405c30823663d97f0415ed27efd25772b9022691f8c2
3
+ metadata.gz: b2ea5d4baf2676256974282972611a395344d73afccc81cff676560cd89f1410
4
+ data.tar.gz: 890da5156c4d5868acfc6e718aaff0258af6c7f1c24b042ea7f5590cb20d065e
5
5
  SHA512:
6
- metadata.gz: 3dd8875411035c466d62b107ad7c2cf06c3dfb2f2ea4f35afb0b5757d3e862cc3419a7a68f12e7d07410d15c0dfbc4eec0ae36aaa8f14c9b8238c556c18fd163
7
- data.tar.gz: 6a2ad04a745de00813a53f4e70c8badaf00cf8e9c8ea385fcda0a571cc55df87d7ba09980645950c3d8f73b0a2ed92c98be4d379beba3d38f1ca94cef5db86c7
6
+ metadata.gz: 0d02813438dbfbfd83b6681657a4bc54feeaadd423066041a05c2e045e707d0987505ba5249da9cba95408fee8f765482832fa397f5d01e3116f1f30e2b61e9d
7
+ data.tar.gz: 3b5fb0d6a04ccd3a56662bbc943362db2c9a0110229210365429d5f20229c2662f9c704ab43d5d1767eb27e8f9024b7c4d9e1b556639f101e60f17cb544d519e
@@ -5,6 +5,7 @@ require_relative 'checkout_artifact'
5
5
  require_relative 'convert_compose_file'
6
6
  require_relative 'convert_dockerfile'
7
7
  require_relative 'configuration'
8
+ require_relative 'safe_yaml_loading'
8
9
 
9
10
  module Shiplane
10
11
  class Build
@@ -139,7 +140,7 @@ module Shiplane
139
140
  end
140
141
 
141
142
  def docker_config
142
- @docker_config ||= YAML.load(File.new(docker_compose_filepath))
143
+ @docker_config ||= Shiplane::SafeYamlLoading.load_file(docker_compose_filepath)
143
144
  end
144
145
 
145
146
  def buildable_artifacts
@@ -1,4 +1,5 @@
1
1
  require_relative 'extensions'
2
+ require_relative 'safe_yaml_loading'
2
3
 
3
4
  module Shiplane
4
5
  class ComposeHash
@@ -14,7 +15,7 @@ module Shiplane
14
15
  end
15
16
 
16
17
  def compose_hash
17
- @compose_hash ||= YAML.load(compose_file)
18
+ @compose_hash ||= Shiplane::SafeYamlLoading.load(compose_file)
18
19
  end
19
20
 
20
21
  def whitelisted_hash
@@ -1,8 +1,10 @@
1
+ require_relative 'safe_yaml_loading'
2
+
1
3
  module Shiplane
2
4
  class Configuration
3
5
  attr_accessor :project_folder, :stage
4
6
 
5
- def initialize(project_folder: nil, stage: stage)
7
+ def initialize(project_folder: nil, stage: 'production')
6
8
  @project_folder = project_folder || Dir.pwd
7
9
  @stage = stage
8
10
  end
@@ -12,7 +14,7 @@ module Shiplane
12
14
  end
13
15
 
14
16
  def config
15
- @config ||= YAML.load_file(shiplane_config_file)
17
+ @config ||= Shiplane::SafeYamlLoading.load_file(shiplane_config_file)
16
18
  end
17
19
 
18
20
  def build_config
@@ -91,6 +91,7 @@ module Shiplane
91
91
  "--network=#{networks.first}",
92
92
  "--network-alias=#{network_alias}",
93
93
  virtual_host ? "-e VIRTUAL_HOST=#{virtual_host}" : nil,
94
+ "-e VIRTUAL_PORT=#{port}",
94
95
  letsencrypt_host ? "-e LETSENCRYPT_HOST=#{letsencrypt_host}" : nil,
95
96
  letsencrypt_email ? "-e LETSENCRYPT_EMAIL=#{letsencrypt_email}" : nil,
96
97
  environment.map{ |key, value| "-e #{key}=#{value}" },
data/lib/shiplane/host.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'sshkit'
2
2
  require 'sshkit/dsl'
3
3
 
4
+ require_relative 'safe_yaml_loading'
5
+
4
6
  module Shiplane
5
7
  class Host
6
8
  extend Forwardable
@@ -82,7 +84,7 @@ module Shiplane
82
84
  end
83
85
 
84
86
  def self.config
85
- @config ||= YAML.load(File.read(config_filepath))
87
+ @config ||= Shiplane::SafeYamlLoading.load_file(config_filepath)
86
88
  end
87
89
 
88
90
  def self.config_filepath
@@ -0,0 +1,23 @@
1
+ require 'yaml'
2
+
3
+ module Shiplane
4
+ class SafeYamlLoading
5
+ def self.load_file(filepath)
6
+ load(File.read(filepath))
7
+ end
8
+
9
+ def self.load_with_aliases(yaml)
10
+ YAML.load(yaml, aliases: true)
11
+ end
12
+
13
+ def self.load_without_aliases(yaml)
14
+ YAML.load(yaml)
15
+ end
16
+
17
+ if Psych && Gem::Version.new(Psych::VERSION) > Gem::Version.new("4.0.0")
18
+ define_singleton_method :load, method(:load_with_aliases)
19
+ else
20
+ define_singleton_method :load, method(:load_without_aliases)
21
+ end
22
+ end
23
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shiplane
4
- VERSION = "0.2.27"
4
+ VERSION = "0.2.29"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiplane
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.27
4
+ version: 0.2.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Epperson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-01 00:00:00.000000000 Z
11
+ date: 2024-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shiplane_bootstrappers_chef
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.27
19
+ version: 0.2.29
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.27
26
+ version: 0.2.29
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: shiplane_deployers_capistrano_docker
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.27
33
+ version: 0.2.29
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.2.27
40
+ version: 0.2.29
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dotenv
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,7 @@ files:
150
150
  - lib/shiplane/host.rb
151
151
  - lib/shiplane/railtie.rb
152
152
  - lib/shiplane/safe_build.rb
153
+ - lib/shiplane/safe_yaml_loading.rb
153
154
  - lib/shiplane/tasks/install.rake
154
155
  - lib/shiplane/version.rb
155
156
  homepage: https://github.com/kirillian/shiplane
@@ -164,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
165
  requirements:
165
166
  - - ">="
166
167
  - !ruby/object:Gem::Version
167
- version: 2.3.1
168
+ version: 2.6.0
168
169
  required_rubygems_version: !ruby/object:Gem::Requirement
169
170
  requirements:
170
171
  - - ">="