Skip to content

Commit 4fdb298

Browse files
committed
feat(aws): add add-deb command
Add a command to add a pre-built deb package to the deployment rather than building one. Signed-off-by: Sergei Trofimov <[email protected]>
1 parent 3787473 commit 4fdb298

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

deployments/aws/bin/veraison

+28-2
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,34 @@ class DeleteDebCommand(BaseCommand):
17071707
self.logger.info('done.')
17081708

17091709

1710+
class AddDebCommand(BaseCommand):
1711+
1712+
name = 'add-deb'
1713+
desc = 'Use the specified debian package for the deployment, rather than creating a new one'
1714+
1715+
def update_arguments(self, parser):
1716+
parser.add_argument('path',
1717+
help='Path to the deb package to add.')
1718+
parser.add_argument('-l', '--link', action='store_true',
1719+
help='''"Link" the package to the deployment via a cache entry, but
1720+
do not copy it into the deployment files. I.e. use it in-place.''')
1721+
1722+
def run(self, args):
1723+
self.logger.info(f'Adding {args.path} to the deployment...')
1724+
1725+
path = args.path
1726+
if not args.link:
1727+
dest_path = os.path.join(args.cache_dir, os.path.basename(path))
1728+
self.logger.debug(f'copying {path} to {dest_path}...')
1729+
shutil.copyfile(path, dest_path)
1730+
path = dest_path
1731+
1732+
self.logger.debug('updating deployment cache...')
1733+
self.cache['deb'] = path
1734+
1735+
self.logger.info('done.')
1736+
1737+
17101738
class CreateVpcStack(BaseCommand):
17111739
name = 'create-vpc-stack'
17121740
desc = 'create stack setting up the VPC, subnets and associated routing for Veraison services'
@@ -2332,8 +2360,6 @@ class DeleteSignerKeyCommand(BaseCommand):
23322360

23332361
self.logger.info('Done.')
23342362

2335-
# }}} commands
2336-
23372363

23382364
class Port(int):
23392365
def __init__(self, val):

0 commit comments

Comments
 (0)