ScriptCollection 4.2.2__py3-none-any.whl → 4.2.4__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.
@@ -35,7 +35,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
35
35
  from .ProgramRunnerPopen import ProgramRunnerPopen
36
36
  from .SCLog import SCLog, LogLevel
37
37
 
38
- version = "4.2.2"
38
+ version = "4.2.4"
39
39
  __version__ = version
40
40
 
41
41
 
@@ -128,6 +128,7 @@ class ScriptCollectionCore:
128
128
  if fallback_registry is None:
129
129
  raise ValueError(f"For image \"{image}\" no cache-registry and no default-registry is defined.",LogLevel.Warning)
130
130
  else:
131
+ self.log.log(f"Using fallback-registry for image \"{image}\".",LogLevel.Warning)
131
132
  return f"{fallback_registry}/{image}{tag_with_colon}"
132
133
 
133
134
  @GeneralUtilities.check_arguments
@@ -52,7 +52,7 @@ class TFCPS_CodeUnitSpecific_Docker_Functions(TFCPS_CodeUnitSpecific_Base):
52
52
  sbom_folder = os.path.join(artifacts_folder, "BOM")
53
53
  codeunitversion = self.tfcps_Tools_General.get_version_of_codeunit(self.get_codeunit_file())
54
54
  GeneralUtilities.ensure_directory_exists(sbom_folder)
55
- self._protected_sc.run_program_argsasarray("docker", ["run","--rm","-v","/var/run/docker.sock:/var/run/docker.sock","-v","./BOM:/BOM",self._protected_sc.get_image_with_registry_for_docker_image("syft","image","docker.io/anchore/syft"),f"{codeunitname_lower}:{codeunitversion}","-o",f"cyclonedx-xml=/BOM/{codeunitname}.{codeunitversion}.sbom.xml"], artifacts_folder, print_errors_as_information=True)
55
+ self._protected_sc.run_program_argsasarray("docker", ["run","--rm","-v","/var/run/docker.sock:/var/run/docker.sock","-v","./BOM:/BOM",self._protected_sc.get_image_with_registry_for_docker_image("syft",None,"docker.io/anchore/syft"),f"{codeunitname_lower}:{codeunitversion}","-o",f"cyclonedx-xml=/BOM/{codeunitname}.{codeunitversion}.sbom.xml"], artifacts_folder, print_errors_as_information=True)
56
56
  self._protected_sc.format_xml_file(sbom_folder+f"/{codeunitname}.{codeunitversion}.sbom.xml")
57
57
 
58
58
  @GeneralUtilities.check_arguments
@@ -1370,11 +1370,28 @@ class TFCPS_Tools_General:
1370
1370
 
1371
1371
 
1372
1372
  @GeneralUtilities.check_arguments
1373
- def pull_images_of_test_services(self,repository_folder:str):
1373
+ def pull_images_of_test_services(self,repository_folder:str,env_variables:dict[str,str],fallback_registries:dict[str,str]):
1374
+ if env_variables is None:
1375
+ env_variables={}
1376
+ if fallback_registries is None:
1377
+ fallback_registries={}
1378
+ for image,fallback_registry in fallback_registries.items():
1379
+ env_variables[f"image_{image}"]=self.__sc.get_image_with_registry_for_docker_image(image,None,fallback_registry)
1374
1380
  test_services=GeneralUtilities.get_direct_folders_of_folder(os.path.join(repository_folder,"Other","Resources","LocalTestServices"))
1375
1381
  if 0<len(test_services):
1376
1382
  self.__sc.log.log("Pull images for local test-services...")
1377
1383
  for test_service_folder in test_services:
1378
1384
  test_service_name=os.path.basename(test_service_folder)
1379
1385
  self.__sc.log.log(f"Pull image for test-service {test_service_name}...")
