diff --git a/matlab/TCV_IMAS/tcv2ids.m b/matlab/TCV_IMAS/tcv2ids.m index e1fdd0556a4d70a8cc0774dbb7fa4bd527611bfb..3715a8a1162c965270b3c7ee6a2f1df9e48f146d 100644 --- a/matlab/TCV_IMAS/tcv2ids.m +++ b/matlab/TCV_IMAS/tcv2ids.m @@ -118,15 +118,23 @@ for i=1:length(params_tcv2ids.ids_names) ids_from_tcv.(ids_to_get) = tmp.(ids_to_get); ids_from_tcv.([ids_to_get '_description']) = tmp.([ids_to_get '_description']); - % Retrieve versioning information from .this-deployment.info - - for ii = 1:numel(ids_from_tcv.code.library) + % Retrieve versioning information from .this-deployment.info + if ~isempty(ids_from_tcv.(ids_to_get).code.name) + library_gitinfo= ... + tcv_get_deploymentinfo(fullfile(fileparts(which(ids_from_tcv.(ids_to_get).code.name)),'.this-deployment.info')); + ids_from_tcv.(ids_to_get).code.commit = library_gitinfo.git_commit; + ids_from_tcv.(ids_to_get).code.version = library_gitinfo.git_tag; + ids_from_tcv.(ids_to_get).code.repository =library_gitinfo.gitlab_project_url; + end + for ii = 1:numel(ids_from_tcv.(ids_to_get).code.library) + if ~isempty(ids_from_tcv.(ids_to_get).code.library{ii}.name) library_gitinfo= ... - tcv_get_deploymentinfo(fullfile(fileparts(which(ids_from_tcv_.code.library{ii}.name)),'.this-deployment.info')); - ids_bolometer.code.library{ii}.commit = library_gitinfo.git_commit; - ids_bolometer.code.library{ii}.version = library_gitinfo.git_tag; - ids_bolometer.code.library{ii}.repository =library_gitinfo.gitlab_project_url; + tcv_get_deploymentinfo(fullfile(fileparts(which(ids_from_tcv.(ids_to_get).code.library{ii}.name)),'.this-deployment.info')); + ids_from_tcv.(ids_to_get).code.library{ii}.commit = library_gitinfo.git_commit; + ids_from_tcv.(ids_to_get).code.library{ii}.version = library_gitinfo.git_tag; + ids_from_tcv.(ids_to_get).code.library{ii}.repository =library_gitinfo.gitlab_project_url; end + end end diff --git a/matlab/TCV_IMAS/tcv_get_deploymentinfo.m b/matlab/TCV_IMAS/tcv_get_deploymentinfo.m index f5562e1d9457e4c79a0992fc2b3ffdd98b186913..2ef00f1ba402dc80fcb62647fe59de2a31bcdf2c 100644 --- a/matlab/TCV_IMAS/tcv_get_deploymentinfo.m +++ b/matlab/TCV_IMAS/tcv_get_deploymentinfo.m @@ -11,6 +11,10 @@ function info = tcv_get_deploymentinfo(function_name) % Initialize output struct info = struct(); + info.deployment_date=''; + info.git_tag=''; + info.git_commit=''; + info.gitlab_project_url=''; try filepath=fullfile(fileparts(which(function_name)),'.this-deployment.info'); info.repository=fileparts(filepath);