From a233de325588640fbfb28886c846cc8c608709ba Mon Sep 17 00:00:00 2001 From: Manuela Weigold Date: Tue, 27 Oct 2020 15:24:57 +0100 Subject: [PATCH 1/2] test & clone a single branch (until now master is the default) --- Dockerfile | 7 ++++--- clone-data-repo.sh | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ea4b45..2a3896a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,9 @@ FROM postgres:12 LABEL MAINTAINER Manuela Weigold -ENV PATTERN_ATLAS_CONTENT_REPOSITORY_URL "https://github.com/PatternPedia/pattern-atlas-content.git" -ENV PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL "git@github.com:PatternPedia/internal-pattern-atlas-content.git" +ENV PATTERN_ATLAS_CONTENT_REPOSITORY_URL "https://github.com/PatternAtlas/pattern-atlas-content.git" +ENV PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL "git@github.com:PatternAtlas/internal-pattern-atlas-content.git" +ENV PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH "update-qc-patterns" ENV SUBFOLDER_CONTENT_REPO_BACKUP_FILES "db-backup-files" ENV COPY_CONTENT_REPOSITORY_TARGET_PATH "/var/pattern-atlas/testdata" ENV POSTGRES_PASSWORD postgres @@ -21,4 +22,4 @@ RUN apt-get update \ COPY clone-data-repo.sh clone-data-repo.sh # if ssh key is set, clone data repo with the sql scripts for initalization and start postgres afterwards -CMD chmod 700 clone-data-repo.sh && ./clone-data-repo.sh && su postgres -c "/usr/local/bin/docker-entrypoint.sh postgres" \ No newline at end of file +CMD chmod 700 clone-data-repo.sh && ./clone-data-repo.sh && su postgres -c "/usr/local/bin/docker-entrypoint.sh postgres" diff --git a/clone-data-repo.sh b/clone-data-repo.sh index a4867d6..f28cfba 100644 --- a/clone-data-repo.sh +++ b/clone-data-repo.sh @@ -11,11 +11,13 @@ if test -f "$FILE"; then mkdir /root/.ssh/ && cp /run/secrets/ssh_secret /root/.ssh/id_rsa chmod 400 /root/.ssh/id_rsa && ssh-keyscan github.com >> /root/.ssh/known_hosts # clone repo - git clone ${PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL} ${COPY_CONTENT_REPOSITORY_TARGET_PATH} + git clone --single-branch --branch ${PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH} ${PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL} ${COPY_CONTENT_REPOSITORY_TARGET_PATH} + echo "cloned ${PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH} of ${PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL}" else echo "ssh key not present, proceeding with public db" # clone repo - git clone ${PATTERN_ATLAS_CONTENT_REPOSITORY_URL} ${COPY_CONTENT_REPOSITORY_TARGET_PATH} + git clone --single-branch --branch ${PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH} ${PATTERN_ATLAS_CONTENT_REPOSITORY_URL} ${COPY_CONTENT_REPOSITORY_TARGET_PATH} + echo "cloned ${PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH} of ${PATTERN_ATLAS_CONTENT_REPOSITORY_URL}" fi #copy the file with the sql statements to the folder that is executed on startup of the postgres db mv ${COPY_CONTENT_REPOSITORY_TARGET_PATH}/${SUBFOLDER_CONTENT_REPO_BACKUP_FILES}/* /docker-entrypoint-initdb.d/ \ No newline at end of file From 26a7eff51811d752dae768874ff63985478696bc Mon Sep 17 00:00:00 2001 From: Manuela Weigold Date: Fri, 8 Jan 2021 09:47:30 +0100 Subject: [PATCH 2/2] reset repo branch for data to master --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2a3896a..cd284ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL MAINTAINER Manuela Weigold ENV PATTERN_ATLAS_CONTENT_REPOSITORY_URL "https://github.com/PatternAtlas/pattern-atlas-content.git" ENV PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL "git@github.com:PatternAtlas/internal-pattern-atlas-content.git" -ENV PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH "update-qc-patterns" +ENV PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH "master" ENV SUBFOLDER_CONTENT_REPO_BACKUP_FILES "db-backup-files" ENV COPY_CONTENT_REPOSITORY_TARGET_PATH "/var/pattern-atlas/testdata" ENV POSTGRES_PASSWORD postgres