iOS uses Jenkins for continuous integration 2

Source: Internet
Author: User

On an article, I try to carry out continuous integration, the research is not deep, these two days, for the company to build a continuous integration environment, as well as internal publishing system, understand more, so share out.

This article mainly introduces some other things, do not repeat the contents of the previous article.

If you use Jenkins for continuous iOS integration, you need the Xcode plug-in support, so download the Xcode plugin, and later use the FTP service, also install the FTP plugin.

Jenkins can create a specific group of views, all view click on the + number to create a new view, after creation, in the left side of the edit view options, you will go to the details page, you can choose to put this view of the task, relative to the task, I think it is best based on the Code SVN address, The general code is the sub-version stored in different locations, so our task also points to a version, I am the task to differentiate the version number, for example xxx_iphone_dev_2.5.0.



Some of the configurations in iOS tasks are described below

1. Generally tick discard the old build, which will clean up the build folder.

2. Source control, general use of Subverison,

Respository URL, this is the SVN address that sets your code and controls which folder to access.

Local module directory (optional), which is a custom directory where you set your own code to store to your local workspace, and if you do not, the code is placed directly under the current workspace directory, and if you customize the directory, the directory structure is created in the workspace.

The code is then stored in this directory.

Source control, allows you to download multiple address code, click Add more Locations ....

Specific look at the picture, one can understand.


Different codes are downloaded to different directories, and the actual file structure is as follows.

In general, the Code checkout policy, update on the line.


3. The trigger does not add, you can set a few days to trigger the build, this is better, look at their own needs.

4. Add Xcode build Steps

Here you need to be aware of your Xcode project type, and the SVN address.

Generally if your project is a single project, then say, like below, write a target in the project,



Play IPA package, write the IPA package name, do not add. ipa,jenkins Auto Plus, output directory, here, there are many places in Jenkins to match the correct directory structure, you can see the Jenkins task execution of the log to see where the error, more can see

Actual physical file,/users/xxx/.jenkins/workspace/job name/. (. The first is usually a hidden file, the general Mac user will let the system show hidden files).

5. Signature

To write the full name of the signature, the following description of the file that do not fill, or error, the premise is that the target of your program needs to set up the project can recognize the signature certificate, attention needs to be recognized, the non-existent description file configuration can not.


6.xcode Advanced Configuration

Since our project is a workspace rather than a single project, it does not work to simply configure the target directly.


It should be noted here that you use the current running Jenkins Mac computer, need to execute the next program, which will generate the current computer user scheme, and then upload to SVN, then download the time before the user's scheme, otherwise the SVN code originally without the user's scheme, Can not build success, error says the current workspace does not exist XXX scheme.

Xcode scheme file fills in program scheme.

The SDK fills in the supported SDK for your current Xcode command line connection to the Xcode app, if you haven't noticed the command line,

Haiwangdemac-mini:vancl hai$ xcodebuild-version

Xcode 6.0

Build version 6a313

This indicates that my use is xcode6.0.

Haiwangdemac-mini:vancl hai$ Xcodebuild-showsdks

OS X SDKs:

OS X 10.9 -sdk macosx10.9


IOS SDKs:

IOS 8.0 -sdk iphoneos8.0


IOS Simulator SDKs:

Simulator-ios 5.0 -SDK iphonesimulator5.0

Simulator-ios 6.0 -sdk iphonesimulator6.0

Simulator-ios 7.1 -sdk iphonesimulator7.1

Simulator-ios 8.0 -sdk iphonesimulator8.0

This illustrates the current SDKs supported by Xcode. If your command line is connected to the XCODE5 and the SDK fills in the iphoneos8.0, you will get an error without this SDK.

Haiwangdemac-mini:vancl hai$ Xcode-select-p

/applications/xcode 6.0.app/contents/developer

The last command indicates where your command line is connected.

Usage:xcode-select [Options]


Print or change the path to the active developer directory. This directory

Controls which tools is used for the Xcode command line tools (for example,

Xcodebuild) as well as the BSD development commands (such as CC and make).


Options:

-H,--help print this help message and exit

-P,--print-path print the path of the active developer directory

-S <path>,--switch <path> set the path for the active developer directory

-V,--version print the Xcode-select version

-R,--reset reset to the default command line tools path

Use xcode-select-s <path> to reset the address of the command line connection and set up your connection to that Xcode version.
Xcode workspace file Specifies where your workspace is, and multiple SVN addresses need to be configured with different workspace for each Xcode build. Maybe it's 2.5.0/xxx, maybe 3.0.0/xxx.build output directory, and the results of your task building are in this directory structure, the app of your program and the IPA package, the plist file, and so on.
In the Xcode build, you can create multiple Xcode build processes to play different packages. 6. Post-build action-mail typically sets a report that the message receives a build failure. This needs to say system management--there are a lot of things to set up here. Well, also talk about the other. There is a number of performers, set how many jobs are executed concurrently. Default view. Jenkins location needs to be configured with the Jenkins URL, the Jenkins service address of this machine, http://10.8.53.131:8080/.system Administrator Email address, fill vancl_ios_jenkins <[email protected]>
Subversion General Choice 1.7. Mail notification, need to setSMTP server.

Note There is a check box below that you can set up a mail receiver to test whether the message is successful by sending a test message test configuration.

7.ftp Upload Service

The previous article has a software lion weak bar, open the FTP function of the computer.

Setting FTP parameters in System settings


I was spread to the local.

The results are then released to the FTP server.

I was sent directly below the publishing system to my Tomcat directory.



It is important to note that the general choice of flatten files, so that you upload the source path directory structure will not be uploaded together destination, only upload the corresponding file, if not checked, it will be in destination directory structure

The directory structure of source is also created, which is very uncomfortable.

Here again to support the phone directly download the installation of things.


When playing the IPA package, you can directly generate the plist file, its plist URL to fill in the address of your service, this address plus the file name constitutes the HTTP service address URL to download the IPA package. Jenkins in this plist URL is automatically appended with the IPA file name.

is the task executed successfully, and FTP uploaded to the Tomcat directory under the IPA and the corresponding plist, open plist can see its software value is pointed to the corresponding IPA package.


8. When these packages and files are uploaded successfully, the next tomcat is set.

Create a simple Web service, the homepage of the index.html change.

Add Download link

<a href= "./static/vancl_iphone_app/3.1.0/vancl-online-3.1.0.ipa" >VANCL-Online-3.1.0.ipa</a>
and direct installation of the link

<a href= "itms-services://?action=download-manifest&url=http://10.8.53.131:8088/static/vancl_iphone_app/ 3.1.0/vancl-online-3.1.0.plist ">install</a>
Because ios7.0 later need the server's HTTPS support, this direct download installs not much to get.

You can create a certificate with Keytool and then put it under Tomcat and modify the Server.xml, but I still can't download it.

Using the http,7.0 installation will prompt the certificate is invalid, using HTTPS will not be able to connect to the IP address, it seems like the need for authoritative certificate, see later put on the company's server up.

Index.html modified, you can start Tomcat access to the service, for the time being.




Previous post: http://blog.csdn.net/monkey_cool/article/details/38010471



iOS uses Jenkins for continuous integration 2

Related Article

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.