drewgg

流程:

一、研发提交代码后,jenkins选择一下需要打包的分支和环境后自动打包并上传到蒲公英和钉钉通知:

目录很简单:

Build_android: Android 的打包调用

Build_ios:  iOS的打包调用

Common: 存放公共调用的方法

  -- common_ios: 存放ios专用的调用

    1.clean项目

    2.修改配置环境

    3.更新pod文件

    4.编译

    5.导出包

  -- common_android:存放android专用的调用

    1.清理项目

    2.编译 

  -- 创建输出的文件夹

  -- 删除编译后xcode缓存文件

  -- 查找配置文件、.xcworkspace文件等,方便自动识别获取workspace名称、.xcarchive、.ipa、scheme

  --获取jenkins参数

  -- 上传蒲公英、上传appstore

  -- 执行CMD命令封装

  --通知钉钉

二、主要用到的一些命令:

iOS相关:

1.清理项目:xcodebuild clean -workspace %s -scheme %s -configuration %s 

2.编译:xcodebuild archive -workspace %s -scheme %s -configuration %s -archivePath %s  

3. 导出包:xcodebuild -exportArchive -archivePath %s -exportOptionsPlist %s -exportPath %s

4.pod更新:pod install /pod install --repo-update

5.上传appstore验证:xcrun altool --validate-app -f %s -t ios --apiKey %s --apiIssuer %s --verbose

6.上传appstore:xcrun altool --upload-app -f %s -t ios --apiKey %s --apiIssuer %s --verbose 

Android相关:

1.清理项目:./gradlew clean 

2.编译:./gradlew assemble%s%s

三、上传蒲公英就不讲了(网上多的很)

四、通知钉钉也不讲了(网上多的很)

五、Jenkins配置 

Jenkins需要配置这些动态参数:

比如ios:

1.分支地址

2.编译环境

3.编译模式

4.打包环境

5.是否上传应用市场

……等等

再把jenkins的邮件监控配置好,打包失败自动发布邮件,网上有各种邮件模版:

 

 

成果:

 

 

失败邮件通知:

 

 

分类:

技术点:

相关文章:

  • 2021-09-13
  • 2021-12-12
  • 2021-11-17
  • 2021-10-19
  • 2021-01-19
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
猜你喜欢
  • 2021-11-12
  • 2021-12-09
  • 2021-10-17
  • 2021-12-19
  • 2021-12-27
  • 2021-10-21
  • 2021-12-11
相关资源
相似解决方案