• 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 --username 'hlchen' --password 'hlchen1';
    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" 2>$null;
    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 $version;
    
    echo "======read success======";
    
    echo "======rename apk name======";
    pushd $appPublishPath;
    Rename-Item ".app-release.apk" ".Live4It.$version.$versionDate.apk" 2>$null;
    echo "======rename success======";
    
    echo "======copy to default web site======";
    Copy-Item ".Live4It.$version.$versionDate.apk" "C:inetpubwwwrootlive4it_apk" 2>$null;
    pushd C:inetpubwwwrootlive4it_apk;
    Remove-Item ".Live4It.apk" -Recurse 2>$null;;
    Rename-Item ".Live4It.$version.$versionDate.apk" ".Live4It.apk" 2>$null;
    echo "======copy success======";
    echo "======success======";
    
  • 相关阅读:
    event与WaitForSingleObject、MsgWaitForMultipleObjects等
    vc不包含MFC就不打印内存泄露?
    使用visual leak detector(vld)查找内存泄露
    C#里面中将字符串转为变量名
    如何编写nopCommerce插件
    object成员,不见了!
    NopCommerce 定制系列(一):增加 Sha256+Base64 加密
    c#中的二维数组与锯齿数组
    待搞清楚
    NopCommerce 2.5的部署
  • 原文地址:https://www.cnblogs.com/baiqian/p/13071815.html
Copyright © 2020-2023  润新知