ScriptCollection 4.4.63__py3-none-any.whl → 4.4.65__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ScriptCollection/AgentRunner.py +12 -5
- ScriptCollection/Executables.py +9 -4
- ScriptCollection/ScriptCollectionCore.py +1 -1
- ScriptCollection/TFCPS/PlantUMLRenderer.py +1 -1
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py +105 -10
- ScriptCollection/TFCPS/TFCPS_MergeToStable.py +1 -1
- {scriptcollection-4.4.63.dist-info → scriptcollection-4.4.65.dist-info}/METADATA +1 -1
- {scriptcollection-4.4.63.dist-info → scriptcollection-4.4.65.dist-info}/RECORD +11 -11
- {scriptcollection-4.4.63.dist-info → scriptcollection-4.4.65.dist-info}/WHEEL +0 -0
- {scriptcollection-4.4.63.dist-info → scriptcollection-4.4.65.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.4.63.dist-info → scriptcollection-4.4.65.dist-info}/top_level.txt +0 -0
ScriptCollection/AgentRunner.py
CHANGED
|
@@ -38,18 +38,26 @@ class AgentRunner:
|
|
|
38
38
|
self.verbose = verbose
|
|
39
39
|
|
|
40
40
|
@GeneralUtilities.check_arguments
|
|
41
|
-
def run(self, prompt: str, interactive: bool, repository: str, configuration_overrides: AgentRunnerConfiguration, additional_folders: list[str]) -> int:
|
|
41
|
+
def run(self, prompt: str, interactive: bool, repository: str, configuration_overrides: AgentRunnerConfiguration, additional_folders: list[str], mount_docker_socket: bool) -> int:
|
|
42
42
|
# Returns the exit-code of the container, which is the exit-code of the initialization-script if it failed and the exit-code of the agent otherwise.
|
|
43
43
|
# In interactive mode the prompt is optional: without a prompt the agent is started without an initial instruction and the user can instruct it interactively.
|
|
44
44
|
# Every value of configuration_overrides which is not None overrides the corresponding value from the configuration-file.
|
|
45
45
|
# additional_folders are absolute host-folders which are additionally mounted (read-write) under "/Workspace/Other/AdditionalResources/<folder-name>".
|
|
46
|
+
# mount_docker_socket is deliberately not part of the configuration-file: it must be a conscious decision for every single run (see __print_docker_socket_warning).
|
|
46
47
|
GeneralUtilities.assert_condition(interactive or prompt is not None, "A prompt is required when the agent is not run in interactive mode.")
|
|
47
48
|
self.__assert_is_git_root_dir(repository)
|
|
48
49
|
agentRunnerConfiguration: AgentRunnerConfiguration = self.__load_configuration(repository, configuration_overrides)
|
|
49
50
|
initialization_script = self.__get_initialization_script(repository)
|
|
50
51
|
additional_folder_volume_arguments = self.__get_additional_folder_volume_arguments(additional_folders)
|
|
52
|
+
if mount_docker_socket:
|
|
53
|
+
self.__print_docker_socket_warning()
|
|
54
|
+
additional_folder_volume_arguments = additional_folder_volume_arguments + ["--volume", "/var/run/docker.sock:/var/run/docker.sock"]
|
|
51
55
|
return self.__run_sandbox(repository, agentRunnerConfiguration, prompt, interactive, initialization_script, additional_folder_volume_arguments)
|
|
52
56
|
|
|
57
|
+
@GeneralUtilities.check_arguments
|
|
58
|
+
def __print_docker_socket_warning(self) -> None:
|
|
59
|
+
GeneralUtilities.write_message_to_stderr("Warning: Mounting the docker-socket of the host into the sandbox is dangerous because it makes the sandbox ineffective.")
|
|
60
|
+
|
|
53
61
|
@GeneralUtilities.check_arguments
|
|
54
62
|
def __get_additional_folder_volume_arguments(self, additional_folders: list[str]) -> list[str]:
|
|
55
63
|
# Every additional folder is mounted under "/Workspace/Other/AdditionalResources/<folder-name>" (preserving the folder-name).
|
|
@@ -131,11 +139,10 @@ class AgentRunner:
|
|
|
131
139
|
agent_command = self.__get_agent_command(agentRunnerConfiguration.codingagent, prompt, interactive)
|
|
132
140
|
# The entrypoint is always used: if an initialization-script is present it runs it first, and then always starts the agent.
|
|
133
141
|
entrypoint_script_content = self.__get_entrypoint_script_content(agent_command, initialization_script)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
try:
|
|
142
|
+
with tempfile.NamedTemporaryFile("w", suffix=".sh", delete=False, newline="\n", encoding="utf-8") as entrypoint_file_handle:
|
|
143
|
+
host_entrypoint_file = entrypoint_file_handle.name
|
|
137
144
|
entrypoint_file_handle.write(entrypoint_script_content)
|
|
138
|
-
|
|
145
|
+
try:
|
|
139
146
|
# Make the entrypoint-script executable (chmod +x). On Linux-/macOS-hosts the execute-bit propagates into the container; on Windows-hosts this has no effect, which is why the script is additionally invoked via "sh" below.
|
|
140
147
|
os.chmod(host_entrypoint_file, 0o755)
|
|
141
148
|
docker_command = ["docker", "run", "--rm"]
|
ScriptCollection/Executables.py
CHANGED
|
@@ -26,8 +26,9 @@ def RunAgentInSandbox() -> int:
|
|
|
26
26
|
parser.add_argument('-v', '--verbose', action='store_true', required=False, default=False, help='Enables verbose output.')
|
|
27
27
|
parser.add_argument('-c', '--codingagent', default=None, required=False, choices=[coding_agent.value for coding_agent in CodingAgent], help='Coding-agent which should be used. Overrides the value from ".ScriptCollection/AgentSandboxConfiguration.ini".')
|
|
28
28
|
parser.add_argument('--image', default=None, required=False, help='OCI-image which should be used for the sandbox: either an image-name defined in ".ScriptCollection/OCIImages/ImageDefinition.csv" or an image-address including tag. Overrides the value from ".ScriptCollection/AgentSandboxConfiguration.ini".')
|
|
29
|
-
parser.add_argument('--dropcapabilities', default=None, required=False, choices=["true", "false"], help='Defines whether all capabilities should be dropped in the sandbox. Overrides the value from ".ScriptCollection/AgentSandboxConfiguration.ini".')
|
|
29
|
+
parser.add_argument('-s','--dropcapabilities', default=None, required=False, choices=["true", "false"], help='Defines whether all capabilities should be dropped in the sandbox. Overrides the value from ".ScriptCollection/AgentSandboxConfiguration.ini".')
|
|
30
30
|
parser.add_argument('-a', '--additionalfolder', action='append', default=None, required=False, help='Folder which should additionally be mounted (read-write) into the sandbox under "/Workspace/Other/AdditionalResources/<folder-name>". Can be given multiple times.')
|
|
31
|
+
parser.add_argument('-d','--mountdockersocket', action='store_true', required=False, default=False, help='Mounts the docker-socket of the host (/var/run/docker.sock) into the sandbox so that the agent can use docker. DANGEROUS: this effectively gives the agent administrator-access to the docker-daemon of the host and makes the restrictions of the sandbox ineffective. Can only be set via this argument (not in the configuration-file); a warning is printed to stderr.')
|
|
31
32
|
args = parser.parse_args()
|
|
32
33
|
repo=os.getcwd()
|
|
33
34
|
if args.repository is not None:
|
|
@@ -43,7 +44,7 @@ def RunAgentInSandbox() -> int:
|
|
|
43
44
|
if args.additionalfolder is not None:
|
|
44
45
|
additional_folders = [GeneralUtilities.resolve_relative_path(additional_folder, os.getcwd()) for additional_folder in args.additionalfolder]
|
|
45
46
|
ar = AgentRunner(args.verbose)
|
|
46
|
-
return ar.run(args.prompt, args.interactive, repo, configuration_overrides, additional_folders)
|
|
47
|
+
return ar.run(args.prompt, args.interactive, repo, configuration_overrides, additional_folders, args.mountdockersocket)
|
|
47
48
|
|
|
48
49
|
|
|
49
50
|
def FilenameObfuscator() -> int:
|
|
@@ -359,11 +360,13 @@ def UpdateDependencies() -> int:
|
|
|
359
360
|
parser.add_argument("-n",'--nocache', required=False, default=False, action='store_true')
|
|
360
361
|
parser.add_argument('-c','--runincontainer', required=False, default=False, action='store_true')
|
|
361
362
|
parser.add_argument('-b','--basemountfolder', required=False, default=None, help="Only used if -c is set.")
|
|
363
|
+
parser.add_argument('-m','--addreadytomergeflag', required=False, default=False, action='store_true')
|
|
364
|
+
parser.add_argument('-f','--fastlane', required=False, default=False, action='store_true', help="Skips running RunTestcases.py")
|
|
362
365
|
args = parser.parse_args()
|
|
363
366
|
|
|
364
367
|
verbosity=LogLevel(int(args.verbosity))
|
|
365
368
|
repo:str=GeneralUtilities.resolve_relative_path(args.repositoryfolder,os.getcwd())
|
|
366
|
-
t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,False,False)
|
|
369
|
+
t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,False,False,args.addreadytomergeflag,args.fastlane)
|
|
367
370
|
if args.runincontainer:
|
|
368
371
|
base_mount_folder:str=args.basemountfolder
|
|
369
372
|
if base_mount_folder is None:
|
|
@@ -405,12 +408,14 @@ def UpdateDependenciesC() -> int:
|
|
|
405
408
|
parser.add_argument('--additionalargumentsfile', required=False, default=None)
|
|
406
409
|
parser.add_argument("-n",'--nocache', required=False, default=False, action='store_true')
|
|
407
410
|
parser.add_argument('-b','--basemountfolder', required=False, default=None)
|
|
411
|
+
parser.add_argument('-m','--addreadytomergeflag', required=False, default=False, action='store_true')
|
|
412
|
+
parser.add_argument('-f','--fastlane', required=False, default=False, action='store_true', help="Skips running RunTestcases.py")
|
|
408
413
|
args = parser.parse_args()
|
|
409
414
|
|
|
410
415
|
GeneralUtilities.reconfigure_standard_input_and_outputs()
|
|
411
416
|
repo:str=GeneralUtilities.resolve_relative_path(args.repositoryfolder,os.getcwd())
|
|
412
417
|
verbosity=LogLevel(int(args.verbosity))
|
|
413
|
-
t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,False,False)
|
|
418
|
+
t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,False,False,args.addreadytomergeflag,args.fastlane)
|
|
414
419
|
base_mount_folder:str=args.basemountfolder
|
|
415
420
|
if base_mount_folder is None:
|
|
416
421
|
base_mount_folder=t.get_default_base_mount_folder()
|
|
@@ -133,7 +133,7 @@ class PlantUMLRenderer:
|
|
|
133
133
|
if GeneralUtilities.current_system_is_windows():
|
|
134
134
|
return []
|
|
135
135
|
# "getuid"/"getgid" do not exist on windows, which is why they are only reached below that check; pylint
|
|
136
|
-
#
|
|
136
|
+
# analyzes this file on windows as well and does not see that.
|
|
137
137
|
return ["--user", f"{os.getuid()}:{os.getgid()}"] # pylint: disable=no-member
|
|
138
138
|
|
|
139
139
|
@GeneralUtilities.check_arguments
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import json
|
|
3
3
|
import re
|
|
4
|
+
import shutil
|
|
5
|
+
import tempfile
|
|
4
6
|
from datetime import datetime, timedelta,timezone
|
|
5
7
|
import xmlschema
|
|
6
8
|
from packaging.version import Version
|
|
@@ -198,12 +200,13 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
198
200
|
hook.run_after_codeunit_was_built(tFCPS_CodeUnit_BuildCodeUnit)
|
|
199
201
|
self.sc.log.log(GeneralUtilities.get_line())
|
|
200
202
|
|
|
201
|
-
self.search_for_secrets()
|
|
202
203
|
self.tfcps_tools_general.generate_svg_files_from_plantuml_files_for_repository(self.repository, self.use_cache())
|
|
203
204
|
self.tfcps_tools_general.generate_svg_files_from_vega_files_for_repository(self.repository, self.use_cache())
|
|
204
205
|
self.tfcps_tools_general.generate_svg_files_from_vegalite_files_for_repository(self.repository, self.use_cache())
|
|
205
206
|
self.__do_project_linting(self.repository)
|
|
207
|
+
self.__update_agent_sandbox_image(self.repository)
|
|
206
208
|
self.__normalize_line_endings_of_common_files()
|
|
209
|
+
self.search_for_secrets()
|
|
207
210
|
|
|
208
211
|
self.sc.log.log(GeneralUtilities.get_line())
|
|
209
212
|
|
|
@@ -238,6 +241,46 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
238
241
|
self.sc.log.log(GeneralUtilities.get_line())
|
|
239
242
|
|
|
240
243
|
|
|
244
|
+
@GeneralUtilities.check_arguments
|
|
245
|
+
def __update_agent_sandbox_image(self, repository_folder: str) -> None:
|
|
246
|
+
"""Sets the value "image" in "<repository>/.ScriptCollection/AgentSandboxConfiguration.ini" to the SCBuilder-image (address including tag)
|
|
247
|
+
defined in "<repository>/.ScriptCollection/OCIImages/ImageDefinition.csv".
|
|
248
|
+
Nothing is done if one of these files does not exist or if the image-definition-file does not contain an entry for SCBuilder."""
|
|
249
|
+
image_definition_file = os.path.join(repository_folder, ".ScriptCollection", "OCIImages", "ImageDefinition.csv")
|
|
250
|
+
agent_sandbox_configuration_file = os.path.join(repository_folder, ".ScriptCollection", "AgentSandboxConfiguration.ini")
|
|
251
|
+
if not os.path.isfile(image_definition_file) or not os.path.isfile(agent_sandbox_configuration_file):
|
|
252
|
+
return
|
|
253
|
+
scbuilder_image: str = None
|
|
254
|
+
for line in GeneralUtilities.read_nonempty_lines_from_file(image_definition_file):
|
|
255
|
+
if line.startswith("SCBuilder;"):
|
|
256
|
+
columns = line.split(";")
|
|
257
|
+
scbuilder_image = f"{columns[1]}:{columns[2]}"
|
|
258
|
+
break
|
|
259
|
+
if scbuilder_image is None:
|
|
260
|
+
return
|
|
261
|
+
self.sc.log.log(f"Set image of agent-sandbox to '{scbuilder_image}'...", LogLevel.Debug)
|
|
262
|
+
section_header = "[AgentSandboxConfiguration]"
|
|
263
|
+
image_line = f"image = {scbuilder_image}"
|
|
264
|
+
lines: list[str] = GeneralUtilities.read_lines_from_file(agent_sandbox_configuration_file)
|
|
265
|
+
updated_lines: list[str] = []
|
|
266
|
+
current_section: str = None
|
|
267
|
+
image_was_set = False
|
|
268
|
+
for line in lines:
|
|
269
|
+
stripped_line = line.strip()
|
|
270
|
+
if stripped_line.startswith("[") and stripped_line.endswith("]"):
|
|
271
|
+
current_section = stripped_line
|
|
272
|
+
elif current_section == section_header and re.match(r"^image\s*=", stripped_line):
|
|
273
|
+
line = image_line
|
|
274
|
+
image_was_set = True
|
|
275
|
+
updated_lines.append(line)
|
|
276
|
+
if not image_was_set:
|
|
277
|
+
if section_header in [line.strip() for line in updated_lines]:
|
|
278
|
+
updated_lines.insert([line.strip() for line in updated_lines].index(section_header) + 1, image_line)
|
|
279
|
+
else:
|
|
280
|
+
updated_lines.extend([section_header, image_line])
|
|
281
|
+
if updated_lines != lines:
|
|
282
|
+
GeneralUtilities.write_lines_to_file(agent_sandbox_configuration_file, updated_lines)
|
|
283
|
+
|
|
241
284
|
@GeneralUtilities.check_arguments
|
|
242
285
|
def __do_project_linting(self, repository_folder: str) -> None:
|
|
243
286
|
self.sc.log.log("Do project-linting...")
|
|
@@ -443,11 +486,15 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
443
486
|
container_base_mount_folder, container_repository_folder = self.__get_folders_inside_container(base_mount_folder)
|
|
444
487
|
|
|
445
488
|
#only the arguments which scupdatedependencies really accepts are passed. It has no equivalent of the
|
|
446
|
-
#pre-merge
|
|
447
|
-
#
|
|
489
|
+
#pre-merge- and assert-no-new-changes-flags of scbuildcodeunits, so passing one of them would make the
|
|
490
|
+
#argument-parsing fail inside the container.
|
|
448
491
|
scupdatedependencies_arguments = ["scupdatedependencies", "-r", container_repository_folder, "-v", "4", "--targetenvironment", self.target_environment_type]
|
|
449
492
|
if not self.__use_cache:
|
|
450
493
|
scupdatedependencies_arguments.append("-n")
|
|
494
|
+
if self.__add_ready_to_merge_flag:
|
|
495
|
+
scupdatedependencies_arguments.append("-m")
|
|
496
|
+
if self.__fast_lane:
|
|
497
|
+
scupdatedependencies_arguments.append("-f")
|
|
451
498
|
if GeneralUtilities.string_has_content(self.additionalargumentsfile):
|
|
452
499
|
scupdatedependencies_arguments += ["--additionalargumentsfile", self.__translate_path_into_container(self.additionalargumentsfile, container_repository_folder)]
|
|
453
500
|
return self.__run_scriptcollection_executable_in_container(base_mount_folder, container_base_mount_folder, container_repository_folder, scupdatedependencies_arguments, "Update dependencies in container")
|
|
@@ -462,10 +509,49 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
462
509
|
normalized_repository = os.path.normpath(self.repository)
|
|
463
510
|
relative_repository_path = os.path.relpath(normalized_repository, normalized_base_mount_folder).replace(os.sep, "/")
|
|
464
511
|
GeneralUtilities.assert_condition(relative_repository_path == "." or not relative_repository_path.startswith(".."), f"The repository '{self.repository}' is not located inside the base-mount-folder '{base_mount_folder}'.")
|
|
465
|
-
|
|
512
|
+
if self.__is_running_in_container():
|
|
513
|
+
#the build-container shares the volumes of this container (see __get_base_mount_arguments), so the folders have the same paths there.
|
|
514
|
+
container_base_mount_folder = normalized_base_mount_folder.replace(os.sep, "/")
|
|
515
|
+
else:
|
|
516
|
+
container_base_mount_folder = f"/Workspace/Project/{os.path.basename(normalized_base_mount_folder)}"
|
|
466
517
|
container_repository_folder = container_base_mount_folder if relative_repository_path == "." else f"{container_base_mount_folder}/{relative_repository_path}"
|
|
467
518
|
return (container_base_mount_folder, container_repository_folder)
|
|
468
519
|
|
|
520
|
+
@GeneralUtilities.check_arguments
|
|
521
|
+
def __is_running_in_container(self) -> bool:
|
|
522
|
+
#the filesystem-marker is checked in addition to the convention-based environment-variable, like in __search_for_secrets_in_repository.
|
|
523
|
+
return os.path.exists("/.dockerenv") or self.sc.is_runnning_in_container()
|
|
524
|
+
|
|
525
|
+
@GeneralUtilities.check_arguments
|
|
526
|
+
def __get_base_mount_arguments(self, base_mount_folder: str, container_base_mount_folder: str) -> list[str]:
|
|
527
|
+
"""Returns the docker-arguments which make base_mount_folder available inside the build-container.
|
|
528
|
+
Running directly on a host the folder is bind-mounted. Running in a container whose docker-socket is forwarded to the daemon of the
|
|
529
|
+
host (for example the sandbox of scrais), a bind-mount would be resolved by that daemon, where the path of this process does not
|
|
530
|
+
exist: docker would silently create an empty folder, so the build would find no repository. The volumes of this container are
|
|
531
|
+
shared with the build-container instead, which makes the folder visible there under exactly the path this process uses."""
|
|
532
|
+
if not self.__is_running_in_container():
|
|
533
|
+
return ["-v", f"{base_mount_folder}:{container_base_mount_folder}"]
|
|
534
|
+
return ["--volumes-from", self.sc.get_own_container_id()]
|
|
535
|
+
|
|
536
|
+
@GeneralUtilities.check_arguments
|
|
537
|
+
def __copy_mounts_into_container(self, container_id: str, mount_arguments: list[str]) -> None:
|
|
538
|
+
"""Copies the sources of the given bind-mount-arguments ("-v", "<source>:<target>[:ro]") into the not yet started container.
|
|
539
|
+
That is required instead of bind-mounting them whenever this process runs in a container whose docker-socket is forwarded to the
|
|
540
|
+
daemon of the host, because that daemon would resolve the source-paths on the host, where they do not exist. The read-only-flag
|
|
541
|
+
can not be applied to copied files."""
|
|
542
|
+
with tempfile.TemporaryDirectory() as staging_folder:
|
|
543
|
+
for index in range(0, len(mount_arguments), 2):
|
|
544
|
+
GeneralUtilities.assert_condition(mount_arguments[index] == "-v", f"Unexpected mount-argument '{mount_arguments[index]}'.")
|
|
545
|
+
#split from the right because the source can contain colons itself (for example the drive-letter of a windows-path).
|
|
546
|
+
source, target = mount_arguments[index + 1].removesuffix(":ro").rsplit(":", 1)
|
|
547
|
+
staged_target: str = os.path.join(staging_folder, target.lstrip("/"))
|
|
548
|
+
GeneralUtilities.ensure_directory_exists(os.path.dirname(staged_target))
|
|
549
|
+
if os.path.isdir(source):
|
|
550
|
+
shutil.copytree(source, staged_target)
|
|
551
|
+
else:
|
|
552
|
+
shutil.copy2(source, staged_target)
|
|
553
|
+
self.sc.run_program_argsasarray("docker", ["cp", f"{staging_folder}/.", f"{container_id}:/"])
|
|
554
|
+
|
|
469
555
|
@GeneralUtilities.check_arguments
|
|
470
556
|
def __run_scriptcollection_executable_in_container(self, base_mount_folder: str, container_base_mount_folder: str, container_repository_folder: str, executable_arguments: list[str], log_message: str) -> tuple[bool, str]:
|
|
471
557
|
"""Runs one of the commandline-tools of ScriptCollection inside the SCBuilder-image. The tool and its
|
|
@@ -539,19 +625,28 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
539
625
|
env_arguments += ["-e", env_variable_name]
|
|
540
626
|
|
|
541
627
|
#run the tool inside the SCBuilder-image. base_mount_folder is mounted into the container (covering the repository and, for submodules, its real gitdir) and the docker-socket is forwarded because codeunit-builds often start containers (for example local test-services).
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
628
|
+
in_container: bool = self.__is_running_in_container()
|
|
629
|
+
#bind-mounts of host-specific files are resolved by the docker-daemon, so they are only usable when running directly on a host. In a container they are copied into the created container (see __copy_mounts_into_container).
|
|
630
|
+
container_arguments = [
|
|
545
631
|
"-v", "/var/run/docker.sock:/var/run/docker.sock",
|
|
546
632
|
"-w", container_repository_folder,
|
|
547
|
-
] + mount_arguments + env_arguments + [
|
|
633
|
+
] + ([] if in_container else mount_arguments) + env_arguments + [
|
|
548
634
|
image,
|
|
549
635
|
] + executable_arguments
|
|
636
|
+
docker_arguments = self.__get_base_mount_arguments(base_mount_folder, container_base_mount_folder) + container_arguments
|
|
550
637
|
self.sc.log.log(f"{log_message} using image \"{image}\"...")
|
|
551
638
|
image_address, image_tag = ScriptCollectionCore.split_image_address_and_tag(image)
|
|
552
639
|
self.sc.docker_pull(image_address, image_tag)
|
|
553
640
|
# the exitcode is evaluated by the caller (returned as part of the result-tuple), so the program-runner must not raise on a non-zero exitcode here.
|
|
554
|
-
|
|
641
|
+
if not in_container:
|
|
642
|
+
result=self.sc.run_program_argsasarray("docker", ["run", "--rm"] + docker_arguments, throw_exception_if_exitcode_is_not_zero=False, print_live_output=True, env_vars=required_environment_variables)
|
|
643
|
+
else:
|
|
644
|
+
container_id: str = self.sc.run_program_argsasarray("docker", ["create"] + docker_arguments, env_vars=required_environment_variables)[1].strip()
|
|
645
|
+
try:
|
|
646
|
+
self.__copy_mounts_into_container(container_id, mount_arguments)
|
|
647
|
+
result=self.sc.run_program_argsasarray("docker", ["start", "--attach", container_id], throw_exception_if_exitcode_is_not_zero=False, print_live_output=True)
|
|
648
|
+
finally:
|
|
649
|
+
self.sc.run_program_argsasarray("docker", ["rm", "--force", container_id], throw_exception_if_exitcode_is_not_zero=False)
|
|
555
650
|
exit_code:int=result[0]
|
|
556
651
|
stdout:str=result[1] or GeneralUtilities.empty_string
|
|
557
652
|
stderr:str=result[2] or GeneralUtilities.empty_string
|
|
@@ -795,7 +890,7 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
795
890
|
|
|
796
891
|
config_file = os.path.join(self.repository, ".betterleaks.toml")
|
|
797
892
|
#the filesystem-marker is checked in addition to the convention-based environment-variable (which the rest of this class uses as well),
|
|
798
|
-
#because a wrong result here does not only change a message but makes the scan
|
|
893
|
+
#because a wrong result here does not only change a message but makes the scan analyze the wrong folder.
|
|
799
894
|
running_in_container = os.path.exists("/.dockerenv") or self.sc.is_runnning_in_container()
|
|
800
895
|
if running_in_container:
|
|
801
896
|
# We run inside the build-container with the docker-socket forwarded to the host-daemon.
|
|
@@ -257,7 +257,7 @@ class TFCPS_MergeToStable:
|
|
|
257
257
|
<hr/>
|
|
258
258
|
Available reference-content for {codeunitname}:<br>
|
|
259
259
|
{repo_url_html}<br>
|
|
260
|
-
<!--TODO add
|
|
260
|
+
<!--TODO add artifacts-link: <a href="./x">Artifacts</a><br>-->
|
|
261
261
|
<a href="./Reference/index.html">Reference</a><br>
|
|
262
262
|
<a href="./DiffReport/DiffReport.html">Diff-report</a><br>
|
|
263
263
|
{coverage_report_link}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
ScriptCollection/AgentRunner.py,sha256=
|
|
1
|
+
ScriptCollection/AgentRunner.py,sha256=L0F8Zujzsw8NDFFUda0HFzes3sCfXOdui9AtuCyrUo8,18718
|
|
2
2
|
ScriptCollection/ArbTranslationsOrganizer.py,sha256=3TO4fjkYADcHGyUXdiQk-RtfCxtf9ojuBS3CbZtgXBE,12218
|
|
3
3
|
ScriptCollection/CertificateUpdater.py,sha256=yZc7KESc1F_Mc6HP2UfLmNHRc2MvtVqp0t60J_CqY3s,9755
|
|
4
|
-
ScriptCollection/Executables.py,sha256=
|
|
4
|
+
ScriptCollection/Executables.py,sha256=Z-YRlSgD4GN7XjZuarXHZTPOuWtNr2rF5OzlwjJ3Yuo,82192
|
|
5
5
|
ScriptCollection/GeneralUtilities.py,sha256=kW6y52rdD-dJrjCtIgsdwYinz6FtclGj-xc_4tL1MUg,80022
|
|
6
6
|
ScriptCollection/HTTPMaintenanceOverheadHelper.py,sha256=TToNtyO1XzsMbBsTBf3o0xgOK0v4Jf03qw2Z0xb2nCk,2007
|
|
7
7
|
ScriptCollection/ProcessesRunner.py,sha256=wtNFdmj9klETTIDUSE90vaR5ClEX4V7dgJNVbp9_wi0,1381
|
|
@@ -12,7 +12,7 @@ ScriptCollection/ProgramRunnerSudo.py,sha256=vwKq-MOcqsgiKhSf-MBUDBC_UyaU8evP3Ro
|
|
|
12
12
|
ScriptCollection/RepositoryDiagramGenerator.py,sha256=K_u2NW_p4ozdWD50irJEkkcDVa70TcUJpZN63TeXSLw,7092
|
|
13
13
|
ScriptCollection/RepositoryHistoryAnalyzer.py,sha256=u9141B9D-Kef-9uo3yR7BXKUMzIKLVsesnYk7H-cWm4,6157
|
|
14
14
|
ScriptCollection/SCLog.py,sha256=Fjf8Pdi63cXHGMxL_aI6A0dwGm7QIfrv3czjvpSUlaM,4705
|
|
15
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
15
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=SD4FZfBDh0jG4EvDuKzOMFuWOlYpoRqnNukqdNTZ3AU,310633
|
|
16
16
|
ScriptCollection/TestKind.py,sha256=jqLJwNvQeyea7SZf-UFzMC9pM0znv4do7FIC1xq8u9M,1672
|
|
17
17
|
ScriptCollection/UnassignedVariablesCheck.py,sha256=8xNcp1D5HeOLO1a1NEerq2TsnpFhw7yzYPkaay-oisY,3804
|
|
18
18
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -33,19 +33,19 @@ ScriptCollection/Resources/Dependencies/OpenAPIGenerator/Version.txt,sha256=hdAg
|
|
|
33
33
|
ScriptCollection/Resources/MaintenanceSite/MaintenanceSite.html,sha256=CX9S1bdOz6xU2aGfr03tJRGczQrlpn-IeODc15d5kc0,232
|
|
34
34
|
ScriptCollection/TFCPS/NpmDependencies.py,sha256=IfUh9EyrkHxovGRWYagNMZjBUXyKjZ4AG-Z8leehw24,6304
|
|
35
35
|
ScriptCollection/TFCPS/PackageSource.py,sha256=tQoMbxrIbV3mYHKH2wgOoGzIHY1TvBH8EAFpWGhryrQ,1311
|
|
36
|
-
ScriptCollection/TFCPS/PlantUMLRenderer.py,sha256=
|
|
36
|
+
ScriptCollection/TFCPS/PlantUMLRenderer.py,sha256=He5woqx9IR96vMXtHo12BmeXmcjLoifGD8Sup0bpxuo,11060
|
|
37
37
|
ScriptCollection/TFCPS/PubDependencies.py,sha256=hl6BfYjzb0-esO-pqyV_sxBLbHBi55GEgUiub3lma_8,9922
|
|
38
38
|
ScriptCollection/TFCPS/SCTaskRunnerServer.py,sha256=mmtpxrFn36GlW9ZdmEb_oigsQZBqJ85awJb9BOP3tGI,31089
|
|
39
39
|
ScriptCollection/TFCPS/TFCPS_BuildCodeUnitsHook.py,sha256=67_DQwoH5bhxxSmwtuAeoW1NOCMiLMzOy48OqlJX-KY,1744
|
|
40
40
|
ScriptCollection/TFCPS/TFCPS_CodeSpellCheck.py,sha256=zV62O7UiGjewx1yQUIWmUJ9D-5ipkV_f28uNhp-JWUs,5306
|
|
41
41
|
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=Rh7S84B8QbeWn5qJxRItoI7jquJYvFnNRi_WiX3FjWo,40414
|
|
42
42
|
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=CB0K8OZNtQESdS2pqX9RQqN-lI5M-cbmXYOR0rbuRlk,9741
|
|
43
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=
|
|
43
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=bkmqsEMVddty5DxCouhrHsFCDSzRjdY5ms_lcYvAhyE,70848
|
|
44
44
|
ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=BVK3fpEyjcXYVHIb6YYLH7bWe6iKRaCtPrJ3tXAemYw,6582
|
|
45
45
|
ScriptCollection/TFCPS/TFCPS_FindingsSorter.py,sha256=3ChuKf-Myr3sBtQhYGw6dHlk93HO6PAH-Jq1oPYdW1s,4804
|
|
46
46
|
ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=mRBcf7XuNWOSXbZYc3NuJow18AMZ30D6Z-BtyNYfNcM,2072
|
|
47
47
|
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=Krt5oyGNcRAN3szsgU7LoTh8yVTOdHW-Kq7R9MDDV-Q,7673
|
|
48
|
-
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=
|
|
48
|
+
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=GdpFcgIFRvdc1Q9b7uXlPlN99s7r93yJ4ATVA33Kb3I,22434
|
|
49
49
|
ScriptCollection/TFCPS/TFCPS_OCIImageSecretScan.py,sha256=Jb7AaMcJDW-gYEYBUVZAG3QLTTNWmXlvVEW-lZsykws,14821
|
|
50
50
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=XLVsFTA1jvfDbZ7wYJgIdEByZhF_bYVbA5jkisuvK4k,2322
|
|
51
51
|
ScriptCollection/TFCPS/TFCPS_RemoteBuild.py,sha256=2Tx5HLk1ZftBWDCTiGZdP2QiiGNyWsEuTCSt33dNQjc,23891
|
|
@@ -75,8 +75,8 @@ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=yyjWPMHQjPLkML
|
|
|
75
75
|
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
76
|
ScriptCollection/TFCPS/TypeScript/TFCPS_CodeUnitSpecific_TypeScript.py,sha256=ILVhJHvwG5TvPBBqSvyACYb7W9QnWrJpxKgHu8IQu4g,9249
|
|
77
77
|
ScriptCollection/TFCPS/TypeScript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
|
-
scriptcollection-4.4.
|
|
79
|
-
scriptcollection-4.4.
|
|
80
|
-
scriptcollection-4.4.
|
|
81
|
-
scriptcollection-4.4.
|
|
82
|
-
scriptcollection-4.4.
|
|
78
|
+
scriptcollection-4.4.65.dist-info/METADATA,sha256=95JUxezKvVfAg1PGiCpoClrT60GbHciuNSI3jwa5pSE,8032
|
|
79
|
+
scriptcollection-4.4.65.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
80
|
+
scriptcollection-4.4.65.dist-info/entry_points.txt,sha256=kI-HqAydo8a0FGjGeXh6i1pGU73Pit0xACdjxBxNkis,6254
|
|
81
|
+
scriptcollection-4.4.65.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
82
|
+
scriptcollection-4.4.65.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|