2019-08-09 04:50:06 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import subprocess
|
2020-06-04 12:17:26 +02:00
|
|
|
from testutils import notary_url
|
2019-08-09 04:50:06 +02:00
|
|
|
|
|
|
|
def sign_image(registry_ip, project_name, image, tag):
|
|
|
|
try:
|
2020-06-04 12:17:26 +02:00
|
|
|
ret = subprocess.check_output(["./tests/apitests/python/sign_image.sh", registry_ip, project_name, image, tag, notary_url], shell=False)
|
2020-07-30 10:04:14 +02:00
|
|
|
print("sign_image return: ", ret)
|
2020-08-07 08:56:18 +02:00
|
|
|
except subprocess.CalledProcessError as exc:
|
2019-08-09 04:50:06 +02:00
|
|
|
raise Exception("Failed to sign image error is {} {}.".format(exc.returncode, exc.output))
|
|
|
|
|