In the above section, we have finished building the Jenkin environment. Next we will start to practice this automatic build system.
Jenkins defines a set of building processes, and the building details need to be written. Some scripting languages are needed as the adhesive to help with this process. Currently, it supports linux shell, windows batch, ant, python, and other scripts. Here I use linux shell to complete automatic packaging of an android Application with multiple lib libraries. Of course, you must support automatic channel number change.
Next, let's perform the following operations:
I. Create a new job
Jenkins supports the construction of several software projects. Because ant is called for the core build operation, we choose to use a free-style software project here.
Ii. project configuration
All Channel names used in the project are constructed as parameters. Therefore, go to the configuration page of our new project, select the parameterized construction process, and select String Parameter.
3. Source Code Management
Source code management supports multiple code management tools. cvs and subversion are native. If you need to install the plug-in separately using git, enter the Source Code address of the project.
Recently, the company's servers were not very stable and the project was mounted on its own machines. I can't help but talk about ubuntu and install an svn server. Enter the Project address for the first time and jenkins will prompt you for verification. Click the second link in red and enter the user name and password of the project.
Similarly, we enter the addresses of other lib libraries that the project depends on. In this way, the project source code is configured completely.
4. The build trigger (Omitted) is used to configure the frequency and strategy of project building.
V. Project Construction-core
The idea is to use shell scripts to control ant to clean up projects, configure channels, compile, package, copy, rename, and so on. It is simple to say, but it is actually the most complicated. Because each project has different requirements, the script also changes. So here is a script, which is provided as an idea for everyone. Because the script is long, we will give it in the next article.
I also want to vomit the shell script here. There are a lot of commands and complicated usage, and the headers are all debugging dizzy. It is really difficult to use.
Download, non-technical personnel can also be used without permission.