如何在Mac上新建Jenkins agent节点进行iOS打包(二)
来源:互联网 发布:擦除上网痕迹软件 编辑:程序博客网 时间:2024/06/02 03:14
IOS打包环境配置
相关工具
以下是在agent中需要安装的工具,把这些工具以及环境变量配置完备,agent才能进行IOS打包工作
● git
● xcode
● cocospods(可选)
● fastlane(可选)
证书安装及keychain配置
另外需要额外注意的是,IOS打包时,需要安装项目对应开发者的证书到agent的mac机器上,并且将开发者的apple账号配置到keychain中,并且保存在System种类中,这样我们的jenkins才能够进行打包操作,否则将打包失败。
证书也需要放在”系统”钥匙串中
jenkins让agent工作时,会启动一个non-interactive的shell,所以诸如配置在~/.zshrc,/etc/zshrc中的环境变量都不会加载。
此时能被加载的是/etc/zshenv,~/.zshenv,这里我们使用的是~/.zshenv
环境变量配置
图1
IOS项目相关脚本
以下便是IOS项目用到的jenkinsfile脚本
pipeline { agent none environment { revision = "" } stages { stage('test') { agent { label 'agent-name' } steps { script { revision = sh(returnStdout: true, script: 'git rev-parse HEAD').trim() echo revision } sh 'fastlane test' echo 'build dev' } } stage('build dev') { agent { label 'agent-name' } steps { sh 'fastlane dev' echo 'build dev' } } stage('build qa?') { agent none steps { script { input message: 'build qa version?' } } } stage('build qa') { agent { label 'agent-name' } steps { sh 'git checkout -f ' + revision sh 'fastlane qa' echo 'build qa' } } stage('build uat?') { agent none steps { script { input message: 'build uat version?' } } } stage('build uat') { agent { label 'agent-name' } steps { sh 'git checkout -f ' + revision sh 'fastlane uat' echo 'build uat' } } stage('build prod?') { agent none steps { script { input message: 'build prod version?' } } } stage('build prod') { agent { label 'agent-name' } steps { sh 'git checkout -f ' + revision sh 'fastlane prod' echo 'build prod' } } }}
以下便是IOS项目用到的fastlane脚本
fastlane_version "2.45.0"default_platform :iosplatform :ios do before_all do # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..." cocoapods end desc "Runs all the tests" lane :test do scan(scheme:'iOS-Startup') end desc 'fastlane dev' lane :dev do time = Time.new ft = time.strftime(“%Y%m%d_%H%M%S”) sigh( output_path: "/tmp", skip_certificate_verification: true, app_identifier: "com.xx.xxx" ) gym( scheme: 'iOS-Startup', export_method: "enterprise", clean: true, output_directory: "./build", output_name: “#{ft}.ipa") end desc 'fastlane qa' lane :qa do time = Time.new ft = time.strftime(“%Y%m%d_%H%M%S”) sigh( output_path: "/tmp", skip_certificate_verification: true, app_identifier: "com.xx.xxx" ) gym( scheme: 'iOS-Startup', export_method: "enterprise", clean: true, output_directory: "./build", output_name: “#{ft}.ipa") end desc 'fastlane uat' lane :uat do time = Time.new ft = time.strftime(“%Y%m%d_%H%M%S”) sigh( output_path: "/tmp", skip_certificate_verification: true, app_identifier: "com.xx.xxx" ) gym( scheme: 'iOS-Startup', export_method: "enterprise", clean: true, output_directory: "./build", output_name: “#{ft}.ipa") end desc 'fastlane prod' lane :prod do time = Time.new ft = time.strftime(“%Y%m%d_%H%M%S”) sigh( output_path: "/tmp", skip_certificate_verification: true, app_identifier: "com.xx.xxx" ) gym( scheme: 'iOS-Startup', export_method: "enterprise", clean: true, output_directory: "./build", output_name: “#{ft}.ipa") end # You can define as many lanes as you want after_all do |lane| # This block is called, only if the executed lane was successful # slack( # message: "Successfully deployed new App Update." # ) end error do |lane, exception| # slack( # message: exception.message, # success: false # ) endend
阅读全文
1 0
- 如何在Mac上新建Jenkins agent节点进行iOS打包(二)
- 如何在Mac上新建Jenkins agent节点进行iOS打包(一)
- Jenkins自动打包 配置mac slave节点
- Jenkins自动打包 配置mac slave节点
- 【IOS开发】如何在一台mac上进行ios开发
- ios 在window和mac上另类打包方式
- Jenkins使用IOS打包问题(二)
- 在ubuntu上使用jenkins打包android
- 如何在mac上用apache ab进行web测试
- 如何在mac上用apache ab进行web测试
- MAC上搭建Jenkins实现Android自动打包
- 如何在Mac上新建txt文件,以及打开txt文稿的乱码问题如何解决
- 在mac 机上配置jenkins iOS版本编译环境总结
- Mac Jenkins搭建 Android/IOS自动打包环境
- MAC 下Jenkins 自动打包 IOS 应用注意点
- ios jenkins 打包问题
- ios Jenkins 自动打包
- 在 Mac 上打包 PyQT 程序
- Spring常用注解
- <c:forEach varStatus="status">中 varStatus的属性简介
- 前端面试——笔试题整理汇总
- 关于redis的主从、哨兵、集群
- windows server 2008 R2开启ftp服务
- 如何在Mac上新建Jenkins agent节点进行iOS打包(二)
- http://blog.sina.com.cn/s/blog_4fd2a65a0101gg2o.html
- HashMap的三种遍历方式
- Leetcode双指针16
- 解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"
- 用openssl进行rsa的加密与解密(linux,C++版)
- Oralce awr报告分析
- viewpager动态更新数据重新setAdapter(FragmentPagerAdapter)不起作用
- TASKCTL4.1安装选项详解