File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ FROM postgres:12
22
33LABEL MAINTAINER Manuela Weigold <
[email protected] >
44
5- ENV PATTERN_ATLAS_CONTENT_REPOSITORY_URL "https://github.com/PatternPedia/pattern-atlas-content.git"
6- ENV PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL
"[email protected] :PatternPedia/internal-pattern-atlas-content.git" 5+ ENV PATTERN_ATLAS_CONTENT_REPOSITORY_URL "https://github.com/PatternAtlas/pattern-atlas-content.git"
6+ ENV PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL
"[email protected] :PatternAtlas/internal-pattern-atlas-content.git" 7+ ENV PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH "master"
78ENV SUBFOLDER_CONTENT_REPO_BACKUP_FILES "db-backup-files"
89ENV COPY_CONTENT_REPOSITORY_TARGET_PATH "/var/pattern-atlas/testdata"
910ENV POSTGRES_PASSWORD postgres
@@ -21,4 +22,4 @@ RUN apt-get update \
2122COPY clone-data-repo.sh clone-data-repo.sh
2223
2324# if ssh key is set, clone data repo with the sql scripts for initalization and start postgres afterwards
24- CMD chmod 700 clone-data-repo.sh && ./clone-data-repo.sh && su postgres -c "/usr/local/bin/docker-entrypoint.sh postgres"
25+ CMD chmod 700 clone-data-repo.sh && ./clone-data-repo.sh && su postgres -c "/usr/local/bin/docker-entrypoint.sh postgres"
Original file line number Diff line number Diff line change @@ -11,11 +11,13 @@ if test -f "$FILE"; then
1111 mkdir /root/.ssh/ && cp /run/secrets/ssh_secret /root/.ssh/id_rsa
1212 chmod 400 /root/.ssh/id_rsa && ssh-keyscan github.com >> /root/.ssh/known_hosts
1313# clone repo
14- git clone ${PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL} ${COPY_CONTENT_REPOSITORY_TARGET_PATH}
14+ git clone --single-branch --branch ${PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH} ${PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL} ${COPY_CONTENT_REPOSITORY_TARGET_PATH}
15+ echo " cloned ${PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH} of ${PATTERN_ATLAS_PRIVATE_CONTENT_REPOSITORY_URL} "
1516else
1617 echo " ssh key not present, proceeding with public db"
1718# clone repo
18- git clone ${PATTERN_ATLAS_CONTENT_REPOSITORY_URL} ${COPY_CONTENT_REPOSITORY_TARGET_PATH}
19+ git clone --single-branch --branch ${PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH} ${PATTERN_ATLAS_CONTENT_REPOSITORY_URL} ${COPY_CONTENT_REPOSITORY_TARGET_PATH}
20+ echo " cloned ${PATTERN_ATLAS_CONTENT_REPOSITORY_BRANCH} of ${PATTERN_ATLAS_CONTENT_REPOSITORY_URL} "
1921fi
2022# copy the file with the sql statements to the folder that is executed on startup of the postgres db
2123mv ${COPY_CONTENT_REPOSITORY_TARGET_PATH} /${SUBFOLDER_CONTENT_REPO_BACKUP_FILES} /* /docker-entrypoint-initdb.d/
You can’t perform that action at this time.
0 commit comments