-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docker] build: Allow cache invalidation
While at it, fix emoji issues with latest virtualenv [1]. JIRA: FUEL-398 [1] pypa/pipenv#3223 Change-Id: Ice5937222bf75c1ddadc6b9f1994635bc10faf57 Signed-off-by: Alexandru Avadanii <[email protected]> (cherry picked from commit f03a33b)
- Loading branch information
1 parent
6ca6454
commit bf4d472
Showing
5 changed files
with
87 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
mcp/patches/docker/0001-tasks.py-Allow-passing-extra-build-arg.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
: Copyright (c) 2018 Mirantis Inc., Enea AB and others. | ||
: | ||
: All rights reserved. This program and the accompanying materials | ||
: are made available under the terms of the Apache License, Version 2.0 | ||
: which accompanies this distribution, and is available at | ||
: http://www.apache.org/licenses/LICENSE-2.0 | ||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
From: Alexandru Avadanii <[email protected]> | ||
Date: Sun, 9 Sep 2018 23:18:39 +0200 | ||
Subject: [PATCH] tasks.py: Allow passing extra --build-arg | ||
|
||
E.g. A, B with values "a", respectively "b c": | ||
$ invoke build saltmaster-reclass --build-arg-extra='A="a" B="b c"' | ||
will be passed down as: | ||
--build-arg A="a" --build-arg B="b c" | ||
|
||
Signed-off-by: Alexandru Avadanii <[email protected]> | ||
--- | ||
tasks.py | 5 ++++- | ||
1 file changed, 4 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/tasks.py b/tasks.py | ||
index d6bf3bc..59e217d 100644 | ||
--- a/tasks.py | ||
+++ b/tasks.py | ||
@@ -3,6 +3,7 @@ | ||
|
||
|
||
from invoke import Collection, task | ||
+from shlex import split | ||
from string import Template | ||
import re | ||
import ast | ||
@@ -25,7 +26,7 @@ def all(ctx, dry=False, push=False, dry_targets=False, filter=None, **kwargs): | ||
dry=dry, push=push, dry_targets=dry_targets, filter=filter, **kwargs) | ||
|
||
@task | ||
-def build(ctx, target, require=[], dist='debian', dist_rel='stretch', salt=None, formula_rev=None, push=False, dry=False, dry_targets=False, **kwargs): | ||
+def build(ctx, target, require=[], dist='debian', dist_rel='stretch', salt=None, formula_rev=None, push=False, dry=False, dry_targets=False, build_arg_extra='', **kwargs): | ||
|
||
kwargs['dist'] = dist | ||
kwargs['dist_rel'] = dist_rel | ||
@@ -35,6 +36,7 @@ def build(ctx, target, require=[], dist='debian', dist_rel='stretch', salt=None, | ||
kwargs['require'] = require | ||
kwargs['salt'] = salt | ||
kwargs['target'] = target | ||
+ kwargs['build_arg_extra'] = ' --build-arg '.join([''] + split(build_arg_extra.replace('"', '"\\"'))) | ||
# command formating + update | ||
fmt = {'tag': ''} | ||
fmt.update(ctx.dockermake) | ||
@@ -60,6 +62,7 @@ def build(ctx, target, require=[], dist='debian', dist_rel='stretch', salt=None, | ||
\t--requires ${requires} \ | ||
\t--build-arg SALT_VERSION="${salt}" \ | ||
\t--build-arg SALT_FORMULA_VERSION="${formula_rev}" \ | ||
+ \t${build_arg_extra} \ | ||
\t${push} ${options} \ | ||
${fin}""").safe_substitute(fmt) | ||
ctx.run(cmd.replace(' ', '')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,22 @@ Subject: [PATCH] OPNFV package installation, Ubuntu user | |
|
||
Signed-off-by: Alexandru Avadanii <[email protected]> | ||
--- | ||
DockerMake.yml | 38 ++++++++++++++++++++++++++++++++++++-- | ||
1 file changed, 36 insertions(+), 2 deletions(-) | ||
DockerMake.yml | 37 ++++++++++++++++++++++++++++++++++++- | ||
1 file changed, 36 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/DockerMake.yml b/DockerMake.yml | ||
index 2c75586..13813a2 100644 | ||
index 2c75586..eb06cbd 100644 | ||
--- a/DockerMake.yml | ||
+++ b/DockerMake.yml | ||
@@ -94,7 +94,7 @@ salt-formulas: | ||
@@ -29,6 +29,7 @@ common-cleanup: | ||
|
||
common: | ||
build: | | ||
+ ARG CACHE_INVALIDATE="0" | ||
RUN echo "Layer with common packages" \ | ||
&& eval ${LAYER_PKGUPDT} \ | ||
&& apt-get upgrade -qy \ | ||
@@ -94,7 +95,7 @@ salt-formulas: | ||
build: | | ||
ARG SALT_FORMULA_VERSION="master" | ||
ENV SALT_FORMULA_VERSION $SALT_FORMULA_VERSION | ||
|
@@ -37,14 +45,7 @@ index 2c75586..13813a2 100644 | |
ENV SALT_FORMULA_SOURCES $SALT_FORMULA_SOURCES | ||
ARG SALT_FORMULAS_BASE="/srv/salt/formula" | ||
ENV SALT_FORMULAS_BASE $SALT_FORMULAS_BASE | ||
@@ -102,12 +102,46 @@ salt-formulas: | ||
ENV SALT_ENV_PATH_ $SALT_ENV_PATH_ | ||
ARG RECLASS_BASE="/srv/salt/reclass" | ||
ENV RECLASS_BASE $RECLASS_BASE | ||
- RUN echo "Layer python/salt module prerequisites, formulas" \ | ||
+ RUN echo "Layer python/salt module prerequisites, formulas (09 Nov 2018)" \ | ||
&& mkdir -p /srv/salt \ | ||
&& curl -sSqL https://raw.githubusercontent.com/salt-formulas/salt-formulas-scripts/master/formula-fetch.sh -o /srv/salt/formula-fetch.sh \ | ||
@@ -108,6 +109,40 @@ salt-formulas: | ||
&& bash -c 'source /srv/salt/formula-fetch.sh && setupPyEnv && fetchAll' \ | ||
&& eval ${LAYER_CLEANUP} | ||
|
||
|
File renamed without changes.