Skip to content

Commit

Permalink
try chunking the deploy another way
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Jun 18, 2024
1 parent dfc6e57 commit 68f4332
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,31 @@ tar -xf "matomo-$VERSION.tgz" --directory="$TMP_DIR" # the archive is created vi

cd "$SVN_DIR"

# Copy from clean copy to /trunk, excluding dotorg assets
# The --delete flag will delete anything in destination that no longer exists in source
rsync -rc "$TMP_DIR/" trunk --delete --delete-excluded

# Copy dotorg assets to /assets
rsync -rc "$GITHUB_WORKSPACE/$ASSETS_DIR/" assets/ --delete --delete-excluded

# Add everything and commit to SVN (in chunks in case there's too many changes in Matomo core)
PIECES=(app/core app/plugins app/vendor app .)
for chunk in ${PIECES[@]}; do
if [[ ! -d "trunk/$chunk" ]]; then
# Copy from clean copy to /trunk, excluding dotorg assets
# The --delete flag will delete anything in destination that no longer exists in source
RSYNC_FROM="$TMP_DIR/$chunk/"
RSYNC_TO="trunk/$chunk"
if [[ "$chunk" == "." ]]; then
RSYNC_FROM="$TMP_DIR/"
RSYNC_TO="trunk"
fi
rsync -rc RSYNC_FROM RSYNC_TO --delete --delete-excluded

if [[ ! -d "trunk/$chunk" ]]; then # sanity check
echo "➤ ERROR: '$chunk' folder does not exist"
exit 1;
fi

# The force flag ensures we recurse into subdirectories even if they are already added
# Suppress stdout in favor of svn status later for readability
echo "➤ Preparing files ($chunk)..."
svn add "trunk/$chunk" --force # > /dev/null
svn add . --force # > /dev/null

# SVN delete all deleted files
# Also suppress stdout here
Expand Down

0 comments on commit 68f4332

Please sign in to comment.