Location>code7788 >text

Win+jenkins+git+allure+tomcat+jdk deployment (the manhole)

Popularity:894 ℃/2024-08-10 15:11:34

Ten thousand pits: the reason why called ten thousand pits, is that some sites are really very, very, very pit, not to mention that in accordance with their methods once did not succeed, but also encountered a variety of strange problems, a waste of my 3.1415926h time, really want to give them a super-sized thumbs down. The following began to step on the road of the pit!

I. Local environment

jdk:1.8

tomcat:8.5.59

jenkins:2.264

git:2.34.0

allure:2.17.3

II. Download and Installation

download and install

Reference: /lihongtaoya/p/

download and install

1. Download address: /dist/tomcat/, here I downloaded the installation-free version, downloaded and unzipped to a local directory

2. After decompression is completed into the bin directory to open (win), there is a flashback, can not be launched

Pothole 1:

Whose article I'm not going to talk about, follow his way, configure environment variables, configure jdk environment variables (this first step is configured), configure jdk jre path variables, configure tomcat environment variables. After the configuration and reboot, the results can be imagined.

Stomp the Pit 2:

The port number is occupied, tomcat default port is 8080, check the process found that it is indeed occupied by other applications, kill the original process, restart startup again, the results flashback!

Pothole 3:

Since killing the original process does not work, then change the tomcat default port, conf directory to find the modified port, the results flashbacks

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Pothole 4:

Edit the file and add the JAVA_HOME, CATALINA_HOME configurations to the beginning of the file

SET JAVA_HOME=D:\Program_Files\Java\jdk1.8 (java jdk directory)
SET CATALINA_HOME=D:\apache-tomcat-7.0.70 (Tomcatcatalogs)

Then run it again successfully, it runs successfully, it's fairly reliable, and the browser types in: http://127.0.0.1:8080

3. After the start of the discovery of garbled code, solve: modify the conf directory file, will be as follows UFT-8 changed to GBK

 = UTF-8

Three.jenkins download deployment

1.Download

1) download address: /jenkins/war/, I downloaded here is the war package, you can directly use the

2) will download a good war package copied to tomcat decompression directory webapps directory, and then the browser to execute: http://127.0.0.1:8080/jenkins, and then the page prompts the request for resources [/jenkins] is not available, hey, no way, then proceed to step on the pit road.

Pothole 1:

tomcat version is too high or too low is not supported, said tomcat9 support, line, I'll change 8.5.59 to 9.0.93, and then start, run, request, all in one go, the results of the resource is not available!

Stomp the Pit 2:

jenkins version is too high, at first I used the latest war package 2.471, thinking the same, so I switched to the lowest version of the current site, then start, run, request, all in one go, the result is that the resource is unavailable

Pothole 3:

Look at the tomcat log error is [at least one JAR has been scanned for a TLD but does not yet contain a TLD. For this reason, the logger enables debug logging to get a complete list of JARs that have been scanned but do not have a TLD found in them. Skipping unneeded JARs during scanning can shorten startup time and JSP compilation time] So I opened up the stomping grounds again, went into the conf directory to find, change =/ to =*.jar, and then start, run, request, all in one go, and the result was that the resource was unavailable. Also triggered other errors, good guy, really good guy!

=/

Pothole 4:

Finally really can not do, find a colleague to a jenkins.war2.246 package, and then start, run, request, one and done, the results did not expect success, at this moment I just want to say, the world's furthest from the success of the distance is to look up the answer online.

Basic Configuration

1) With all of the above in place, request http://127.0.0.1:8080/jenkins and you will be prompted to set a password the first time.

If you don't know the password, please see the graphic for instructions. Enter the password and ask to download the plugin, at this point never, ever, ever ........... Do not download. If you download

Then you will find that all fail, because the plug-ins downloaded here are the latest, and we installed the jenkins version is too low, the version is not supported, the back processing is very troublesome.

Keep stepping on potholes:

Pothole 1:

Going in to jenkins and configuring the download source and then updating the plugin resulted in nothing!

Stomp the Pit 2:

Delete the downloaded plugin, go to the .jenkins\plugins file and delete all the files ending with .jpi, and it does nothing!

Solution:

This time you can close the service, find .jenkins "Updates" file, this file is configured with the default download source, we need to change to match the version of the address: /jenkins/updates/, to find the corresponding dynamic-2.264/, you can directly request to get the json return data, and directly replace the contents of the. Note that to delete ();;, only take the content of the response can be. Then restart the service, download plug-ins can be found all downloaded successfully. Then go in to fill in the login username and password page

Configure the instance, the default on it, and finished to the jenkins page

2)Manage jenkins》manage plugins》advancedSetting up domestic download sources

Address: /jenkins/updates/, remember to paste the version that matches jenkins.

3) Configure jdk

Go to Manage jenkins, Global Tool Configuration and find the jdk.

4) git configuration

Go to Manage jenkins, Global Tool Configuration and find git.

The path in the figure should be the path to the git directory, you can type in the command window: where git to see the

5) allure configuration

Go to Manage jenkins, Global Tool Configuration and find allure.

 

3. Create jobs

New Item" If you do automation, you can't use maven, you can use FreeStyle Project and Pipeline Project. here we introduce the former.

Go to the job configuration page, select source management, and configure the git information

Setting the Script Execution Code

Setting up the allure configuration (setting up two addresses)

Once the configuration is complete, execute the build plan and you're good to go