Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Jenkins and Maven installation and configuration for continuous integration

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

1. Install JDK1) check the openJDK that comes with the system.

Execute the command to view the built-in JDK: rpm-qa | grep java

2) Uninstall openJDKrpm-e-nodeps java-1.7.0-openjdk-1.7.0.201-2.6.16.1.el7_6.x86_64rpm-e-nodeps java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64rpm-e-- nodeps java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64rpm-e-- nodeps java -1.7.0-openjdk-headless-1.7.0.201-2.6.16.1.el7_6.x86_643) download JDK1.8 from oracle's official website

4) define the path for uploading jdk to linux. Upload it to / usr/local/java. 5) the root path of decompressed JDKtar xzvf jdk-8u201-linux-x64.tar.gz is: / usr/local/java/jdk1.8.0_2016) configure the JDK environment variable and take effect.

Method 1: modify .profile or .bash _ profile under the current user [valid for current user]

Method 2: modify the / etc/profile file [valid for all users]

Add JAVA_HOME and CLASSPATH variables at the end of the file, and modify the PATH variable

JAVA_HOME=/usr/local/java/jdk1.8.0_201CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME export PATH export CLASSPATH

Save and execute source / etc/profile on the command line to make it effective

7) Verification

Execute java-version

Indicates that the installation was successful

2, install Maven1) execute the following command under linux to download the Maven installation package

Path customization, this time under / usr/local/maven

Wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz

2) decompress the maven installation package tar-xzvf apache-maven-3.6.0-bin.tar.gz 3) modify the setting.xml file of maven [as needed] and enter it under the apache-maven-3.6.0/conf path Execute vi setting.xml to add the following configuration at the appropriate location / usr/local/maven/repository alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central 4) add environment variables

Method 1: modify .profile or .bash _ profile under the current user [valid for current user]

Method 2: modify the / etc/profile file [valid for all users]

Add M2_HOME and MAVEN_HOME variables at the end of the file

M2_HOME=/usr/local/maven/apache-maven-3.6.0MAVEN_HOME=/usr/local/maven/apache-maven-3.6.0PATH=$M2_HOME/bin:$PATHexport M2_HOMEexport MAVEN_HOMEexport PATH

Save and exit, then execute source / etc/profile to make it effective

Note: the official website is required to configure M2_HOME, but some software may still use MAVEN_HOME variables, so to avoid errors, just add both

5) Verification

Mvn-version

Indicates that the installation was successful

3. Install Jekins

It is recommended that the server should have at least 512m of available memory and more than 10GB disk space.

The small team suggests: 1G + memory; 50G + free disk space.

1) download the Jenkins installation package from the official website

Https://jenkins.io/download/

Here I download the jenkins.war package.

2) upload the jenkins.war package to linux

The upload path is / usr/local/jenkins

3) start jenkins [use built-in jetty]

Java-jar jenkins.war-- httpPort=8080

If you use tomcat, put the war package under the webapps path, and configure the root path of the environment variable JENKINS_HOME=tomcat [path where the webapps directory is located]. For more information, please see the JDK installation above.

4) after startup, you can access the main page

For example: http://192.168.30.144:8080

When you access a new Jenkins instance for the first time, you are asked to unlock it with an automatically generated password.

At this point, it is recommended to determine whether the network is normal and the domain name server is normal, for example

Nslookup mirrors.jenkins-ci.org

If the result is shown above, it means that DNS is misconfigured. You can try again using Ali's domain name server, such as

Nslookup mirrors.jenkins-ci.org 223.5.5.5 or nslookup mirrors.jenkins-ci.org 223.6.6.6

It can be seen that the IP address is correctly obtained through Ali's domain name server.

For more information, please refer to the following address

Https://support.cloudbees.com/hc/en-us/articles/218156717-Jenkins-is-Experiencing-UnknownHostException

5) Jenkins unlock

At this point, a long string of characters will appear in the viewing console (or viewed in initialAdminPassword). Copy the string and enter it in the interface to unlock Jenkins, and then install the required plug-ins.

Modify the working home directory of Jenkins

Jenkins stores all the data files in this directory. You can change it in the following ways: use your Web container management tool to set JENKINS_HOME environment parameters. Set the JENKINS_HOME environment variable before starting the Web container. (not recommended) change the web.xml configuration file in Jenkins.war (or in the expanded Web container). This value cannot be changed while Jenkins is running. It is usually used to ensure that your configuration works.

For more information, please refer to https://jenkins.io/zh/doc/book/installing/

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report