Moved data to /srv/Repo_Cache

This commit is contained in:
Nicole Rappe 2024-05-07 12:36:51 -06:00
parent b9d1c8d2e3
commit b21c915c72
3 changed files with 7 additions and 7 deletions

View File

@ -5,11 +5,11 @@ FROM alpine:latest
RUN apk --no-cache add git curl rsync
# Add script
COPY repo_watcher.sh /repo_watcher.sh
RUN chmod +x /repo_watcher.sh
COPY repo_watcher.sh /srv/repo_watcher.sh
RUN chmod +x /srv/repo_watcher.sh
#Create Directory to store Repositories
RUN mkdir -p /root/Repo_Cache
RUN mkdir -p /srv/Repo_Cache
# Start script (Alpine uses /bin/sh instead of /bin/bash)
CMD ["/bin/sh", "-c", "/repo_watcher.sh"]
CMD ["/bin/sh", "-c", "/srv/repo_watcher.sh"]

View File

@ -8,5 +8,5 @@ services:
image: git.bunny-lab.io/container-registry/git-repo-updater:latest
volumes:
- /srv/containers:/srv/containers
- /srv/containers/git-repo-updater/Repo_Cache:/root/Repo_Cache
- /srv/containers/git-repo-updater/Repo_Cache:/srv/Repo_Cache
restart: always

View File

@ -6,13 +6,13 @@ process_repo() {
DESTINATION=$2
# Ensure The Repo is marked as Safe by Git
git config --global --add safe.directory /root/Repo_Cache/docs
# git config --global --add safe.directory /srv/Repo_Cache/docs
# Extract the URL without credentials for logging and notifications
CLEAN_REPO_URL=$(echo "$FULL_REPO_URL" | sed 's/https:\/\/[^@]*@/https:\/\//')
# Directory to hold the repository locally
REPO_DIR="/root/Repo_Cache/$(basename $CLEAN_REPO_URL .git)"
REPO_DIR="/srv/Repo_Cache/$(basename $CLEAN_REPO_URL .git)"
# Clone the repo if it doesn't exist, or navigate to it if it does
if [ ! -d "$REPO_DIR" ]; then