[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] automation: introduce CONTAINER_NO_PULL for containerize



commit 102a437d59ae93449a94f46d7b790aded25b8179
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Mon Nov 19 12:11:48 2018 +0000
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Tue Nov 20 16:54:55 2018 +0000

    automation: introduce CONTAINER_NO_PULL for containerize
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Doug Goldstein <cardoe@xxxxxxxxxx>
---
 automation/build/README.md      | 3 +++
 automation/scripts/containerize | 8 +++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/automation/build/README.md b/automation/build/README.md
index f6cfd46f1e..d8c8a18e33 100644
--- a/automation/build/README.md
+++ b/automation/build/README.md
@@ -52,6 +52,9 @@ understands.
 
 - CONTAINER_UID0: This specifies whether root is used inside the container.
 
+- CONTAINER_NO_PULL: If set to 1, the script will not pull from docker hub.
+  This is useful when testing container locally.
+
 - XEN_CONFIG_EXPERT: If this is defined in your shell it will be
   automatically passed through to the container.
 
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index aa08274eba..a3e5d79c70 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -42,9 +42,11 @@ tty -s && termint=t
 # Fetch the latest version of the container in hub.docker.com,
 # unless it's a newly created local copy.
 #
-einfo "*** Ensuring ${CONTAINER} is up to date"
-docker pull ${CONTAINER} > /dev/null ||     \
-    die "Failed to update docker container"
+if [[ "_${CONTAINER_NO_PULL}" != "_1" ]]; then
+    einfo "*** Ensuring ${CONTAINER} is up to date"
+    docker pull ${CONTAINER} > /dev/null ||     \
+        die "Failed to update docker container"
+fi
 
 if hash greadlink > /dev/null 2>&1; then
     READLINK=greadlink
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.