Skip to content

Commit

Permalink
chore(azure): weekly upload script to use lftp
Browse files Browse the repository at this point in the history
I switch to use LFTP advanced SFTP/SCP manager to make upload operation more robust.

Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Feb 2, 2025
1 parent fb7e051 commit 251b48b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ stages:
- script: echo "##vso[task.setvariable variable=result;]false"
condition: failed()
- script: |
version=$(./gradlew -qq printVersion | head -n -1 )
version=$(./gradlew -qq printVersion | head -n 1)
echo "##vso[task.setvariable variable=version]$version"
# stop the Gradle daemon to ensure no files are left open (impacting the save cache operation later)
./gradlew --stop
Expand Down Expand Up @@ -182,7 +182,7 @@ stages:
- script: echo "##vso[task.setvariable variable=result;]false"
condition: failed()
- script: |
version=$(./gradlew -qq printVersion | head -n -1 )
version=$(./gradlew -qq printVersion | head -n 1)
echo "##vso[task.setvariable variable=version]$version"
# stop the Gradle daemon to ensure no files are left open (impacting the save cache operation later)
./gradlew --stop
Expand Down
29 changes: 26 additions & 3 deletions ci/azure-pipelines/publish_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,25 @@ parameters:

steps:
- task: Bash@3
displayName: 📂 SCP upload to sourceforge file management
displayName: install lftp
condition: ${{ parameters.condition }}
inputs:
targetType: 'inline'
script: |
apt-get update
apt-get install -y lftp
- task: Bash@3
displayName: "Disable strict host key checking"
condition: ${{ parameters.condition }}
inputs:
targetType: 'inline'
script: |
mkdir -p ~/.ssh
echo "StrictHostKeyChecking no" >> ~/.ssh/config
echo "UserKnownHostsFile=/dev/null" >> ~/.ssh/config
chmod 600 ~/.ssh/config
- task: Bash@3
displayName: 📂upload to sourceforge file management via SCP/SFTP
condition: ${{ parameters.condition }}
inputs:
targetType: 'inline'
Expand All @@ -16,5 +34,10 @@ steps:
ls -l $srcdir/*
dest=$(SOURCEFORGE_FILE_USER)@frs.sourceforge.net
destdir=/home/frs/project/omegat/Weekly
echo "mkdir $destdir" | SSHPASS=$(SOURCEFORGE_FILE_PASS) sshpass -e sftp -oStrictHostKeyChecking=no $dest || true
SSHPASS=$(SOURCEFORGE_FILE_PASS) sshpass -e scp -s -oStrictHostKeyChecking=no $srcdir/* $dest:$destdir
lftp -u "$(SOURCEFORGE_FILE_USER),$(SOURCEFORGE_FILE_PASS)" sftp://frs.sourceforge.net <<__EOF__
mkdir -p $destdir
lcd $srcdir
cd $destdir
mirror -R --verbose
bye
__EOF__

0 comments on commit 251b48b

Please sign in to comment.