ScriptCollection 4.0.37__py3-none-any.whl → 4.0.39__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/ScriptCollectionCore.py +1 -1
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +54 -0
- {scriptcollection-4.0.37.dist-info → scriptcollection-4.0.39.dist-info}/METADATA +1 -1
- {scriptcollection-4.0.37.dist-info → scriptcollection-4.0.39.dist-info}/RECORD +7 -7
- {scriptcollection-4.0.37.dist-info → scriptcollection-4.0.39.dist-info}/WHEEL +0 -0
- {scriptcollection-4.0.37.dist-info → scriptcollection-4.0.39.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.0.37.dist-info → scriptcollection-4.0.39.dist-info}/top_level.txt +0 -0
@@ -1103,3 +1103,57 @@ class TFCPS_Tools_General:
|
|
1103
1103
|
artifact_files.append(additional_attached_file)
|
1104
1104
|
changelog_file = os.path.join(repository_folder, "Other", "Resources", "Changelog", f"v{projectversion}.md")
|
1105
1105
|
self.__sc.run_program_argsasarray("gh", ["release", "create", f"v{projectversion}", "--repo", github_repo, "--notes-file", changelog_file, "--title", f"Release v{projectversion}"]+artifact_files)
|
1106
|
+
|
1107
|
+
@GeneralUtilities.check_arguments
|
1108
|
+
def update_dependency_in_resources_folder(self, update_dependencies_file, dependency_name: str, latest_version_function: str) -> None:
|
1109
|
+
dependency_folder = GeneralUtilities.resolve_relative_path(f"../Resources/Dependencies/{dependency_name}", update_dependencies_file)
|
1110
|
+
version_file = os.path.join(dependency_folder, "Version.txt")
|
1111
|
+
version_file_exists = os.path.isfile(version_file)
|
1112
|
+
write_to_file = False
|
1113
|
+
if version_file_exists:
|
1114
|
+
current_version = GeneralUtilities.read_text_from_file(version_file)
|
1115
|
+
if current_version != latest_version_function:
|
1116
|
+
write_to_file = True
|
1117
|
+
else:
|
1118
|
+
GeneralUtilities.ensure_directory_exists(dependency_folder)
|
1119
|
+
GeneralUtilities.ensure_file_exists(version_file)
|
1120
|
+
write_to_file = True
|
1121
|
+
if write_to_file:
|
1122
|
+
GeneralUtilities.write_text_to_file(version_file, latest_version_function)
|
1123
|
+
|
1124
|
+
|
1125
|
+
@GeneralUtilities.check_arguments
|
1126
|
+
def push_docker_build_artifact(self, push_artifacts_file: str, registry: str, push_readme: bool, repository_folder_name: str, remote_image_name: str = None) -> None:
|
1127
|
+
folder_of_this_file = os.path.dirname(push_artifacts_file)
|
1128
|
+
filename = os.path.basename(push_artifacts_file)
|
1129
|
+
codeunitname_regex: str = "([a-zA-Z0-9]+)"
|
1130
|
+
filename_regex: str = f"PushArtifacts\\.{codeunitname_regex}\\.py"
|
1131
|
+
if match := re.search(filename_regex, filename, re.IGNORECASE):
|
1132
|
+
codeunitname = match.group(1)
|
1133
|
+
else:
|
1134
|
+
raise ValueError(f"Expected push-artifacts-file to match the regex \"{filename_regex}\" where \"{codeunitname_regex}\" represents the codeunit-name.")
|
1135
|
+
|
1136
|
+
repository_folder = GeneralUtilities.resolve_relative_path(f"..{os.path.sep}..{os.path.sep}Submodules{os.path.sep}{repository_folder_name}", folder_of_this_file)
|
1137
|
+
codeunit_folder = os.path.join(repository_folder, codeunitname)
|
1138
|
+
artifacts_folder = os.path.join(repository_folder,codeunitname, "Other", "Artifacts")
|
1139
|
+
applicationimage_folder = os.path.join(artifacts_folder, "BuildResult_OCIImage")
|
1140
|
+
image_file = self.__sc.find_file_by_extension(applicationimage_folder, "tar")
|
1141
|
+
image_filename = os.path.basename(image_file)
|
1142
|
+
codeunit_version = self.get_version_of_codeunit(os.path.join(codeunit_folder, f"{codeunitname}.codeunit.xml"))
|
1143
|
+
if remote_image_name is None:
|
1144
|
+
remote_image_name = codeunitname
|
1145
|
+
remote_image_name = remote_image_name.lower()
|
1146
|
+
local_image_name = codeunitname.lower()
|
1147
|
+
remote_repo = f"{registry}/{remote_image_name}"
|
1148
|
+
remote_image_latest = f"{remote_repo}:latest"
|
1149
|
+
remote_image_version = f"{remote_repo}:{codeunit_version}"
|
1150
|
+
self.__sc.log.log("Load image...")
|
1151
|
+
self.__sc.run_program("docker", f"load --input {image_filename}", applicationimage_folder)
|
1152
|
+
self.__sc.log.log("Tag image...")
|
1153
|
+
self.__sc.run_program_with_retry("docker", f"tag {local_image_name}:{codeunit_version} {remote_image_latest}")
|
1154
|
+
self.__sc.run_program_with_retry("docker", f"tag {local_image_name}:{codeunit_version} {remote_image_version}")
|
1155
|
+
self.__sc.log.log("Push image...")
|
1156
|
+
self.__sc.run_program_with_retry("docker", f"push {remote_image_latest}")
|
1157
|
+
self.__sc.run_program_with_retry("docker", f"push {remote_image_version}")
|
1158
|
+
if push_readme:
|
1159
|
+
self.__sc.run_program_with_retry("docker-pushrm", f"{remote_repo}", codeunit_folder)
|
@@ -9,7 +9,7 @@ ScriptCollection/ProgramRunnerEpew.py,sha256=TJdDx9zIMSiCaXh8X-ekrMlbXfGtmd0Mmyx
|
|
9
9
|
ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrRjAPIwT5Y,37
|
10
10
|
ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
|
11
11
|
ScriptCollection/SCLog.py,sha256=dxGOI4E9lG5v9jk_LajXCkM5nghliCDV8YB8Ihn160s,4541
|
12
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
12
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=3l6MxWpKaNw7RrI2N8sGjE6AdQTZXI84sgzw4Om6EO4,141223
|
13
13
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
14
|
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=Cj89Xhzf5CRSDVH_-0JachQMsPHfjkz8jtRi_BpiGvY,25979
|
15
15
|
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=4rYKgTAga11NiDx8YUqz3K_Q4eX_n3kC6lvNdXEa24s,7389
|
@@ -20,7 +20,7 @@ ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=41g219jaBRZ2VQCrWM4-Trvervrt8
|
|
20
20
|
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=ifB1K6A903vvfH0LvtiFbZgYSgR94thfEI-jjf40LpU,21653
|
21
21
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=CxdwUklhZVuJGp0vcokoH_KMXFzmlUlZwj77xFYijho,2242
|
22
22
|
ScriptCollection/TFCPS/TFCPS_Tools_Dependencies.py,sha256=o7HI3ki3WWqlAiUsrh3Lky_w6UhYh9hdjYPGOhubQGA,414
|
23
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
23
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=cRPJqw5sC1hQbGI-hoDPGC5BLf3ngnRGn_sOYc6C5hA,72994
|
24
24
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=-g8h2gCf9rh0KJXUBeQD5d0qLJgBU3Q8DNZXM1UXC04,5259
|
26
26
|
ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -35,8 +35,8 @@ ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=dnuDlQXThF
|
|
35
35
|
ScriptCollection/TFCPS/NodeJS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
36
|
ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=q7msAxCb5VIZ-xhFg1MfzUvWomQRKYldqmW42KFhyMU,6868
|
37
37
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
|
-
scriptcollection-4.0.
|
39
|
-
scriptcollection-4.0.
|
40
|
-
scriptcollection-4.0.
|
41
|
-
scriptcollection-4.0.
|
42
|
-
scriptcollection-4.0.
|
38
|
+
scriptcollection-4.0.39.dist-info/METADATA,sha256=jdIJ0wZU8QtUjpmnDzjz-PuTnKH2UA_uyf_mNlRkHIw,7688
|
39
|
+
scriptcollection-4.0.39.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
40
|
+
scriptcollection-4.0.39.dist-info/entry_points.txt,sha256=NeU26D6q7d8n2cmKQiOvHK21w1C7D2kxoNRJaKiyZ5w,4295
|
41
|
+
scriptcollection-4.0.39.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
42
|
+
scriptcollection-4.0.39.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|