主要写几个步骤和注意事项
1、Jekins官网 https://jenkins.io/ 下载包
2、启动Jekins(cd到下载包路径)终端执行以下命令
java -jar jenkins.war --httpPort=8080
3、网页开开
4、下面是配置截图
1??系统管理
2??、配置
3??、源码管理
4??、构建触发器
5??、构建环境
6??、构建
打包脚本(pod工程)
# 工程名 APP_NAME="******" # 证书 CODE_SIGN_DISTRIBUTION="iPhone Distribution:****** Co., Ltd." # info.plist路径 project_infoplist_path="./${APP_NAME}/${APP_NAME}/Others(其他)/Info.plist" #取版本号 bundleShortVersion=$(/usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" "${project_infoplist_path}") #取build值 bundleVersion=$(/usr/libexec/PlistBuddy -c "print CFBundleVersion" "${project_infoplist_path}") DATE="$(date +%Y%m%d)" IPANAME="${APP_NAME}_V${bundleShortVersion}_${DATE}.ipa" #要上传的ipa文件路径 IPA_PATH="$HOME/${IPANAME}" echo ${IPA_PATH} echo "${IPA_PATH}">> bao.txt # 下面2行是集成有Cocopods的用法 echo "=================clean=================" xcodebuild -workspace "./${APP_NAME}/${APP_NAME}.xcworkspace" -scheme "${APP_NAME}" -configuration ‘Release‘ clean echo "+++++++++++++++++build+++++++++++++++++" xcodebuild -workspace "./${APP_NAME}/${APP_NAME}.xcworkspace" -scheme "${APP_NAME}" -sdk iphoneos -configuration ‘Release‘ CODE_SIGN_IDENTITY="${CODE_SIGN_DISTRIBUTION}" SYMROOT=‘$(PWD)‘ xcrun -sdk iphoneos PackageApplication "./Release-iphoneos/${APP_NAME}.app" -o ~/"${IPANAME}"
上传蒲公英或者其他三方平台
#蒲公英上的User Key uKey="****" #蒲公英上的API Key apiKey="*****" #要上传的ipa文件路径 IPA_PATH=$(cat bao.txt) #执行上传至蒲公英的命令 echo "++++++++++++++upload+++++++++++++" curl -F "[email protected]${IPA_PATH}" -F "uKey=${uKey}" -F "_api_key=${apiKey}" http://www.pgyer.com/apiv1/app/upload
⑦、构建后操作可以发到邮箱通知,但是总是失败,暂时未找到解决办法
Could not connect to SMTP host: localhost, port: 25;
参考链接:
cocoachina:http://www.cocoachina.com/ios/20160804/17281.html
简书:http://www.jianshu.com/p/ed124917d6c6
蒲公英:https://www.pgyer.com/doc/view/jenkins_ios
多个xcode问题解决办法:http://blog.csdn.net/woaizijiheni/article/details/50614062
时间: 2024-10-25 03:04:30