rascal 0.2.0 → 0.2.1

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: 5cac8b4564154cac2c8e002da1cb8e2874509331ad381cb6b8cc60b196954ab0
4
- data.tar.gz: a577bd8374a055453a3db8a73bf211d69973fcab2fe74a3117aadd56149e644a
3
+ metadata.gz: 4b74557df826ff38144441618c033febef78f16c3ed94f0e6cb83b0fd118b88a
4
+ data.tar.gz: c444bc107f91a0c09ec3129d408d30d64c0ec6b4900157e55f20e55002f0955b
5
5
  SHA512:
6
- metadata.gz: 7d0770a88072f36e7848b0fb46ef11599e32759d3c1e17b0de8eebb2fd298b32a97f7aedc9ea191e4d996bddc27d12b313457a5adba7905465b03e68fd11fa87
7
- data.tar.gz: 2113fab40ec414ce8d724a7cf34ef94f12246f7f93d4a6509b32292c6757b96e2993286c69ba53a155bb7a1485ab5fe3a39b5d41abcd40d9763f4c7b44b0c25b
6
+ metadata.gz: 74561bcdaae8dc49c4655717fde4c85c4203a917ce599301a50ae35fd06f7d15ded38ac6707d48471bb2a82312831600a11c67c00dc3adf639bb46d331178499
7
+ data.tar.gz: 83bd4ea1b2cbd7d19382cb068772d0cc08117763ea06f34d471c7765259d6de62088f23744fcb639ba599de36491e260070945a3208fa9d0ce2502d98049d8e1
data/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to this project will be documented here.
5
5
  Rascal follows semantic versioning. This has little consequence pre 1.0, so expect breaking changes.
6
6
 
7
7
 
8
+ ## 0.2.1 (2019-04-10)
9
+
10
+ - Prefix names with directory name, to avoid conflicts between projects.
11
+
12
+
8
13
  ## 0.2.0 (2019-04-10)
9
14
 
10
15
  - Add `--all` flag for `rascal clean`.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rascal (0.2.0)
4
+ rascal (0.2.1)
5
5
  thor (~> 0.20.3)
6
6
 
7
7
  GEM
@@ -2,10 +2,10 @@ module Rascal
2
2
  class Environment
3
3
  attr_reader :name, :network, :container, :env_variables, :services, :volumes, :working_dir, :before_shell
4
4
 
5
- def initialize(name, image:, env_variables: {}, services: [], volumes: [], before_shell: [], working_dir: nil)
5
+ def initialize(full_name, name:, image:, env_variables: {}, services: [], volumes: [], before_shell: [], working_dir: nil)
6
6
  @name = name
7
- @network = Docker::Network.new(name)
8
- @container = Docker::Container.new(name, image)
7
+ @network = Docker::Network.new(full_name)
8
+ @container = Docker::Container.new(full_name, image)
9
9
  @env_variables = env_variables
10
10
  @services = services
11
11
  @volumes = volumes
@@ -35,6 +35,7 @@ module Rascal
35
35
  def initialize(config_path)
36
36
  @info = parse_definition(config_path.read)
37
37
  @repo_dir = config_path.parent
38
+ @base_name = @repo_dir.basename
38
39
  @rascal_config = @info.fetch('.rascal', {})
39
40
  @rascal_environment_config = @rascal_config.delete('jobs') || {}
40
41
  end
@@ -64,15 +65,18 @@ module Rascal
64
65
  @info.collect do |key, environment_config|
65
66
  config = Config.new(deep_merge(environment_config, @rascal_config, @rascal_environment_config[key] || {}), key)
66
67
  docker_repo_dir = config.get('repo_dir', '/repo')
67
- unless key.start_with?('.')
68
- Environment.new(key,
68
+ unless key.start_with?('.') || config.get('hide', false)
69
+ name = config.get('name', key)
70
+ full_name = "#{@base_name}-#{name}"
71
+ Environment.new(full_name,
72
+ name: name,
69
73
  image: config.get('image'),
70
74
  env_variables: (config.get('variables', {})),
71
- services: build_services(key, config.get('services', [])),
75
+ services: build_services(full_name, config.get('services', [])),
72
76
  volumes: [
73
77
  build_repo_volume(docker_repo_dir),
74
- build_builds_volume(key),
75
- *build_volumes(key, config.get('volumes', {}))
78
+ build_builds_volume(full_name),
79
+ *build_volumes(full_name, config.get('volumes', {}))
76
80
  ],
77
81
  before_shell: config.get('before_shell', []),
78
82
  working_dir: docker_repo_dir,
@@ -1,3 +1,3 @@
1
1
  module Rascal
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rascal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze