From ca8ef29ae4ad9aefebd8e5736ba2e71ef8d6cc49 Mon Sep 17 00:00:00 2001 From: Aleksandr Didenko Date: Fri, 1 Jul 2016 16:34:20 +0200 Subject: [PATCH] Add temp fix for bug in mcp builder --- ccp/patch1 | 28 ++++++++++++++++++++++++++++ playbooks/ccp-build.yaml | 5 +++++ 2 files changed, 33 insertions(+) create mode 100644 ccp/patch1 diff --git a/ccp/patch1 b/ccp/patch1 new file mode 100644 index 000000000..e98a2c463 --- /dev/null +++ b/ccp/patch1 @@ -0,0 +1,28 @@ +diff --git a/microservices/build.py b/microservices/build.py +index 1f26b5a..e419343 100644 +--- a/microservices/build.py ++++ b/microservices/build.py +@@ -84,7 +84,7 @@ def find_dockerfiles(repository_name, tmp_dir, match=True): + return dockerfiles + + +-IMAGE_FULL_NAME_RE = "(([\\w_-]+)\\/)?([\\w_-]+)(:([\\w_.-]+))?" ++IMAGE_FULL_NAME_RE = "(.*\/)?(([\\w_-]+)\\/)?([\\w_-]+)(:([\\w_.-]+))?" + IMAGE_FULL_NAME_PATTERN = re.compile(IMAGE_FULL_NAME_RE) + + DOCKER_FILE_FROM_PATTERN = re.compile( + +diff --git a/microservices/common/jinja_utils.py b/microservices/common/jinja_utils.py +index c9c8cd2..37ff6f2 100644 +--- a/microservices/common/jinja_utils.py ++++ b/microservices/common/jinja_utils.py +@@ -16,6 +16,9 @@ def str_to_bool(text): + + def jinja_render(path): + variables = {k: v for k, v in CONF.images.items()} ++ if CONF.builder.push and CONF.registry.address: ++ variables['namespace'] = '%s/%s' % (CONF.registry.address, ++ variables['namespace']) + + env = jinja2.Environment(loader=jinja2.FileSystemLoader( + os.path.dirname(path))) diff --git a/playbooks/ccp-build.yaml b/playbooks/ccp-build.yaml index 3909be830..468e846ac 100644 --- a/playbooks/ccp-build.yaml +++ b/playbooks/ccp-build.yaml @@ -9,6 +9,11 @@ rsync_opts: - "--exclude=/microservices-repos" tasks: + - name: Patch MCP + shell: patch -p1 < ../patch1 + args: + chdir: /root/ccp/microservices/ + creates: /usr/local/bin/mcp-microservices - name: Install MCP shell: "{{ item }}" args: