fix(ci): upload legacy files independently
deploy-preland / deploy barbariskatest (push) Failing after 45s
deploy-preland / deploy zoomstage.online (push) Skipped
deploy-preland / deploy zoompixel.online (push) Successful in 33s
deploy-preland / deploy zoompixel.ru (push) Successful in 31s

This commit is contained in:
Panfilov Konstantin committed 2026-10-18 00:34:31 +03:00
1 parent 35b6a334ba
commit d646f98aa7
1 file changed
+10 -5
+10 -5
View File
@@ -91,15 +91,20 @@ jobs:
dir=$(printf '%s' "$REMOTE_DIR" | sed 's#^/*##; s#/*$##') dir=$(printf '%s' "$REMOTE_DIR" | sed 's#^/*##; s#/*$##')
case "$dir" in *[!A-Za-z0-9._/-]*) echo "недопустимый dir: $dir"; exit 1 ;; esac case "$dir" in *[!A-Za-z0-9._/-]*) echo "недопустимый dir: $dir"; exit 1 ;; esac
umask 077 umask 077
netrc=$(mktemp); list=$(mktemp) netrc=$(mktemp)
trap 'rm -f "$netrc" "$list"' EXIT trap 'rm -f "$netrc"' EXIT
printf 'machine %s login %s password %s\n' "$FTP_HOST" "$FTP_USER" "$FTP_PASS" > "$netrc" printf 'machine %s login %s password %s\n' "$FTP_HOST" "$FTP_USER" "$FTP_PASS" > "$netrc"
git ls-files | grep -vE '^(\.gitea/|README\.md$|AGENTS\.md$|CLAUDE\.md$|\.gitignore$|requisites\.html$|config\.json$)' > files.txt git ls-files | grep -vE '^(\.gitea/|README\.md$|AGENTS\.md$|CLAUDE\.md$|\.gitignore$|requisites\.html$|config\.json$)' > files.txt
# имя уходит в адрес ftp:// как есть — пробелы и прочее экранирование не поддерживаем # имя уходит в адрес ftp:// как есть — пробелы и прочее экранирование не поддерживаем
if grep -q '[^A-Za-z0-9._/-]' files.txt; then echo "имена с недопустимыми символами:"; grep '[^A-Za-z0-9._/-]' files.txt; exit 1; fi if grep -q '[^A-Za-z0-9._/-]' files.txt; then echo "имена с недопустимыми символами:"; grep '[^A-Za-z0-9._/-]' files.txt; exit 1; fi
# один curl на все файлы — одно соединение FTP+TLS вместо соединения на файл # Legacy FTP разрывает многокомандную сессию кодом 426. Загружаем
while read -r f; do printf 'upload-file = "%s"\nurl = "ftp://%s/%s%s"\n' "$f" "$FTP_HOST" "${dir:+$dir/}" "$f"; done < files.txt > "$list" # файлы отдельными FTPS-командами: при ошибке в журнале останется
curl -sS --ssl-reqd --netrc-file "$netrc" --ftp-create-dirs --retry 3 --fail-early -K "$list" # конкретный путь, а повторная отправка безопасна.
while read -r f; do
echo "загрузка: $f"
curl -sS --ssl-reqd --netrc-file "$netrc" --ftp-create-dirs --retry 3 --fail \
-T "$f" "ftp://$FTP_HOST/${dir:+$dir/}$f"
done < files.txt
echo "залито файлов: $(wc -l < files.txt)" echo "залито файлов: $(wc -l < files.txt)"
- name: Check the page - name: Check the page