Commit 81df0a5f by Feanil Patel

Add a new arg just for git refs.

This seperates the git refs from the rest of the vars because the git refs should end up in
the ami document in mongo but the other vars should not.
parent b074558f
......@@ -58,7 +58,7 @@ class MongoConnection:
'deployment': args.deployment,
'configuration_ref': args.configuration_version,
'configuration_secure_ref': args.configuration_secure_version,
'vars': extra_vars,
'vars': git_refs,
}
try:
self.mongo_ami.insert(query)
......@@ -142,6 +142,8 @@ def parse_args():
help="don't cleanup on failures")
parser.add_argument('--vars', metavar="EXTRA_VAR_FILE",
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('-a', '--application', required=False,
help="Application for subnet, defaults to admin",
default="admin")
......@@ -318,6 +320,7 @@ cat << EOF >> $extra_vars
# abbey.py including versions
# of all the repositories
{extra_vars_yml}
{git_refs_yml}
# path to local checkout of
# the secure repo
......@@ -370,6 +373,7 @@ rm -rf $base_dir
identity_file=identity_file,
queue_name=run_id,
extra_vars_yml=extra_vars_yml,
git_refs_yml=git_refs_yml,
secure_vars=secure_vars)
ec2_args = {
......@@ -636,6 +640,14 @@ if __name__ == '__main__':
extra_vars_yml = "---\n"
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 = "---\n"
git_refs = {}
if args.secure_vars:
secure_vars = args.secure_vars
else:
......
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