Skip to content

Commit

Permalink
[ skip ci ] ensure container images with out of date runtimes are upd…
Browse files Browse the repository at this point in the history
…ated during initialization
  • Loading branch information
JoshuaDodds committed May 3, 2024
1 parent f7e8e91 commit 9d4f526
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sgc-simple-gitops-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@ git config pull.rebase true
git config --global user.email "[email protected]"
git config --global user.name "SGC Bot"

# Enter work loop
echo -e "$SVC_NAME: Entering work loop...";
# Check if update from git is needed and then enter work loop
echo -e "$SVC_NAME: Checking if container runtime needs an update..."
if diff -rq /app/ gitops-managed-repos/cerbomoticzgx/ | grep -vE 'pycache|env|cache|token|gitops|png|db'; then
echo -e "$SVC_NAME: Updating container runtime..."
rsync -qav --exclude 'log.txt' --exclude '__pycache__' /app/gitops-managed-repos/cerbomoticzgx/ /app/
else
echo -e "$SVC_NAME: Container runtime is up to date."
fi

# Main work loop
echo -e "$SVC_NAME: Entering work loop...";
while true; do
# echo -e "$SVC_NAME: Updating remote git repo & comparing with current state...";
git remote update >> /dev/null
Expand Down

0 comments on commit 9d4f526

Please sign in to comment.