Jenkins is a continuous integration tool based on Java development, so before we install Jenkins we need to make sure that the Java JDK is installed on the computer and that the environment variable is configured correctly, otherwise it starts using Java-jar Jenkins.war When you start Jenkins, you will be prompted for Java non-internal commands and cannot start because there is no Java environment.
Java version: jdk-8u162-windows-i586
Jenkins version: Jenkins 2.89.3
(There is a hole here, Java installed JAVA9, start Jenkins after the creation of a new project times wrong, the following image appears, because the Java version is high, after re-installed JAVA8, normal use)
I. Java JDK Installation
Java jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html
After the download is complete, simply double-click Run Setup and click Next to wait for the installation to complete.
Here is the configuration environment variable
1. Add Java_home: The variable value is the JDK's installation path
2. Add Path:%java_home%\bin
3. Add classpath:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
Two. The start and configuration of Jenkins
jenkins:https://jenkins.io/download/
We choose the war package download
The command prompt then enters the directory where Jenkins.war is located, using the Java-jar Jenkins.war command to start Jenkins.
You can enter localhost:8080 in the address bar of the browser, which is the default local Service connection for Jenkins
Enter user name: admin, Password storage path: C:\Users\kaka\.jenkins\secrets
Three. Simple project configuration (running the local Python main program)
Click "Create a New task", enter the project name, and click "Build a free-style software project"
Click on "Advanced"
Enter the path to the working directory in the directory
Here because it is in the Windows environment, select Execute Windows Batch command, enter the command (Command prompt to execute the python file)
Save the configuration, so a simple configuration is complete, now you can click on "Build immediately" to verify success, build historical reality blue indicates success, red means failure
Simple Jenkins Continuous Integration setup under Windows environment