Skip to content

Commit 6b4327a

Browse files
committed
Science Commit 5.
1 parent 0eeb2ff commit 6b4327a

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

modules/black/presidential/Brarner.M.Alete/install/deploy-local.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,26 @@ fi
4242
echo "[*] Deploying exploded webapp..."
4343
mkdir -p "$DEPLOY_DIR/WEB-INF/classes" "$DEPLOY_DIR/WEB-INF/lib"
4444
TOTAL_FILES=$(find "$WEBAPP_SRC" -type f 2>/dev/null | wc -l)
45-
echo " Source: $TOTAL_FILES files ($(du -sh "$WEBAPP_SRC" | cut -f1))"
45+
SRC_SIZE=$(du -sh "$WEBAPP_SRC" 2>/dev/null | cut -f1)
46+
echo " Source: $TOTAL_FILES files ($SRC_SIZE)"
4647
if command -v rsync &>/dev/null; then
47-
rsync -a --delete --info=progress2 --exclude='db.properties' "$WEBAPP_SRC/" "$DEPLOY_DIR/"
48-
echo " [✓] rsync complete"
48+
echo " Syncing to $DEPLOY_DIR ..."
49+
rsync -a --delete --progress --exclude='db.properties' "$WEBAPP_SRC/" "$DEPLOY_DIR/" 2>&1 | \
50+
awk 'BEGIN{n=0} /to-chk/{n++; printf "\r [rsync] %d files transferred...", n; fflush()} END{printf "\r [rsync] %d files transferred ✓\n", n}'
51+
echo " [✓] rsync complete ($SRC_SIZE)"
4952
else
5053
rm -rf "$DEPLOY_DIR"
5154
mkdir -p "$DEPLOY_DIR/WEB-INF/classes" "$DEPLOY_DIR/WEB-INF/lib"
52-
echo -n " Copying... "
53-
cp -r "$WEBAPP_SRC/"* "$DEPLOY_DIR/"
54-
echo ""
55+
echo -n " Copying $TOTAL_FILES files ($SRC_SIZE)... "
56+
cp -r "$WEBAPP_SRC/"* "$DEPLOY_DIR/" &
57+
CP_PID=$!
58+
while kill -0 "$CP_PID" 2>/dev/null; do
59+
DONE=$(find "$DEPLOY_DIR" -type f 2>/dev/null | wc -l)
60+
printf "\r Copying: %d / %d files " "$DONE" "$TOTAL_FILES"
61+
sleep 1
62+
done
63+
wait "$CP_PID"
64+
printf "\r Copying: %d / %d files ✓\n" "$TOTAL_FILES" "$TOTAL_FILES"
5565
fi
5666

5767
# Copy JARs from jars/ directory (preferred) or lib/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
33495
1+
35895

scripts/web/deploy-all.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ for SCRIPT in $ENABLED; do
5050
echo ""
5151
echo "[*] [$CURRENT_MODULE/$TOTAL_MODULES] Deploying: $SCRIPT"
5252
set +e
53-
timeout 180 bash "$FULL_PATH" 2>&1 | tail -20
54-
EXIT_CODE=${PIPESTATUS[0]}
53+
timeout 180 bash "$FULL_PATH" 2>&1
54+
EXIT_CODE=$?
5555
set -e
5656
if [ $EXIT_CODE -eq 0 ]; then
5757
PASS=$((PASS + 1))

0 commit comments

Comments
 (0)