rascal 0.3.4 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -2
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +1 -1
- data/lib/rascal/docker/container.rb +2 -2
- data/lib/rascal/docker/network.rb +11 -0
- data/lib/rascal/environments_definition/gitlab.rb +5 -2
- data/lib/rascal/service.rb +3 -0
- data/lib/rascal/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f92bdd23479cecc48f349ccb23ce53c4c32ca33dea4e97a5cd7b7b9c58408b9d
|
4
|
+
data.tar.gz: 0aab44c7aa2484fd17978dae087687121e5028310e987e87cbcd1d9b973eea78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3051a125f2d14e157df31862e80d40a79866ed8cd696c09f11b57dc9270d4c6590683e1ec5c067c72f950696c9c49a41c48d65733c90064379df46c3c6b9c9d8
|
7
|
+
data.tar.gz: b599dde61ea3d335e0931405b8057069db656af5551369bc13969ab78106efb7bd3ea0f745130b75f934dd51e7d84e629c34b71624d822de5e27a5d9f944d067
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented here.
|
|
4
4
|
|
5
5
|
Rascal follows semantic versioning. This has little consequence pre 1.0, so expect breaking changes.
|
6
6
|
|
7
|
+
## 0.3.6 (2023-01-27)
|
8
|
+
|
9
|
+
- Handle `default:` blocks in .gitlab-ci.yml.
|
10
|
+
|
11
|
+
|
12
|
+
## 0.3.5 (2022-12-21)
|
13
|
+
|
14
|
+
- Fix the "endpoint ... already exists in network" error.
|
15
|
+
|
16
|
+
|
7
17
|
## 0.3.4 (2022-03-16)
|
8
18
|
|
9
19
|
- Activate Rubygems MFA
|
data/Gemfile.lock
CHANGED
@@ -112,8 +112,6 @@ module Rascal
|
|
112
112
|
@image
|
113
113
|
end
|
114
114
|
|
115
|
-
private
|
116
|
-
|
117
115
|
def id
|
118
116
|
@id ||= Docker.interface.run(
|
119
117
|
'container',
|
@@ -125,6 +123,8 @@ module Rascal
|
|
125
123
|
)
|
126
124
|
end
|
127
125
|
|
126
|
+
private
|
127
|
+
|
128
128
|
def image_exists?
|
129
129
|
Docker.interface.run(
|
130
130
|
'image',
|
@@ -14,6 +14,17 @@ module Rascal
|
|
14
14
|
)
|
15
15
|
end
|
16
16
|
|
17
|
+
def disconnect(container_id)
|
18
|
+
Docker.interface.run(
|
19
|
+
'network',
|
20
|
+
'disconnect',
|
21
|
+
id,
|
22
|
+
container_id,
|
23
|
+
)
|
24
|
+
rescue Interface::Error => e
|
25
|
+
raise unless e.message.include?('is not connected')
|
26
|
+
end
|
27
|
+
|
17
28
|
def exists?
|
18
29
|
!!id
|
19
30
|
end
|
@@ -3,6 +3,8 @@ require 'yaml'
|
|
3
3
|
module Rascal
|
4
4
|
module EnvironmentsDefinition
|
5
5
|
class Gitlab
|
6
|
+
DEFAULT_KEY = 'default'.freeze
|
7
|
+
|
6
8
|
class << self
|
7
9
|
def detect(path)
|
8
10
|
if path.directory?
|
@@ -62,10 +64,11 @@ module Rascal
|
|
62
64
|
|
63
65
|
def environments
|
64
66
|
@environments ||= begin
|
67
|
+
default_config = @info.fetch(DEFAULT_KEY, {})
|
65
68
|
@info.collect do |key, environment_config|
|
66
|
-
config = Config.new(deep_merge(environment_config, @rascal_config, @rascal_environment_config[key] || {}), key)
|
69
|
+
config = Config.new(deep_merge(environment_config, default_config, @rascal_config, @rascal_environment_config[key] || {}), key)
|
67
70
|
docker_repo_dir = config.get('repo_dir', '/repo')
|
68
|
-
unless key.start_with?('.') || config.get('hide', false)
|
71
|
+
unless key.start_with?('.') || config.get('hide', false) || key == DEFAULT_KEY
|
69
72
|
name = config.get('name', key)
|
70
73
|
full_name = "#{@base_name}-#{name}"
|
71
74
|
shared_volumes = [build_repo_volume(docker_repo_dir), build_builds_volume(full_name)]
|
data/lib/rascal/service.rb
CHANGED
@@ -17,6 +17,9 @@ module Rascal
|
|
17
17
|
|
18
18
|
def start_if_stopped(network: nil)
|
19
19
|
unless @container.running?
|
20
|
+
if (container_id = @container.id)
|
21
|
+
network.disconnect(container_id)
|
22
|
+
end
|
20
23
|
@container.start(network: network, network_alias: @alias, volumes: @volumes, env: @env_variables, command: @command)
|
21
24
|
end
|
22
25
|
end
|
data/lib/rascal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rascal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
|
-
rubygems_version: 3.3.
|
95
|
+
rubygems_version: 3.3.22
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Spin up CI environments locally.
|