Commit a3634074 by Feanil Patel

Remove the refs/tags seperation.

Instead, we take any extra_vars that have a suffix of '_version' and
make sure those exist as tags on the AMI. All other vars do not get
saved anywhere.

Turn on instance tagging with abbey.
parent db444733
...@@ -76,19 +76,17 @@ def parse_args(): ...@@ -76,19 +76,17 @@ def parse_args():
help="don't cleanup on failures") help="don't cleanup on failures")
parser.add_argument('--vars', metavar="EXTRA_VAR_FILE", parser.add_argument('--vars', metavar="EXTRA_VAR_FILE",
help="path to extra var file", required=False) help="path to extra var file", required=False)
parser.add_argument('--refs', metavar="GIT_REFS_FILE",
help="path to a var file with app git refs", required=False)
parser.add_argument('--configuration-version', required=False, parser.add_argument('--configuration-version', required=False,
help="configuration repo branch(no hashes)", help="configuration repo gitref",
default="master") default="master")
parser.add_argument('--configuration-secure-version', required=False, parser.add_argument('--configuration-secure-version', required=False,
help="configuration-secure repo branch(no hashes)", help="configuration-secure repo gitref",
default="master") default="master")
parser.add_argument('--configuration-secure-repo', required=False, parser.add_argument('--configuration-secure-repo', required=False,
default="git@github.com:edx-ops/prod-secure", default="git@github.com:edx-ops/prod-secure",
help="repo to use for the secure files") help="repo to use for the secure files")
parser.add_argument('--configuration-private-version', required=False, parser.add_argument('--configuration-private-version', required=False,
help="configuration-private repo branch(no hashes)", help="configuration-private repo gitref",
default="master") default="master")
parser.add_argument('--configuration-private-repo', required=False, parser.add_argument('--configuration-private-repo', required=False,
default="git@github.com:edx-ops/ansible-private", default="git@github.com:edx-ops/ansible-private",
...@@ -287,8 +285,6 @@ cat << EOF >> $extra_vars ...@@ -287,8 +285,6 @@ cat << EOF >> $extra_vars
# of all the repositories # of all the repositories
{extra_vars_yml} {extra_vars_yml}
{git_refs_yml}
# abbey will always run fake migrations # abbey will always run fake migrations
# this is so that the application can come # this is so that the application can come
# up healthy # up healthy
...@@ -299,6 +295,7 @@ EDXAPP_UPDATE_STATIC_FILES_KEY: true ...@@ -299,6 +295,7 @@ EDXAPP_UPDATE_STATIC_FILES_KEY: true
edxapp_dynamic_cache_key: {deployment}-{environment}-{play}-{cache_id} edxapp_dynamic_cache_key: {deployment}-{environment}-{play}-{cache_id}
disable_edx_services: true disable_edx_services: true
COMMON_TAG_EC2_INSTANCE: true
# abbey should never take instances in # abbey should never take instances in
# and out of elbs # and out of elbs
...@@ -369,7 +366,6 @@ rm -rf $base_dir ...@@ -369,7 +366,6 @@ rm -rf $base_dir
identity_contents=identity_contents, identity_contents=identity_contents,
queue_name=run_id, queue_name=run_id,
extra_vars_yml=extra_vars_yml, extra_vars_yml=extra_vars_yml,
git_refs_yml=git_refs_yml,
secure_vars_file=secure_vars_file, secure_vars_file=secure_vars_file,
cache_id=args.cache_id) cache_id=args.cache_id)
...@@ -536,10 +532,11 @@ def create_ami(instance_id, name, description): ...@@ -536,10 +532,11 @@ def create_ami(instance_id, name, description):
time.sleep(AWS_API_WAIT_TIME) time.sleep(AWS_API_WAIT_TIME)
img.add_tag("cache_id", args.cache_id) img.add_tag("cache_id", args.cache_id)
time.sleep(AWS_API_WAIT_TIME) time.sleep(AWS_API_WAIT_TIME)
for repo, ref in git_refs.items(): for name,value in extra_vars.items():
key = "refs:{}".format(repo) if name.endswith('_version'):
img.add_tag(key, ref) key = "vars:{}".format(repo)
time.sleep(AWS_API_WAIT_TIME) img.add_tag(key, value)
time.sleep(AWS_API_WAIT_TIME)
break break
else: else:
time.sleep(1) time.sleep(1)
...@@ -674,14 +671,6 @@ if __name__ == '__main__': ...@@ -674,14 +671,6 @@ if __name__ == '__main__':
extra_vars_yml = "" extra_vars_yml = ""
extra_vars = {} extra_vars = {}
if args.refs:
with open(args.refs) as f:
git_refs_yml = f.read()
git_refs = yaml.load(git_refs_yml)
else:
git_refs_yml = ""
git_refs = {}
if args.secure_vars_file: if args.secure_vars_file:
# explicit path to a single # explicit path to a single
# secure var file # secure var file
......
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