JiFu's Wiki JiFu's Wiki
首页
  • HTML
  • JavaScript
  • NodeJS
  • Vuejs
  • 微信小程序
  • Python
  • 数据库
  • 中间件
  • 算法
  • 软件工程
  • Wordpress
  • iOS开发
  • Android开发
  • Linux
  • Windows
  • MacOS
  • Docker
  • Vim
  • VSCode
  • Office
  • 其他
  • Photoshop
  • Sketch
  • Mac
  • 游戏
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
首页
  • HTML
  • JavaScript
  • NodeJS
  • Vuejs
  • 微信小程序
  • Python
  • 数据库
  • 中间件
  • 算法
  • 软件工程
  • Wordpress
  • iOS开发
  • Android开发
  • Linux
  • Windows
  • MacOS
  • Docker
  • Vim
  • VSCode
  • Office
  • 其他
  • Photoshop
  • Sketch
  • Mac
  • 游戏
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 数据库

  • Python

  • 中间件

    • Nginx

    • Gogs

    • Sentry

    • Jenkins

      • Jenkins介绍
      • Jenkins安装手册
        • Install java sdk
        • add jenkins repository
        • Install jenkins
      • 利用Jenkins持续集成iOS项目
      • jenkins密码重置
    • Shadowsocks

    • Logstash

    • RabbitMQ

    • Gitlab

    • 宝塔

  • 算法

  • 软件工程

  • Wordpress

  • 后端技术
  • 中间件
  • Jenkins
JiFu
2023-10-18
目录

Jenkins安装手册

# indro

Jenkins is an open-source, Java-based automation server that offers an easy way to set up a continuous integration and continuous delivery (CI/CD) pipeline.

Continuous integration (CI) is a DevOps practice in which team members regularly commit their code changes to the version control repository, after which automated builds and tests are run. Continuous delivery (CD) is a series of practices where code changes are automatically built, tested and deployed to production.

This tutorial, will walk you through the steps of installing Jenkins on a CentOS 7 system using the official Jenkins repository.

# Prerequisites

Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges.

# Installing Jenkins

To install Jenkins on your CentOS system, follow the steps below:

# Install java sdk

Jenkins is a Java application, so the first step is to install Java. Run the following command to install the OpenJDK 8 package:

sudo yum install java-1.8.0-openjdk-devel
1

The current version of Jenkins does not support Java 10 (and Java 11) yet. If you have multiple versions of Java installed on your machine make sure Java 8 is the default Java version.

# add jenkins repository

The next step is to enable the Jenkins repository. To do that, import the GPG key using the following curl command:

curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo
1

And add the repository to your system with:

sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
1

# Install jenkins

Once the repository is enabled, install the latest stable version of Jenkins by typing:

sudo yum install jenkins
1

After the installation process is completed, start the Jenkins service with:

sudo systemctl start jenkins
1

To check whether it started successfully run:

systemctl status jenkins
1

You should see something similar to this:

● jenkins.service - LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
Active: active (running) since Thu 2018-09-20 14:58:21 UTC; 15s ago
    Docs: man:systemd-sysv-generator(8)
Process: 2367 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/jenkins.service
1
2
3
4
5
6

Finally enable the Jenkins service to start on system boot.

sudo systemctl enable jenkins
jenkins.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig jenkins on
1
2
3

# Adjust the Firewall

If you are installing Jenkins on a remote CentOS server that is protected by a firewall you need to port 8080.

Use the following commands to open the necessary port:

sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
sudo firewall-cmd --reload
1
2

# Setting Up Jenkins

To set up your new Jenkins installation, open your browser and type your domain or IP address followed by port 8080:

http://your_ip_or_domain:8080
1

A screen similar to the following will appear, prompting you to enter the Administrator password that is created during the installation:

Use the following command to print the password on your terminal:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword
1

You should see a 32-character long alphanumeric password as shown below:

2115173b548f4e99a203ee99a8732a32
1

Copy the password from your terminal, paste it into the Administrator password field and click Continue.

On the next screen, you will be asked whether you want to install the suggested plugins or to select specific plugins. Click on the Install suggested plugins box, and the installation process will start immediately.

Once the installation is complete, you will be prompted to set up the first administrative user. Fill out all required information and click Save and Continue.

On the next page, you will be asked to set the URL for the Jenkins instance. The URL field will be populated with an automatically generated URL.

To complete the setup confirm the URL by clicking on the Save and Finish button.

Finally, click on the Start using Jenkins button and you will be redirected to the Jenkins dashboard logged in as the admin user you have created in one of the previous steps.

If you’ve reached this point, you’ve successfully installed Jenkins on your CentOS system.

# Conclusion

In this tutorial, you have learned how to install and complete the initial configuration of Jenkins on CentOS/RHEL based systems. You can now visit the official Jenkins documentation page and start exploring Jenkins’s workflow and plug-in model. If you have any questions, please leave a comment below.

上次更新: 2023/10/18, 08:39:40
Jenkins介绍
利用Jenkins持续集成iOS项目

← Jenkins介绍 利用Jenkins持续集成iOS项目→

最近更新
01
Disable notification "to get future google chrome updates you'll need macos 10.13 or later" on mac
05-14
02
MacOS软件推荐
04-30
03
Debian Sway开发机安装手册
03-26
更多文章>
Theme by Vdoing | Copyright © 2019-2025 Ji Fu | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式