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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/rascal/environment.rb +3 -3
- data/lib/rascal/environments_definition/gitlab.rb +9 -5
- data/lib/rascal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b74557df826ff38144441618c033febef78f16c3ed94f0e6cb83b0fd118b88a
|
4
|
+
data.tar.gz: c444bc107f91a0c09ec3129d408d30d64c0ec6b4900157e55f20e55002f0955b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/rascal/environment.rb
CHANGED
@@ -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(
|
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(
|
8
|
-
@container = Docker::Container.new(
|
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
|
-
|
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(
|
75
|
+
services: build_services(full_name, config.get('services', [])),
|
72
76
|
volumes: [
|
73
77
|
build_repo_volume(docker_repo_dir),
|
74
|
-
build_builds_volume(
|
75
|
-
*build_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,
|
data/lib/rascal/version.rb
CHANGED