Jenkins 打包 Android

Posted 百小僧

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Jenkins 打包 Android相关的知识,希望对你有一定的参考价值。

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

$appPublishPath="H:devopslive4it";

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

echo "======cd Live4It dir======";
pushd H:SVNCodeMobileAppCTdevNewLive4It;

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 .appuildoutputsapk
elease;
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:SVNCodeMobileAppCTdevNewLive4Itsrcutilsappconfig.js);
$ret=[regex]::Matches($appconfig,‘vars+appInfos*=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的主要内容,如果未能解决你的问题,请参考以下文章

Jenkins配置Android自动打包传蒲公英功能

Jenkins 持续集成实现 Android 自动化打包

Jenkins 持续集成实现 Android 自动化打包

[原] Jenkins Android 自动打包配置(转)

Ubuntu使用Jenkins配置自动化打包Android APK

Ubuntu使用Jenkins配置自动化打包Android APK