Jenkins+Jmeter+Gitlab+Ant interface automated continuous integration construction (1)

The first step: environment setup :

Ready to work:

Java and jdk configuration, jmeter installation and configuration, Jenkins construction completed, Ant installation

One, JDK configuration

Please Baidu to configure JDK configuration by yourself

2. Jmeter installation and configuration
1. Upload apache-jmeter-5.0.tar.gz to /usr/local and unzip

tar -zxvf apache-jmeter-5.0.tar.gz

2. After decompression, configure Jmeter environment variables

vi /etc/profile

3. Add the following variables at the end of the text

export JMETER_HOME=/usr/local/apache-jmeter-5.0
export CLASSPATH=$JMETER_HOME/lib/ext/ApacheJMeter_core.jar:$JMETER_HOME/lib/jorphan.jar:$CLASSPATH
export PATH=$JMETER_HOME/bin:$PATH

4. Let the configuration file take effect immediately

source /etc/profile 

5. Enter the path and re-entitle

# cd /usr/local/apache-jmeter-5.0/bin/
# chmod 777 *

6. Check if the installation is successful

jmeter -v

Insert picture description here

Three, Ant installation

1. Upload apache-ant-1.9.5.tar.gz to /usr/local and unzip

tar -zxvf apache-ant-1.9.5.tar.gz

2. After decompression, configure Jmeter environment variables

 vi /etc/profile

Add the following variables at the end of the text:

export ANT_HOME=/usr/local/apache-ant-1.9.5
export PATH=/usr/local/apache-ant-1.10.0/bin:$PATH

3. Let the configuration file take effect immediately

 source /etc/profile 

4. Check if the installation is successful

 ant -version

Insert picture description here

Four, Jenkins installation

1. Download and install

1) Start downloading:

wget https://pkg.jenkins.io/redhat-stable/jenkins-2.176.3-1.1.noarch.rpm

2) Installation

2, jdk establishes a soft connection

ln -s /usr/java/jdk1.8.0_191/bin/java /usr/bin/java

The purpose of soft connection is to mirror /usr/java/jdk1.8.0_191/bin/java to /usr/bin/java, the file will change synchronously, but it will not take up space

3. Modify permissions

chmod 777 jenkins.war

4. Restart

service jenkins restart

5. Visit the homepage & install the plug-in

http://localhost:8080

Visit the normal page:

Follow the prompts to view the password:

 cat /var/lib/jenkins/secrets/initialAdminPassword

After the next step, install the recommended plug-ins:

After installing the plug-in, create an account-->Finish

Five, Jenkins configuration:
for the next steps

Configure gitlab in system configure settings

Insert picture description here
Configure Ant variables in Global Tool Configuration
Insert picture description here
Create a free-style build task
Insert picture description here
Source code management
Insert picture description here
Build trigger settings
Insert picture description here
Build environment settings
Insert picture description here
Build
Insert picture description here
Generate reports after build
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_42760923/article/details/115003764