ALBS-443: Integrate CodeNotary with git updater tool #1

Merged
soksanichenko merged 10 commits from ALBS-443 into master 2022-06-22 11:07:24 +00:00
Showing only changes of commit 646b984d89 - Show all commits

View File

@ -54,6 +54,10 @@ class CasWrapper:
'-a',
f'{key}={value}',
]
with local.env(
CAS_API_KEY=self._cas_api_key,
SIGNER_ID=self._cas_signer_id
):
result_of_execution = command()
return json.loads(result_of_execution)['hash']
@ -76,8 +80,16 @@ class CasWrapper:
'json',
]
try:
with local.env(
CAS_API_KEY=self._cas_api_key,
SIGNER_ID=self._cas_signer_id
):
result_of_execution = command()
except ProcessExecutionError:
with local.env(
CAS_API_KEY=self._cas_api_key,
SIGNER_ID=self._cas_signer_id
):
# in case if commit is untrusted
result_of_execution = command(retcode=1)
return not bool(json.loads(result_of_execution)['status'])