From 3f2a4f2c0684f88ec39748c756552991d8ebf29b Mon Sep 17 00:00:00 2001 From: Michal Jastrzebski Date: Thu, 10 Dec 2015 12:54:05 -0600 Subject: [PATCH] Record version on container build This changes default behaviour of build.py to instad of putting latest tag on it, it puts current kolla version as found in setup.cfg Change-Id: I4d6e9a0159c6a5598abd58072594df4204427308 Partially-Implements: blueprint upgrade-nova Partially-Implements: blueprint record-version --- ansible/group_vars/all.yml | 2 +- etc/kolla/globals.yml | 2 +- kolla/cmd/build.py | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 431de1dc6f..3c5e41e0f1 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -114,7 +114,7 @@ magnum_api_port: "9511" #################### # Openstack options #################### -openstack_release: "latest" +openstack_release: "1.0.0" openstack_logging_verbose: "True" openstack_logging_debug: "False" diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index a59508df61..62feb5ddbd 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -75,7 +75,7 @@ neutron_external_interface: "eth1" # OpenStack options #################### # This option is used to specify the tag to use when pulling the Docker images -#openstack_release: "latest" +#openstack_release: "1.0.0" # Use these options to set the various log levels across all OpenStack projects #openstack_logging_verbose: "True" diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py index 216d9d48bc..1944ee9781 100755 --- a/kolla/cmd/build.py +++ b/kolla/cmd/build.py @@ -227,6 +227,14 @@ class WorkerThread(Thread): LOG.info('{}:Built'.format(image['name'])) +def get_kolla_version(): + local_conf_path = os.path.join(find_base_dir(), "setup.cfg") + config = six.moves.configparser.RawConfigParser() + config.read(local_conf_path) + version = config.get("metadata", "version") + return version + + def find_os_type(): return platform.linux_distribution() @@ -267,7 +275,7 @@ def merge_args_and_config(settings_from_config_file): defaults = { "namespace": "kollaglue", - "tag": "latest", + "tag": get_kolla_version(), "base": "centos", "base_tag": "latest", "install_type": "binary",