Preface
Say the important thing three times: put the warehouse last! ! ! The warehouse is last! ! ! The warehouse is last! ! !
Table of contents
2. General settings of jenkins
3. Parameterization example and push example
1. Necessary environment
1. jdk ( if you are installing jenkins with docker, please ignore this step)
2. jenkins (①win recommended and used this time ②linux-docker deployment )
Please refer to docker: Docker Learning 1-CentOS 7 Installation Docker_Ten-Tail Xianli's Blog-CSDN Blog
Please refer to Jenkins: Docker Learning 6-Quickly Install Jenkins and ZenTao System_Ten-Tail Xianli's Blog-CSDN Blog
2. General settings of jenkins
1. Turn on the report style (otherwise your report will not have css or js, because Jenkins will block it to prevent attacks), so you need to execute a statement in the [Script Console] "Script Command Line" in the Jenkins settings:
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")
2. Install the report plugin: HTML Publisher plugin
3. Create a new jenkins job
1) Parameterize env, select environment variables
2) Pull the code
It is recommended to use Code Cloud to pull faster: https://gitee.com/qq772262624/ppl-jmeter-open.git
3) Execute the shell, please refer to the usage documentation to add parameterization.
init.sh: Initialize permissions under Linux, generally not required for Windows
#!/bin/bash -l
sh jmeter-5.3-linux/init.sh
./build-docker $env
# 参数化示例:./build-docker env key add_param:value1 ${BUILD_URL}/InterfaceReport x.jmx
# build注意:
# -->1.如果是Windows则是:build.exe %env%
# -->2.linux及非docker-jenkins部署则是:./build $env
# -->3.linux-docker-jenkins部署则是:./build-docker $env
4) Post-build operations
4. Build the job and pass in the parameterized value of the build
5. Build log
View the report:
3. Parameterization example and push example
1. Execute the command
#!/bin/bash -l
sh jmeter-5.3-linux/init.sh
./build-docker $env $key $param ${BUILD_URL}/InterfaceReport
# 参数化示例:./build-docker env key param1:value1__param2:value2 url jmx
2、jenkins build job
3. View push information (support enterprises & DingTalk)
4. Click Push to view the report results
Download link for files required for integration: github gitee
If you think it's okay, please order stars!