From 981b16ced90198c1a7582cdbe50b720f44ef3a04 Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Thu, 21 Oct 2021 18:15:25 -0500 Subject: [PATCH] Use SSH for Doxygen (#3386) * install sshpass and change var names * convert doxygen script * no stricthostkeychecking * change secrets --- .github/workflows/gen-docs.yaml | 8 ++++---- misc/jenkins/generate_doxygen/gen_upload_docs.sh | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gen-docs.yaml b/.github/workflows/gen-docs.yaml index bd54d27d07..6c6cb7d581 100644 --- a/.github/workflows/gen-docs.yaml +++ b/.github/workflows/gen-docs.yaml @@ -16,16 +16,16 @@ jobs: - name: Install prerequisite software run: | sudo apt-get update - sudo apt-get install doxygen graphviz ncftp + sudo apt-get install doxygen graphviz sshpass - name: Set FTP variables env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' run: | if [ "${{github.ref}}" = "refs/heads/master" ]; then - echo "::set-env name=RUSEFI_FTP_SERVER::${{secrets.RUSEFI_FTP_SERVER}}"; - echo "::set-env name=RUSEFI_DOXYGEN_FTP_USER::${{secrets.RUSEFI_DOXYGEN_FTP_USER}}"; - echo "::set-env name=RUSEFI_DOXYGEN_FTP_PASS::${{secrets.RUSEFI_DOXYGEN_FTP_PASS}}"; + echo "::set-env name=RUSEFI_SSH_SERVER::${{secrets.RUSEFI_SSH_SERVER}}"; + echo "::set-env name=RUSEFI_DOXYGEN_SSH_USER::${{secrets.RUSEFI_DOXYGEN_SSH_USER}}"; + echo "::set-env name=RUSEFI_DOXYGEN_SSH_PASS::${{secrets.RUSEFI_DOXYGEN_SSH_PASS}}"; fi - name: Generate documentation diff --git a/misc/jenkins/generate_doxygen/gen_upload_docs.sh b/misc/jenkins/generate_doxygen/gen_upload_docs.sh index 2956b332f3..213fe2d580 100644 --- a/misc/jenkins/generate_doxygen/gen_upload_docs.sh +++ b/misc/jenkins/generate_doxygen/gen_upload_docs.sh @@ -5,11 +5,10 @@ cd firmware doxygen || { echo "doxygen run FAILED"; exit 1; } -# http://www.ncftp.com/download/ # actually Cygwin http://rusefi.com/wiki/index.php?title=Internal:Software:Build_Server cd ../doxygen -if [ -n "$RUSEFI_FTP_SERVER" ]; then +if [ -n "$RUSEFI_SSH_SERVER" ]; then echo "Uploading Doxygen" - ncftpput -R -z -m -V -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" / html + tar -czf - html | sshpass -p "$RUSEFI_DOXYGEN_SSH_PASS" ssh -o StrictHostKeyChecking=no "$RUSEFI_DOXYGEN_SSH_USER"@"$RUSEFI_SSH_SERVER" "tar -xzf -" fi [ $? -eq 0 ] || { echo "upload FAILED"; exit 1; }