Ini uploader attempt (#1545)

* try

* upload

* Update upload.sh

Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
Co-authored-by: rusefi <rusefi@users.noreply.github.com>
This commit is contained in:
andreika-git 2020-06-28 21:50:59 +03:00 committed by GitHub
parent 1857bfd70a
commit b5d42a605e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

View File

@ -14,10 +14,17 @@ jobs:
with:
fetch-depth: 0
- name: Install Tools
run: sudo apt-get install ncftp
- name: Generate Configs
working-directory: ./firmware/
run: sh gen_config.sh
- name: Upload .ini files
working-directory: ./firmware/tunerstudio
run: ./upload.sh ${{ secrets.RUSEFI_ONLINE_FTP_USER }} ${{ secrets.RUSEFI_ONLINE_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
- name: Generate Live Documentation
working-directory: ./firmware/
run: sh gen_live_documentation.sh

View File

@ -0,0 +1,25 @@
#!/bin/bash
if [ ! "$1" ] || [ ! "$2" ] || [ ! "$3" ]; then
echo "No Secrets"
exit 0
fi
echo -e "\nUploading .ini files"
for f in *.ini; do if [[ -f "$f" ]]; then
echo "Processing file $f:"
sig=$(grep "^ *signature *=" $f | cut -f2 -d "=")
if [ ! -z "$sig" -a "$sig" != " " ]; then
echo "* found signature: $sig"
if [[ "$sig" =~ rusEFI.*([0-9]{4}[^\"]+) ]]; then
sig=${BASH_REMATCH[1]}
sig="${sig//\./\/}.ini"
path="/rusefi/$sig"
echo "* found path: $path"
ncftpput -m -R -v -u "$1" -p "$2" "$3" autoupdate $path
echo "* upload done!"
fi
fi
fi; done