码迷,mamicode.com
首页 > 移动开发 > 详细

Jenkins 打包 Android

时间:2020-06-09 12:52:04      阅读:60      评论:0      收藏:0      [点我收藏+]

标签:ase   begin   pushd   sse   ble   dev   path   mkdir   and   

echo "======building version======";
$versionDate=Get-Date -Format ‘yyyyMMddHHmmss‘;
echo "v$versionDate";

$appPublishPath="H:\devops\live4it";

echo "======svn change trigger======";

echo "======cd Live4It dir======";
pushd H:\SVNCode\MobileApp\CTdevNew\Live4It;

echo "======svn update======";
svn update;
echo "svn update success======";

echo "======begin publish======";
cd android;
./gradlew assembleRelease -console plain;
echo "======publish success======";

echo "======list apks======";
cd .\app\build\outputs\apk\release;
ls;

echo "======copy apk======";
if(Test-Path $appPublishPath){}
else{
  mkdir $appPublishPath;
}
Copy-Item ./app-release.apk $appPublishPath –recurse;
echo "======copy success======";

echo "======read version======";
$appconfig=(Get-Content H:\SVNCode\MobileApp\CTdevNew\Live4It\src\utils\appconfig.js);
$ret=[regex]::Matches($appconfig,‘var\s+appInfo\s*=\s*\{"AppVersion"\s*:\s*"(?<version>.*?)"‘);
$version=$ret.Groups[$ret.Groups.length-1].Value;
echo "======read success======";

echo "======rename apk name======";
pushd $appPublishPath;
Rename-Item ./app-release.apk "Live4It.$version.$versionDate.apk";
echo "======rename success======";

echo "======success======";

Jenkins 打包 Android

标签:ase   begin   pushd   sse   ble   dev   path   mkdir   and   

原文地址:https://www.cnblogs.com/baiqian/p/13071815.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!