Brief introduction
The continuous integration of Gradle project is realized through Jenkins Slave, in which code management uses perforce, Jenkins version 2.46.2, and system is Centos7.3.
First, Jenkins configuration
1. Install and configure Jenkins Master
2. Increase slave node
Open the page, Jenkins home-> Manage Jenkins-> mange Nodes New->, the following is the configuration page
3. Installation of Perforce Plugin
Https://wiki.jenkins.io/display/JENKINS/Perforce+Plugin
Open the page Manage Jenkins-> Manage plugins, search perforce Plugin, click Install.
Second, perforce configuration
1. Configure P4 client on slave
Download the p4v-2013.1.611503 and put it in a path below the system after decompression.
such as/local/mnt/workspace/p4v-2013.1.611503
2. Configure P4 client information on Jenkins
Open the page manage Jenkins-> Global Tool Configuration. If Jenkins has multiple slave, and P4 paths or versions are different, you can configure multiple.
Third, gradle configuration
Download Gradle4.1 and configure environment variables after decompression.
Export gradle_home=/local/mnt/workspace/tools/gradle-4.1
Export Path=${gradle_home}/bin: $PATH
Create a job
Configure job basic information under general.
Configure Perforce account information, map information, and so on under source Code management. Where workspace can be set up already, or you can choose let Jenkins create workspace automatically created by Jenkins.
The P4 executable option selects the node that corresponds to the job execution in the perforce of Jenkins configuration.
Under Build, configure Gradle related information. Where the root build script is the directory where the Gradle script is located, and the default workspace path if blank.