Commit 214d22f1 by Feanil Patel

Merge pull request #833 from edx/feanil/tag_amis

Feanil/tag amis
parents 1b7067c1 c1fad324
......@@ -193,7 +193,7 @@ def notify_abbey(config, deployment, all_plays, release_id,
params['play'] = play_name
params['deployment'] = deployment
params['environment'] = env
params['vars'] = yaml.safe_dump(play['vars'], default_flow_style=False)
params['refs'] = yaml.safe_dump(play['vars'], default_flow_style=False)
params['release_id'] = release_id
params['mongo_uri'] = mongo_uri
params['configuration'] = configuration_ref
......
......@@ -517,12 +517,20 @@ def create_ami(instance_id, name, description):
'no_reboot': True}
image_id = ec2.create_image(**params)
for _ in xrange(AMI_TIMEOUT):
try:
img = ec2.get_image(image_id)
if img.state == 'available':
break
img.add_tag("environment", args.environment)
img.add_tag("deployment", args.deployment)
img.add_tag("play", args.play)
img.add_tag("configuration_ref", args.configuration_version)
img.add_tag("configuration_secure_ref", args.configuration_secure_version)
img.add_tag("configuration_secure_repo", args.configuration_secure_repo)
img.add_tag("build_id", args.jenkins_build)
for repo,ref in git_refs.items():
key = "vars:{}".format(repo)
img.add_tag(key, ref)
else:
time.sleep(1)
except EC2ResponseError as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment