Use SSH to upload firmware (#3394)
* install sshpass instead of ncftp * use ssh * change env vars * fix checks and sftp>ssh
This commit is contained in:
parent
37bf852368
commit
78e3c0c760
|
@ -141,10 +141,10 @@ jobs:
|
|||
with:
|
||||
java-version: '8'
|
||||
|
||||
- name: Install multilib, mingw, ncftp and mtools
|
||||
- name: Install multilib, mingw, sshpass and mtools
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-multilib g++-multilib g++-mingw-w64 gcc-mingw-w64 ncftp mtools
|
||||
sudo apt-get install gcc-multilib g++-multilib g++-mingw-w64 gcc-mingw-w64 sshpass mtools
|
||||
sudo apt-get install zip
|
||||
sudo apt-get install dosfstools
|
||||
|
||||
|
@ -193,14 +193,14 @@ jobs:
|
|||
- name: Test Compiler
|
||||
run: arm-none-eabi-gcc -v
|
||||
|
||||
- name: Configs Set FTP variables
|
||||
- name: Configs Set SSH variables
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
||||
run: |
|
||||
if [ "${{github.event_name}}" = "push" ] && [ "${{github.ref}}" = "refs/heads/master" ]; then
|
||||
echo "::set-env name=RUSEFI_FTP_SERVER::${{secrets.RUSEFI_FTP_SERVER}}";
|
||||
echo "::set-env name=RUSEFI_BUILD_FTP_USER::${{secrets.RUSEFI_BUILD_FTP_USER}}";
|
||||
echo "::set-env name=RUSEFI_BUILD_FTP_PASS::${{secrets.RUSEFI_BUILD_FTP_PASS}}";
|
||||
echo "::set-env name=RUSEFI_SSH_SERVER::${{secrets.RUSEFI_SSH_SERVER}}";
|
||||
echo "::set-env name=RUSEFI_SSH_USER::${{secrets.RUSEFI_SSH_USER}}";
|
||||
echo "::set-env name=RUSEFI_SSH_PASS::${{secrets.RUSEFI_SSH_PASS}}";
|
||||
fi
|
||||
|
||||
# Build rusEFI console
|
||||
|
@ -274,10 +274,10 @@ jobs:
|
|||
with:
|
||||
java-version: '8'
|
||||
|
||||
- name: Install multilib, mingw, and ncftp
|
||||
- name: Install multilib, mingw, and sshpass
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-multilib g++-multilib g++-mingw-w64 gcc-mingw-w64 ncftp mtools zip dosfstools
|
||||
sudo apt-get install gcc-multilib g++-multilib g++-mingw-w64 gcc-mingw-w64 sshpass mtools zip dosfstools
|
||||
|
||||
- name: Generate Enum Strings
|
||||
working-directory: ./firmware/
|
||||
|
@ -304,14 +304,14 @@ jobs:
|
|||
- name: Test Compiler
|
||||
run: arm-none-eabi-gcc -v
|
||||
|
||||
- name: primary Set FTP variables
|
||||
- name: primary Set SSH variables
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
||||
run: |
|
||||
if [ "${{github.event_name}}" = "push" ] && [ "${{github.ref}}" = "refs/heads/master" ]; then
|
||||
echo "::set-env name=RUSEFI_FTP_SERVER::${{secrets.RUSEFI_FTP_SERVER}}";
|
||||
echo "::set-env name=RUSEFI_BUILD_FTP_USER::${{secrets.RUSEFI_BUILD_FTP_USER}}";
|
||||
echo "::set-env name=RUSEFI_BUILD_FTP_PASS::${{secrets.RUSEFI_BUILD_FTP_PASS}}";
|
||||
echo "::set-env name=RUSEFI_SSH_SERVER::${{secrets.RUSEFI_SSH_SERVER}}";
|
||||
echo "::set-env name=RUSEFI_SSH_USER::${{secrets.RUSEFI_SSH_USER}}";
|
||||
echo "::set-env name=RUSEFI_SSH_PASS::${{secrets.RUSEFI_SSH_PASS}}";
|
||||
fi
|
||||
|
||||
- name: Build Primary Bundle
|
||||
|
|
|
@ -102,11 +102,9 @@ ls -l $FULL_BUNDLE_FILE
|
|||
|
||||
[ -e $FULL_BUNDLE_FILE ] || { echo "$SCRIPT_NAME: ERROR not found $FULL_BUNDLE_FILE"; exit 1; }
|
||||
|
||||
if [ -n "$RUSEFI_BUILD_FTP_USER" ]; then
|
||||
if [ -n "$RUSEFI_SSH_USER" ]; then
|
||||
echo "$SCRIPT_NAME: Uploading full bundle"
|
||||
echo put $FULL_BUNDLE_FILE . > cmd
|
||||
cat cmd
|
||||
sshpass -p $RUSEFI_BUILD_FTP_PASS sftp -o StrictHostKeyChecking=no $RUSEFI_BUILD_FTP_USER@$RUSEFI_FTP_SERVER <<< `cat cmd`
|
||||
tar -czf - $FULL_BUNDLE_FILE | sshpass -p $RUSEFI_SSH_PASS ssh -o StrictHostKeyChecking=no $RUSEFI_SSH_USER@$RUSEFI_SSH_SERVER "tar -xzf - -C build_server"
|
||||
retVal=$?
|
||||
if [ $retVal -ne 0 ]; then
|
||||
echo "full bundle upload failed"
|
||||
|
@ -132,10 +130,8 @@ cd $FOLDER
|
|||
zip -r ../$UPDATE_BUNDLE_FILE *
|
||||
cd ..
|
||||
ls -l $UPDATE_BUNDLE_FILE
|
||||
if [ -n "$RUSEFI_BUILD_FTP_USER" ]; then
|
||||
echo put $UPDATE_BUNDLE_FILE autoupdate > cmd
|
||||
cat cmd
|
||||
sshpass -p $RUSEFI_BUILD_FTP_PASS sftp -o StrictHostKeyChecking=no $RUSEFI_BUILD_FTP_USER@$RUSEFI_FTP_SERVER <<< `cat cmd`
|
||||
if [ -n "$RUSEFI_SSH_USER" ]; then
|
||||
tar -czf - $UPDATE_BUNDLE_FILE | sshpass -p $RUSEFI_SSH_PASS ssh -o StrictHostKeyChecking=no $RUSEFI_SSH_USER@$RUSEFI_SSH_SERVER "tar -xzf - -C build_server/autoupdate"
|
||||
retVal=$?
|
||||
if [ $retVal -ne 0 ]; then
|
||||
echo "autoupdate upload failed"
|
||||
|
|
Loading…
Reference in New Issue