产品概述
基本概念
产品优势
应用场景
./car help
./car create-application help
./car create-application --name xxx
代码 | 说明 |
ap-chinese-mainland | 中国大陆 (默认地区) |
ap-tokyo | 东京标准区 |
ap-tokyo-fusion | 东京融合区 |
ap-seoul | 首尔标准区 |
ap-seoul-fusion | 首尔融合区 |
ap-singapore | 新加坡标准区 |
ap-singapore-fusion | 新加坡融合区 |
eu-frankfurt | 法兰克福标准区 |
eu-frankfurt-fusion | 法兰克福融合区 |
na-north-america | 北美标准区 |
na-north-america-fusion | 北美融合区 |
me-middle-east-fusion | 中东融合区 |
sa-south-america-fusion | 南美融合区 |
./car create-application-version --app-id app-xxx --name xxx --type zip --update-mode FULL --regions ap-chinese-mainland,ap-tokyo
./car upload-application-version-file --app-id app-xxx --path C:\\\\data\\\\xxx.zip --version-id ver-xxx./car upload-application-version-file --app-id app-xxx --path /data/xxx.zip --version-id ver-xxx./car upload-application-version-file --app-id app-xxx --url xxx
./car set-version-online --app-id app-xxx --version-id ver-xxx
./car delete-application-version --app-id app-xxx --version-id ver-xxx
./car describe-application-version --app-id app-xxx./car describe-application-version --app-id app-xxx | grep -v "Inuse" | awk '{print $1}' | head -n 1

cd workdirwget "your config file url"
cd workdirmkdir pkg && cd pkgwget https://github.com/tencentyun/car-cli/releases/download/v1.0.0/car.zipunzip car.zipmv ./car/linux/car ../cd ..chmod +x car
cd workdirwget $PackageURL # 在流水线环境变量中配置PackageURL变量
cd workdir# 查询对应应用的版本列表output=$(./car describe-application-version --app-id $ApplicationID) #流水线环境变量配置ApplicationIDlineCount=$(echo "$output" | wc -l)# 若版本数量大于5,则删除旧版本if [ $lineCount -ge 5 ];thenversionID=$(echo "$output" | grep -v "Inuse" | awk '{print $1}' | head -n 1)./car delete-application-version --app-id $ApplicationID --version-id $versionIDfi# 因删除应用版本是异步操作,所以定时查询版本是否删除成功waitTimes=0while [ $lineCount -ge 5 ]dooutput=$(./car describe-application-version --app-id $ApplicationID) #替换为自己ApplicationIDlineCount=$(echo "$output" | wc -l)waitTimes=$((waitTimes+1))if [ $waitTimes -gt 20 ]thenecho "Error: Waiting too long to delete application version."exit 1fisleep 1done# 根据PackageURL查询包名称和包类型fileName=$(basename $PackageURL) # 流水线环境变量配置PackageURLecho $fileNamefileType="${PackageURL##*.}"echo $fileType# 创建新版本output=$(./car create-application-version --app-id $ApplicationID --name $fileName --type $fileType)# 上传新版本应用到云端./car upload-application-version-file --app-id $ApplicationID --version-id $output --path $fileName# 发布新版本./car set-version-online --app-id $ApplicationID --version-id $output
文档反馈