Skip to content

Commit c24d74d

Browse files
author
Alan Christie
committed
Adds DM_INSTANCE_DIRECTORY to variables for decoding
1 parent 14e8556 commit c24d74d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

jote/compose.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import subprocess
1010
from typing import Any, Dict, Optional, Tuple
1111

12-
_INSTANCE_DIRECTORY: str = '.instance-88888888-8888-8888-8888-888888888888'
12+
INSTANCE_DIRECTORY: str = '.instance-88888888-8888-8888-8888-888888888888'
1313

1414
_COMPOSE_CONTENT: str = """---
1515
version: '2.4'
@@ -118,7 +118,7 @@ def create(self) -> str:
118118
# Make the test directory...
119119
test_path = self.get_test_path()
120120
project_path: str = self.get_test_project_path()
121-
inst_path: str = f'{project_path}/{_INSTANCE_DIRECTORY}'
121+
inst_path: str = f'{project_path}/{INSTANCE_DIRECTORY}'
122122
if not os.path.exists(inst_path):
123123
os.makedirs(inst_path)
124124

@@ -134,7 +134,7 @@ def create(self) -> str:
134134
'command': self._command,
135135
'project_directory': self._project_directory,
136136
'working_directory': self._working_directory,
137-
'instance_directory': _INSTANCE_DIRECTORY}
137+
'instance_directory': INSTANCE_DIRECTORY}
138138
compose_content: str = _COMPOSE_CONTENT.format(**variables)
139139
compose_path: str = f'{test_path}/docker-compose.yml'
140140
with open(compose_path, 'wt', encoding='UTF-8') as compose_file:

jote/jote.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from decoder import decoder
1717

18-
from .compose import get_test_root
18+
from .compose import get_test_root, INSTANCE_DIRECTORY
1919
from .compose import Compose
2020

2121
# Where can we expect to find Job definitions?
@@ -369,6 +369,11 @@ def _test(args: argparse.Namespace,
369369
input_files.append(value)
370370

371371
if test_status:
372+
373+
# Job variables must contain 'built-in' variables: -
374+
# - DM_INSTANCE_DIRECTORY
375+
job_variables['DM_INSTANCE_DIRECTORY'] = INSTANCE_DIRECTORY
376+
372377
# Get the raw (encoded) command from the job definition...
373378
raw_command: str = job_definition.command
374379
# Decode it using our variables...

0 commit comments

Comments
 (0)