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