Follow wechat public number: programmer Xiao An, wonderful articles regularly push.
1. Introduction
It was the first time I came into contact with Jenkins when I was working on SDK for Our team in 2014. At that time, I felt like a country kid going to town. I was impressed by Jenkins’ bad experience. Of course, there are many benefits of automatic packaging, such as timing out of the package, can be every night at 12 o ‘clock out of the package; There are also scenarios that need to be resolved, such as when you are modifying code locally and suddenly the test requires a package, your local code may be a mess and the project will not run at all, which is very inconvenient. Of course, Jenkins benefits a lot, you can slowly experience, today explains how to build Jenkins.
2. Platform building
1) Preparation: Download Jenkins: Jenkins. IO /
Download the Jenkins installation package through the link above, unpack it, click Install and proceed to the next step.
3) Open in the browser Enter in the browserhttp://localhost:8080/, the first time, it will prompt you to enter the password, as shown below: Enter the password under C:\Program Files (x86)\Jenkins\secrets as prompted:Click Continue and most people will see this screen. After all, in China, we chose to skip it first, as shown below:After the jump, you need to fill in the user name and password, as shown in the picture:Click the “Save and Finish” button to see Jenkins’ real face and start his journey.Congratulations if you see the above page, your Jenkins has been installed successfully.
3. Create projects
Now that Jenkins has installed successfully, how do I associate my Android project and package it? 1) Plug-in installation Return to the main interface, choose System Management -> Plug-in Management, as shown in the picture:If the network allows, you can install the plug-in directly on this interface. Due to network reasons, I choose to download the plug-in offline first and then upload it. The steps are as follows. 1. Select [Advanced]
2. Plug-in download Address:Updates.jenkins-ci.org/download/pl…The plug-in I installed looks like this:These are all plug-ins that need to be uploaded manually.
3. To install the plug-in, select the folder and click Upload.It should be noted that plug-in files have sequential requirements.
4. Installation is successful after the installation is successful, as shown in the figure:
2) Configure Jenkins parameters: Return to the home screen, choose System Administration ->Global Tool Configuration: Configure JDK and Gradle. Since I have JDK and Gradle installed locally, I just need to specify a path for it.
3) Click “Create a new task”, as shown below
4) Enter the project name, click “Build a Free style software Project”, click “OK”, then enter the following interface:
5) Configure project information. 1. Configure basic information
2. Configure source management
3. Configure the build triggerTriggers support many types of triggers. Common ones are: Periodically Build code updates according to submission and Build when a change is pushed to GitHub. The Poll SCM build trigger is selected as a compound option, and if you select more than one type, the build will be performed when any type meets the build criteria. If all types are not selected, the Jenkins Job does not perform an automatic Build, but can trigger a Build by manually clicking Build Now.
4. Configure build parameters
5. Perform the configuration after construction4. Packaging
With the project created and the information configured, packaging is easy. 1) Click “Build Now”, there will be an additional progress below
2) Wait a moment, apK will be ready, you can click download
Okay, so that’s it for Jenkins auto-packing.
Please point out any mistakes and learn together.