1380
- self.__sc.run_program("docker",f"compose -f docker-compose.yml pull --quiet",test_service_folder,print_live_output=self.__sc.log.loglevel==LogLevel.Debug)
1386
+ arguments=f"compose -f docker-compose.yml pull --quiet"
1387
+ if env_variables:
1388
+ env_variables_file=os.path.join(test_service_folder,"Parameters.env")
1389
+ GeneralUtilities.ensure_file_exists(env_variables_file)
1390
+ lines=[]
1391
+ for k,v in env_variables.items():
1392
+ lines=lines+[f"{k}={v}"]
1393
+ GeneralUtilities.write_lines_to_file(env_variables_file,lines)
1394
+ arguments=arguments+" --env-file Parameters.env"
1395
+ else:
1396
+ GeneralUtilities.ensure_file_does_not_exist(env_variables_file)
1397
+ self.__sc.run_program("docker",arguments,test_service_folder,print_live_output=self.__sc.log.loglevel==LogLevel.Debug)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 4.2.2
3
+ Version: 4.2.4
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Home-page: https://github.com/anionDev/ScriptCollection
6
6
  Author: Marius Göcke
@@ -9,7 +9,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
9
9
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
10
10
  ScriptCollection/ProgramRunnerSudo.py,sha256=_khC3xuTdrPoLluBJZWfldltmmuKltABJPcbjZSFW-4,4835
11
11
  ScriptCollection/SCLog.py,sha256=8TRy1LeYMsPOIuWUcnUNNbO5pd-cNBS-3cn-kdzP8FU,4768
12
- ScriptCollection/ScriptCollectionCore.py,sha256=h5_HW27_9b3xAq1F0jByePR0e0XU78iABOQOIrnVNrk,154465
12
+ ScriptCollection/ScriptCollectionCore.py,sha256=afwDgTa6_jR8l7XNyZHhiDcafcdeWaW8z_oxukCdTYU,154559
13
13
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=WRFdmkPrzAO9P7ue-5BH1DZfqmGN9yyb2AouFuv2MiI,27712
15
15
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=vnNrwvNePvW2dQhnSusBjgvOssI3a1P3g94bNxNIr3o,8069
@@ -19,9 +19,9 @@ ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=O-0guM_LJCcZmPZJhMgTvXD2RXUJEBWWv
19
19
  ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=6FRnTL9XR7Ks-WyFWE6y9w7E54NWPnD1XENTgSrVI-E,7588
20
20
  ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=-7ZtiLAUp0vdgnVHhcjX_WQSVR1Jgbqj1bANrXoQDMw,22347
21
21
  ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=f0Uq1cA_4LvmL72cal0crrbKF6PcxL13D9wBKuQ1YBw,2328
22
- ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=yFWbW51Pt-oEpBlO9Fg8BvSM3bhUmtk__BllgtX6aqI,87785
22
+ ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=vt4HhzkLL-qUq7wXnw7DxugVAR7GO6UErOQj2ZagIBc,88760
23
23
  ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=ol_Ocfj-jl34wSxHeCIFlG8vSdSYRg9PUnJhDeNdq_I,10378
24
+ ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=d70eGwaFXz2ba-5-Mh_vNlWT8aTj05-qmmQlh4TwRhY,10375
25
25
  ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
27
27
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
@@ -36,8 +36,8 @@ ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=aXC_f39edp
36
36
  ScriptCollection/TFCPS/NodeJS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=nLw_eSUd_56jjgfcAvtUyzecSZ14mYmNJl0iu-1YNVk,13496
38
38
  ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- scriptcollection-4.2.2.dist-info/METADATA,sha256=XmT3BgR6Y2pDcng5_anKCpMEAVO-wvjRFtc4uaDgnaE,7689
40
- scriptcollection-4.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
41
- scriptcollection-4.2.2.dist-info/entry_points.txt,sha256=6Az2eMD7luwGPSdoIhJ1y6ZtgxsfezgJCsFhOnyhnwM,4627
42
- scriptcollection-4.2.2.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
43
- scriptcollection-4.2.2.dist-info/RECORD,,
39
+ scriptcollection-4.2.4.dist-info/METADATA,sha256=y_TI6aHc-harENu_Ik7-vUiKUDBs3bloRZ9TYNg-26Q,7689
40
+ scriptcollection-4.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
41
+ scriptcollection-4.2.4.dist-info/entry_points.txt,sha256=6Az2eMD7luwGPSdoIhJ1y6ZtgxsfezgJCsFhOnyhnwM,4627
42
+ scriptcollection-4.2.4.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
43
+ scriptcollection-4.2.4.dist-info/RECORD,,