Add option no-sign
This commit is contained in:
parent
e789e5dc82
commit
48d7b9d3b4
@ -37,6 +37,11 @@ def parse_args():
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
help='disable running tests',
|
help='disable running tests',
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--no-sign',
|
||||||
|
action='store_true',
|
||||||
|
help='disable creating check sum and signing it',
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--tasks',
|
'--tasks',
|
||||||
default={},
|
default={},
|
||||||
@ -53,6 +58,7 @@ def main():
|
|||||||
cb = cloud_build.CB(**dict(args._get_kwargs()))
|
cb = cloud_build.CB(**dict(args._get_kwargs()))
|
||||||
cb.create_images()
|
cb.create_images()
|
||||||
cb.copy_external_files()
|
cb.copy_external_files()
|
||||||
|
if not args.no_sign:
|
||||||
cb.sign()
|
cb.sign()
|
||||||
cb.sync()
|
cb.sync()
|
||||||
|
|
||||||
|
@ -54,13 +54,15 @@ class CB:
|
|||||||
*,
|
*,
|
||||||
data_dir: PathLike = None,
|
data_dir: PathLike = None,
|
||||||
no_tests: bool = False,
|
no_tests: bool = False,
|
||||||
|
no_sign: bool = False,
|
||||||
create_remote_dirs: bool = False,
|
create_remote_dirs: bool = False,
|
||||||
tasks: dict = None,
|
tasks: dict = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.initialized = False
|
self.initialized = False
|
||||||
self._save_cwd = os.getcwd()
|
self._save_cwd = os.getcwd()
|
||||||
self.parse_config(config)
|
|
||||||
self.no_tests = no_tests
|
self.no_tests = no_tests
|
||||||
|
self.no_sign = no_sign
|
||||||
|
self.parse_config(config)
|
||||||
self._create_remote_dirs = create_remote_dirs
|
self._create_remote_dirs = create_remote_dirs
|
||||||
if tasks is None:
|
if tasks is None:
|
||||||
self.tasks = {}
|
self.tasks = {}
|
||||||
@ -187,6 +189,7 @@ class CB:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self._remote = self.expand_path(cfg['remote'])
|
self._remote = self.expand_path(cfg['remote'])
|
||||||
|
if not self.no_sign:
|
||||||
self.key = cfg['key']
|
self.key = cfg['key']
|
||||||
if isinstance(self.key, int):
|
if isinstance(self.key, int):
|
||||||
self.key = '{:X}'.format(self.key)
|
self.key = '{:X}'.format(self.key)
|
||||||
@ -641,6 +644,9 @@ Dir::Etc::preferencesparts "/var/empty";
|
|||||||
self.images_dir / branch / image)
|
self.images_dir / branch / image)
|
||||||
|
|
||||||
def sign(self):
|
def sign(self):
|
||||||
|
if self.no_sign:
|
||||||
|
return
|
||||||
|
|
||||||
sum_file = self.checksum_command.upper()
|
sum_file = self.checksum_command.upper()
|
||||||
for branch in self.branches:
|
for branch in self.branches:
|
||||||
with self.pushd(self.images_dir / branch):
|
with self.pushd(self.images_dir / branch):
|
||||||
|
Loading…
Reference in New Issue
Block a user