Skip to content

Commit

Permalink
Add -latest docker image tag for SDC parcel docker image (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtiv1 authored Jun 28, 2018
1 parent 8e96494 commit d89d510
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions images/build_images
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def main():
logger.info('Doing dry-run of tool ...')

sdc_version = _get_sdc_version(PARCEL_MANIFEST_URL_TEMPLATE.format(build=args.sdc_build, s3_bucket=args.sdc_s3_bucket))
image_name = IMAGE_NAME_TEMPLATE.format(args.sdc_version_tag or sdc_version)
tag_version = args.sdc_version_tag or sdc_version
image_name = IMAGE_NAME_TEMPLATE.format(tag_version)
tag = IMAGE_NAME_TEMPLATE.format('{}-latest'.format(tag_version.split('-')[0]))
csd_url = CSD_URL_TEMPLATE.format(sdc_version, build=args.sdc_build, s3_bucket=args.sdc_s3_bucket)
parcel_url = PARCEL_URL_TEMPLATE.format(sdc_version, build=args.sdc_build, s3_bucket=args.sdc_s3_bucket)

Expand All @@ -72,11 +74,17 @@ def main():
if not args.dry_run:
subprocess.run(cmd, shell=True, check=True)

cmd = 'docker tag {} {}'.format(image_name, tag)
logger.debug('Running Docker tag command (%s)...', cmd)
if not args.dry_run:
subprocess.run(cmd, shell=True, check=True)

if args.push:
cmd = 'docker push {}'.format(image_name)
logger.debug('Running Docker push command (%s) ...', cmd)
if not args.dry_run:
subprocess.run(cmd, shell=True, check=True)
for item in [image_name, tag]:
cmd = 'docker push {}'.format(item)
logger.debug('Running Docker push command (%s) ...', cmd)
if not args.dry_run:
subprocess.run(cmd, shell=True, check=True)


def _get_sdc_version(url):
Expand Down

0 comments on commit d89d510

Please sign in to comment.