大家好,
我需要从AppCenter将APK上传到FTP。
我的项目中已经有以下脚本。
注意:出于安全原因,使用伪数据修改了脚本。
appcenter-post-build.sh
#!/usr/bin/env bash
#
# Upload the binary from the build output directory
via SFTP using LFTP https://lftp.yar.ru/lftp-man.html
# Make sure to create the environment variable
$LFTP_PASSWORD in the App Center build configuration
brew install lftp
cd $APPCENTER_OUTPUT_DIRECTORY
lftp -f $APPCENTER_SOURCE_DIRECTORY/upload.lftp
upload.lftp
set sftp:auto-confirm yes
open --env-password sftp://root@ftp.example.com/
put /app_directory/app.example.apk
发布脚本一旦运行,就会出现以下错误:
source: /Users/vsts/agent/2.144.0/work/1/s/upload.lftp: No such file or directory
##[error]/bin/bash failed with return code: 1
##[error]Bash failed with error: /bin/bash failed with return code: 1
##[section]Finishing: Post Build Script
##[section]Starting: Checkout
我将脚本放置在Android项目的./exampleApp/app/目录中