diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-10-06 10:05:02 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-10-06 10:05:02 +0000 |
| commit | d352505ccbe4da37f0c8bf231016f9da2f46458d (patch) | |
| tree | 070f09f3c0ae83c43589f8cb5eb458e3f757cf4c | |
| parent | c879b1f2711db6aefe7dbf88b0b08d3a32e1e02a (diff) | |
| parent | 9bacf1bdbd27b81c78ec45de3caae582ad2091b1 (diff) | |
| download | kolla-d352505ccbe4da37f0c8bf231016f9da2f46458d.tar.gz kolla-d352505ccbe4da37f0c8bf231016f9da2f46458d.zip | |
Merge "add "--template-only" flag for tools/build.py"
| -rwxr-xr-x | kolla/cmd/build.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py index ed4a34992..e6e43dd70 100755 --- a/kolla/cmd/build.py +++ b/kolla/cmd/build.py @@ -282,6 +282,9 @@ def merge_args_and_config(settings_from_config_file): help=('Path to custom file to be added at ' 'end of Dockerfiles for final images'), type=str) + parser.add_argument('--template-only', + help=("Don't build images. Generate Dockerfile only"), + action='store_true') return vars(parser.parse_args()) @@ -297,6 +300,7 @@ class KollaWorker(object): self.install_type = config['install_type'] self.tag = config['tag'] self.image_prefix = self.base + '-' + config['install_type'] + '-' + self.images = list() if '-' in config['install_type']: self.install_type, self.install_metatype = \ @@ -445,7 +449,6 @@ class KollaWorker(object): self.image_statuses_unmatched) def build_image_list(self): - self.images = list() for path in self.docker_build_paths: # Reading parent image name with open(os.path.join(path, 'Dockerfile')) as f: @@ -543,6 +546,10 @@ def main(): kolla.find_dockerfiles() kolla.create_dockerfiles() + if config['template_only']: + LOG.info('Dockerfiles are generated in {}'.format(kolla.working_dir)) + return + # We set the atime and mtime to 0 epoch to preserve allow the Docker cache # to work like we want. A different size or hash will still force a rebuild kolla.set_time() |
