Centos 7 uses Jenkins to pack Android projects

Source: Internet
Author: User

1. Configuring the Java EnvironmentDownload on the Sun website, unzip it into/usr/java, and configure the environment variables such as Vi/etc/profile to add the following configuration at the bottom (Note: Add environment variables, which are added at the bottom of the file) java_home=/usr/java/jdk1.7.0_80path= $JAVA _home/bin: $PATHCLASSPATH =.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/ Tools.jarexport java_homeexport pathexport CLASSPATH perform source/etc/profile update after modification 2. Configure the Android SDKAt the bottom of the https://developer.android.com/studio/index.html only get command line tool, select Android-sdk_r24.4.1-linux.tgz to download, complete and unzip to/home. After the decompression, you need to update the SDK to access the tools directory under the SDK. Execute the./android update sdk-h to view the command description, my Update method is:./android update Sdk-u-T add-on,extra,platform,platform-tool,tool about Android The problem, because the system is 64-bit, Android command is 32 bit, so need to install 32-bit support reference address http://blog.csdn.net/qianlong4526888/article/details/ 8780171 can also refer to this, about the NDK configuration, but I did not configure the NDK http://7dot9.com/2012/12/13/centos-64%E4%BD%8D%E6%9C%BA%E5%99%A8%E9%85%8D%E7% Bd%aeandroid-sdk%e5%92%8cndk%e7%8e%af%e5%a2%83/yum Install Zlib.i686yum whatprovides Libstdc++.so.6yum Install libstdc++-4.8.5-4.el7.i686 then configure the environment variable export android_sdk_home=/home/android-sdk-linuxexport path= $ANDROID _sdk_home/ Tools: $ANDROID _sdk_home/platform-tools: Perform source/etc/profile update after $PATH modification 3. Configure GradleWe use the 2.10 version of the project, directly using the following address download Https://services.gradle.org/distributions/gradle-2.10-all.zip downloaded to the/OPT directory after the completion of the download, and configure environment variables export Gradle_home=/opt/gradle-2.10export path= $GRADLE _home/bin: Perform source/etc/profile update after modifying $PATH 4. Install JenkinsOn the official website https://jenkins.io/select CentOS Download, then to the RPM Packages list page Follow the above command:
sudo wget-o/etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.reposudo rpm--import/http Pkg.jenkins.io/redhat-stable/jenkins.io.key
Yum Install Jenkins
Don't know where to look https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributionsjenkins the default port number is 8080, you can modify the configuration file location in the configuration file:/etc/sysconfig/jenkinsAlso note that the Jenkins port needs to be configured in the firewall 5. Configure JenkinsFirst go in. Enter the password as required, and select the recommended installation when installing the plugin. When the initialization is complete, select enter in the upper-left corner Global Tool ConfigurationConfigure the Jdk,gradle separately, as for Git is already installed, such as

Next, you need to configure Git's CredentialsBecause you are getting the code on Gitlab, you need to configure the user (Note: If it is gitlab need to configure the local SSH public key to the assigned accountFill in the account password assigned on the Gitlab, define the ID and description, click OK to prepare the work has been done, the next is the configuration task: Click New on the Home page, customize the task name, and then type Select the free-style software project, click OK.   Here are the configuration parameters for the task:

Fill in git address, for Gitlab, recommended to choose the address of the beginning of HTTPS, to avoid a series of SSH permissions issues

Select the branch trigger that you want to pull at the same time. I configured the build-time-to-gradle version every 10 minutes, I hit the debug package.

Then the save is OK, and the task is executed according to the configured trigger. The first time you may fail, see the precautions.

Precautions :   the first time the substitution code was pulled due to the file local.properties not put into version management, you need to create your own, and configure the SDK: Sdk.dir=/home/android-sdk-linux   There are a few questions about Jenkins Midway2.10\taskartifacts\cache.properties.lock (Access is denied)My workaround is to delete the entire project directly, and also to empty the. Gradle/caches in the user directory and re-execute the task by creating a new Local.properties file Configuration SDK Directory

Centos 7 uses Jenkins to pack Android projects

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.