当前位置:网站首页>Jenkins construction and use

Jenkins construction and use

2022-04-23 13:51:00 It only supports modification once a month

jenkins What is it? ?

Jenkins It's an open source 、 Provide continuous integration of operation interface (CI) Tools , Mainly for continuous 、 Automatic build / Test software project 、 Monitor the operation of external tasks .Jenkins use Java Language writing , Can be found in Tomcat Popular. servlet Running in the container , It can also operate independently . Usually with version management tools (SCM)、 Build tools in combination . Common version control tools are SVN、GIT, The build tools are Maven、Ant、Gradle

1. install

install Maven.
obtain Maven software package .
wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
decompression Maven After the package , Copy to the directory to be installed .

tar -zxvf apache-maven-3.6.3-bin.tar.gz
 
cp -r apache-maven-3.6.3 /usr/local/maven
To configure Maven environment variable .

Add the following to “/etc/profile” At the end of the file :

MAVEN_HOME=/usr/local/maven
export PATH=${MAVEN_HOME}/bin:$PATH
Then execute the following command , Load environment variables .

source /etc/profile
Execute the following command , see Maven Version number .

mvn -v
The echo content is as follows , Then prove Maven Successful installation

install jenkins
wget https://repo.huaweicloud.com/jenkins/redhat-stable/jenkins-2.190.3-1.1.noarch.rpm
 
rpm -ivh jenkins-2.190.3-1.1.noarch.rpm
Operation and verification

start-up Jenkins service .
systemctl start jenkins
see Jenkins Service status .
systemctl status jenkins
Echo as follows , Normal start

Open the browser , The login address :http://192.168.6.128:8080/

Get admin password

cat /var/lib/jenkins/secrets/initialAdminPassword

# vim /etc/init.d/jenkins    add to jdk The installation path

# vim /etc/sysconfig/jenkins   // The default is 8080, Change the startup user to root

jenkins First open blank solution

  • jenkins Plug-in management - Advanced settings screen ==> http://localhost:8080/pluginManager/advanced
  • hold https Agreement changed to http, And click the 【 Submit 】

step2: restart jenkins

  • stay url Address :localhost:8080/restart
  • Click on 【 yes 】

Configure the server first java_home and maven_home Post on page jenkins Global configuration jdk and maven,git etc.

​​​​​​​

 

//---------------------------------

CentOS In the use of yum Error in command :Failed to download metadata for repo ‘AppStream’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
reason :2022 year 1 month 1 The date of CentOS The authorities will no longer be responsible for CentOS 8 Provide service support , Although the system can be used normally , but CentOS 8 Of yum The source has been removed and cannot be used , Use yum Error will be reported during installation
resolvent :
Execute the commands in order to solve :
1. Execute the following command to replace the previous yum File backup :

rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo
1
2. Run the following command to download the latest repo file :

wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
1
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo
1
3. Run the following command to replace repo Links in files :

sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g'  /etc/yum.repos.d/Centos-vault-8.5.2111.repo &&  sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo
1
sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo
1
4. Run the following command to recreate the cache , If no error is reported , It's normal

yum clean all && yum makecache
 

版权声明
本文为[It only supports modification once a month]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230556158050.html