From 447845c0f79425d500f2b6ad1a660dec42681f9f Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Fri, 15 Mar 2019 19:53:00 +0000 Subject: [PATCH] Allow to pass project from external directory This patch allows to pass directory with source code of projects to conteiner during build. This is useful when it is not possible to clone project in anonymous mode. Change-Id: Id157ad614b790a87d8c8910a438a29887f9fc46e --- Dockerfile | 1 + data/.gitignore | 2 ++ scripts/clone_project.sh | 12 +++++++----- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 data/.gitignore diff --git a/Dockerfile b/Dockerfile index a75aab32..9e3e11d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,7 @@ ARG NOVNC_REF=${NOVNC_REF:-v1.0.0} ARG SPICE_REPO=${SPICE_REPO:-https://gitlab.freedesktop.org/spice/spice-html5.git} ARG SPICE_REF=${SPICE_REF:-spice-html5-0.1.6} +ADD data /tmp/ COPY scripts /opt/loci/scripts ADD bindep.txt pydep.txt $EXTRA_BINDEP $EXTRA_PYDEP /opt/loci/ diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/scripts/clone_project.sh b/scripts/clone_project.sh index 8809d8db..bb66e7c6 100755 --- a/scripts/clone_project.sh +++ b/scripts/clone_project.sh @@ -2,8 +2,10 @@ set -eux -git clone ${PROJECT_REPO} /tmp/${PROJECT} -pushd /tmp/${PROJECT} -git fetch ${PROJECT_REPO} ${PROJECT_REF} -git checkout FETCH_HEAD -popd +if [[ ! -d /tmp/${PROJECT} ]]; then + git clone ${PROJECT_REPO} /tmp/${PROJECT} + pushd /tmp/${PROJECT} + git fetch ${PROJECT_REPO} ${PROJECT_REF} + git checkout FETCH_HEAD + popd +fi