"ios" Jenkins Continuous Integration iOS package

Source: Internet
Author: User

Today the project manager said to let the app side do with Jenkins do continuous integration, because not done before, so began to understand, finally in the help of the key brother, completed the function of continuous integration, moved not, here thank key brother.

Because the company's Jenkins is set up, then I will go directly to the configuration process.

Because the company's Jenkins environment is not on the Mac, so to do automatic integration packaging, you can only set the agent (node) to my own computer, the process of creating agents.

  

Where the remote working directory is your local Jenkins installation path.

The next step is to create a new project in Jenkins, click New, and then choose the free-style project.

Next enter the project configuration:

The first configuration to be configured in metadata is to specify the node to run the project as the node we created earlier

Then in the source management to set the source management mode, Git address and authentication method, and specify the branch to build

The next step is to build the settings for the trigger, where the auto-build time is set

And then the point is, add the built shell script

The shell script is as follows

#!/bin/sh## # Configuration definitionProject_name="Project Name" ## # IPA packaged Path $ (WORKSPACE) represents the workspace path underIpapath="${workspace}/ipa"## # Archive's pathXcarchivepath="${workspace}/xcarchive"CONFIGURATION="Release"## # Develop branch description file#profile_name= "Inhouse_loancustomer"## # Master Branch description file#profile_name= "Finupcredit-development"Profile_name="Finupplatform_adhoc"## # Specify the IPA nameIpafile_name="${project_name}_${build_number}.ipa"#unlock Login keygen#security Unlock-keychain-p ${keychain_password} ${keychain_path} | | failed "Unlock-keygen"# CleanEcho"xcodebuild Clean"xcodebuild Clean-workspace${workspace}/${project_name}/${project_name}. Xcworkspace-scheme${project_name}                  -configuration${configuration}                  || Failed"xcodebuild Clean"#ArchiveEcho"Xcodebuild Archive"Xcodebuild Archive-workspace${workspace}/${project_name}/${project_name}. Xcworkspace-scheme${project_name}                    -configuration${configuration}                    -destination generic/platform=IOS-archivepath${xcarchivepath}/${ipafile_name}. Xcarchive|| Failed"Xcodebuild Archive"#Export IPAEcho"xcodebuild exportarchive"Xcodebuild-exportarchive-archivepath${xcarchivepath}/${ipafile_name}. Xcarchive-exportpath${ipapath}/${ipafile_name}                           -exportoptionsplist${workspace}/options.plist-verbose|| Failed"Xcodebuild Export Archive"                                                    #-exportformat IPA \                          #-exportprovisioningprofile ${profile_name} \                          #-verbose \#Run Sonar#pushd ${workspace}/iphone/${project_name}#./run-sonar.sh#popd

Once you've set up your script, you can build it.

However, there is still a problem, it seems that after XCode9 in the command line packaging needs additional options.plist files, this file to be placed in the same directory as the project

Options.plist as follows

<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE plist Public "-//apple//dtd plist 1.0//en" "Http://www.apple.com/DTDs/PropertyList-1.0.dtd" ><plist Version= "1.0" ><dict><key>compileBitcode</key><true/><key>method</key> <string>ad-hoc</string><!--description File--><key>provisioningprofiles</key><dict> <key>*****</key><string>****</string></dict><key>signingcertificate</ Key><string>iphone distribution</string><key>signingstyle</key><string>manual </string><key>stripSwiftSymbols</key><true/><!--Team ID--><key>teamid</key ><string> Team Id</string><key>thinning</key><string><none></string> </dict></plist>

You can then execute the build

"ios" Jenkins Continuous Integration iOS package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.