Jenkins打包iOS项目重新梳理
最近忙着整理闪贷的项目,重新梳理了一下jenkins的打包项目。整理如下:
cd ${WORKSPACE}
#reset code
git reset --hard
git clean -d -f
rm -rf ios/build
#config plist
cd buildtools
python exportParams.py "${PackageType}" "${Profile}" "${Cert}" "${TeamID}" "${BundleID}"
cat exportTemplate.plist
#这里是修改CID和MAPIversion
python ${WORKSPACE}/buildtools/modify_version.py ${cid_version} ${app_version}
cat ${WORKSPACE}/ios/WFIOS/Src/Net/NetConfig.h
#auto change build number
cd ../ios
/usr/bin/xcrun agvtool new-version -all ${BUILD_NUMBER}
/usr/bin/xcrun agvtool new-marketing-version ${VersionCode}
/usr/bin/xcrun agvtool what-marketing-version
#pod install
pod install
#unlock the keychain
security default-keychain -s /Users/zhangyuqing/Library/Keychains/login.keychain
security unlock-keychain -p zhangyuqing /Users/zhangyuqing/Library/Keychains/login.keychain
#build
xcodebuild -workspace WFIOS.xcworkspace -scheme WFIOS -configuration ${Scheme} -derivedDataPath build/ -archivePath build/wfios_${BUILD_NUMBER}.xcarchive clean archive DEVELOPMENT_TEAM=${TeamID}
xcodebuild -exportArchive -archivePath build/wfios_${BUILD_NUMBER}.xcarchive -exportPath build/${BUILD_NUMBER}/ -exportOptionsPlist ../buildtools/exportTemplate.plist
这里用到了一个导出时候用到的脚本,可以具体参考之前的这篇文章里的导出脚本升级Xcode9之后对于iOS打包一些shell的调整
其他就没有啥了