Initial commit

This commit is contained in:
2025-10-02 08:54:03 +02:00
commit ea54638227
1642 changed files with 53677 additions and 0 deletions

38
scripts/deploy.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/sh
# if RSYNC_USER or RSYNC_PASS is not set, exit
if [ -z "${RSYNC_USER}" ] || [ -z "${RSYNC_PASS}" ] || [ -z "${RSYNC_HOST}" ] || [ -z "${RSYNC_PORT}" ]; then
echo "RSYNC_ settings not complete, exiting"
exit 1
fi
excludes=""
if [ "${BRANCH}" == "main" ]; then
excludes='--exclude=src --exclude=*.map'
echo "main deploy, excluding $excludes"
fi
# sync frontend
rsync -rlcgD --perms -i -u -v --stats --progress \
--delete \
-e "sshpass -p ${RSYNC_PASS} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${RSYNC_PORT}" \
$excludes \
frontend/ \
${RSYNC_USER}@${RSYNC_HOST}:./frontend/ \
# sync api config
rsync -rlcgD --perms -i -u -v --stats --progress \
--delete \
-e "sshpass -p ${RSYNC_PASS} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${RSYNC_PORT}" \
api/ \
${RSYNC_USER}@${RSYNC_HOST}:./api/
# create media directory
mkdir media
chmod 770 media
rsync -rlcgD --perms -i -u -v --stats --progress \
-e "sshpass -p ${RSYNC_PASS} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${RSYNC_PORT}" \
media \
${RSYNC_USER}@${RSYNC_HOST}:./
# tst