本文采用tomcat+war包的形式进行安装
1.下载war包
下载地址
http://mirrors.jenkins.io/war-stable/latest/jenkins.war
2.安装tomcat
我这里8080端口被占了,所以更改tomcat默认端口
修改配置文件为
<Connector port="38080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
将war包放入webapp目录
[root@bogon webapps]# ll
total 64740
drwxr-x--- 11 root root 4096 Jul 8 09:27 jenkins
-rw-r--r-- 1 root root 66288019 Jul 8 09:26 jenkins.war
[root@bogon webapps]# pwd #不要在意这里的bogon,这是我给别的项目组搭建的服务器
/home/tomcat/webapps
3.启动服务
进入bin目录执行
[root@linux3 logs]# ./startup.sh
登录
http://linux3:38080/jenkins
输入密码
root@linux3 logs]# cat /root/.jenkins/secrets/initialAdminPassword
d02dcf1d5e6b4a438a67aac7f466c23d
用户创建
选择推荐的插件进行下载,下载不下来没关系,跳过,后面可以自己再下载相应的插件
4.插件下载
更换插件下载地址(经验证不管什么锤子用,下载依然很慢,不知道是不是我们公司网络原因)
http://updates.jenkins-ci.org/download/plugins/
进入/root/.jenkins/
https://updates.jenkins.io/update-center.json
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
离线plugins下载地址
所有的插件都是可以离线下载的,只要找好他们的依赖关系,依赖关系可以在选择安装插件的时候看到
官网:https://plugins.jenkins.io/
将下载的*.hpi插件上传至/root/.jenkins/plugins/
所有插件列表如下
一些常用的插件
Localization: Chinese (Simplified)
Jenkins Core 及其插件的简体中文语言包,由 Jenkins 中文社区维护。
Maven Integration
This plug-in provides, for better and for worse, a deep integration of Jenkins and Maven: Automatic triggers between projects depending on SNAPSHOTs, automated configuration of various Jenkins publishers (Junit, …).
maven插件,用来打包jar包
GitLab Plugin
This plugin allows GitLab to trigger Jenkins builds and display their results in the GitLab UI.
Build With Parameters
Allows the user to provide parameters for a build in the url (similar to /job/JOBNAME/buildWithParameters), prompting for confirmation before triggering the job.
可以让你创建带参数的项目
Extended Choice Parameter Plug-In
Adds extended functionality to Choice parameter
扩展选择参数插件,可以让你选择多个参数
这就算是把jenkins装好了,配置的问题要根据你的实际使用情况来配置
以下是我安装的插件列表
Active Choices Plug-in
This plug-in provides additional parameter types for jobs, that allow you to cascade changes and render images or other HTML elements instead of the traditional parameter.
2.3
Ant Plugin
Adds Apache Ant support to Jenkins
1.11
Apache HttpComponents Client 4.x API Plugin
Bundles Apache HttpComponents Client 4.x and allows it to be used by Jenkins plugins.
4.5.10-2.0
Authentication Tokens API
This plugin provides an API for converting credentials into authentication tokens in Jenkins.
1.3
bouncycastle API Plugin
This plugin provides an stable API to Bouncy Castle related tasks.
2.18
Branch API Plugin
This plugin provides an API for multiple branch based projects.
2.5.6
Build Timeout
This plugin allows builds to be automatically terminated after the specified amount of time has elapsed.
1.19.1
Build With Parameters
Allows the user to provide parameters for a build in the url (similar to /job/JOBNAME/buildWithParameters), prompting for confirmation before triggering the job.
1.4
Command Agent Launcher Plugin
Allows agents to be launched using a specified command.
1.4
Config File Provider Plugin
Ability to provide configuration files (e.g. settings.xml for maven, XML, groovy, custom files,...) loaded through the UI which will be copied to the job workspace.
3.6.3
Credentials Binding
Allows credentials to be bound to environment variables for use from miscellaneous build steps.
1.21
Credentials Plugin
This plugin allows you to store credentials in Jenkins.
2.3.11
Display URL API
Provides the DisplayURLProvider extension point to provide alternate URLs for use in notifications
2.3.2
Docker API Plugin
This plugin provides docker-java API for other plugins.
3.1.5.2
Docker Commons
Provides the common shared functionality for various Docker-related plugins.
1.16
Docker plugin
This plugin integrates Jenkins with Docker
1.2.0
Durable Task Plugin
Library offering an extension point for processes which can run outside of Jenkins yet be monitored.
1.34
Email Extension Plugin
This plugin is a replacement for Jenkins's email publisher. It allows to configure every aspect of email notifications: when an email is sent, who should receive it and what the email says
2.69
EnvInject API Plugin
Stores shared logic for Environment Injection management
1.7
Environment Injector Plugin
This plugin makes it possible to set an environment for the builds.
2.3.0
Extended Choice Parameter Plug-In
Adds extended functionality to Choice parameter
0.78
Extensible Choice Parameter plugin
Extensible Choice Parameter provides several ways to retrieve choices, including the way to share choices among all jobs.
1.6.0
Folders
This plugin allows users to create "folders" to organize jobs. Users can define custom taxonomies (like by project type, organization type etc). Folders are nestable and you can define views within folders. Maintained by CloudBees, Inc.
6.12
Git client plugin
Utility plugin for Git support in Jenkins
3.3.1
Git plugin
This plugin integrates Git with Jenkins.
4.3.0
GIT server Plugin
Allows Jenkins to act as a Git server.
1.9
GitHub API Plugin
This plugin provides GitHub API for other plugins.
1.114.3
GitHub Branch Source
Multibranch projects and organization folders from GitHub. Maintained by CloudBees, Inc.
2.6.0
GitHub plugin
This plugin integrates GitHub to Jenkins.
1.30.0
GitLab Plugin
This plugin allows GitLab to trigger Jenkins builds and display their results in the GitLab UI.
1.5.13
Google OAuth Credentials plugin
This plugin implements the OAuth Credentials interfaces to surface Google Service Account credentials to Jenkins.
1.0.0
Gradle Plugin
This plugin allows Jenkins to invoke Gradle build scripts directly.
1.36
H2 API Plugin
This plugin is a shared library. It provides the H2 jar so that other plugins can consume H2 without duplication and without classpath collisions.
1.4.199
Jackson 2 API
This plugin exposes the Jackson 2 JSON APIs to other Jenkins plugins.
2.10.3
Javadoc Plugin
1.5
JavaScript GUI Lib: ACE Editor bundle plugin
JavaScript GUI Lib: ACE Editor bundle plugin.
1.1
JavaScript GUI Lib: Handlebars bundle plugin
JavaScript GUI Lib: Handlebars bundle plugin.
1.1.1
JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin
JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin.
1.2.1
JavaScript GUI Lib: Moment.js bundle plugin
JavaScript GUI Lib: Moment.js bundle plugin.
1.1.1
jQuery plugin
This plugin provides an stable version of jQuery Javascript Library
1.12.4-1
JSch dependency plugin
Jenkins plugin that brings the JSch library as a plugin dependency, and provides an SSHAuthenticatorFactory for using JSch with the ssh-credentials plugin.
0.1.55.2
JUnit
Allows JUnit-format test results to be published.
1.28
Kubernetes
This plugin integrates Jenkins with Kubernetes
1.25.2
Kubernetes Client API
Kubernetes Client API plugin for use by other Jenkins plugins.
4.8.0-1
Kubernetes Credentials
Common classes for Kubernetes credentials
0.6.2
LDAP Plugin
Adds LDAP authentication to Jenkins
1.24
Locale plugin
This plugin lets you control the language of Jenkins.
1.4
Localization Support Plugin
Supporting infrastructure for standalone localization plugins. On its own, this plugin doesn't do a lot, it requires other plugins to work.
1.1
Localization: Chinese (Simplified)
Jenkins Core 及其插件的简体中文语言包,由 Jenkins 中文社区维护。
1.0.16
Lockable Resources plugin
This plugin allows to define external resources (such as printers, phones, computers) that can be locked by builds. If a build requires an external resource which is already locked, it will wait for the resource to be free.
2.8
Mailer Plugin
This plugin allows you to configure email notifications for build results
1.32
MapDB API Plugin
This plugin provides a shared dependency on the MapDB library so that other plugins can co-operate when using this library.
1.0.9.0
Matrix Authorization Strategy Plugin
Offers matrix-based security authorization strategies (global and per-project).
2.6.1
Matrix Project
Multi-configuration (matrix) project type.
1.14
Maven Integration
This plug-in provides, for better and for worse, a deep integration of Jenkins and Maven: Automatic triggers between projects depending on SNAPSHOTs, automated configuration of various Jenkins publishers (Junit, ...).
3.5
OAuth Credentials plugin
This plugin provides interfaces for OAuth credentials in Jenkins.
0.4
OkHttp Plugin
This plugin provides OkHttp for other plugins.
3.14.9
Oracle Java SE Development Kit Installer Plugin
Allows the Oracle Java SE Development Kit (JDK) to be installed via download from Oracle's website.
1.4
OWASP Markup Formatter
Uses the OWASP Java HTML Sanitizer to allow safe-seeming HTML markup to be entered in project descriptions and the like.
2.0
PAM Authentication plugin
Adds Unix Pluggable Authentication Module (PAM) support to Jenkins
1.6
Persistent Parameter Plugin
String, text, boolean and choice parameters with default values set from the previous build (if any).
1.2
Pipeline
A suite of plugins that lets you orchestrate automation, simple or complex. See Pipeline as Code with Jenkins for more details.
2.6
Pipeline Graph Analysis Plugin
Provides a REST API to access pipeline and pipeline run data.
1.10
Pipeline Maven Integration Plugin
This plugin provides integration with Pipeline, configures maven environment to use within a pipeline job by calling sh mvn or bat mvn. The selected maven installation will be configured and prepended to the path.
3.8.2
Pipeline: API
Plugin that defines Pipeline API.
2.40
Pipeline: Basic Steps
Commonly used steps for Pipelines.
2.20
Pipeline: Build Step
Adds the Pipeline step build to trigger builds of other jobs.
2.12
Pipeline: Declarative
An opinionated, declarative Pipeline.
1.7.0
Pipeline: Declarative Extension Points API
APIs for extension points used in Declarative Pipelines.
1.7.0
Pipeline: GitHub Groovy Libraries
Allows Pipeline Grrovy libraries to be loaded on the fly from GitHub.
1.0
Pipeline: Groovy
Pipeline execution engine based on continuation passing style transformation of Groovy scripts.
2.80
Pipeline: Input Step
Adds the Pipeline step input to wait for human input or approval.
2.11
Pipeline: Job
Defines a new job type for pipelines and provides their generic user interface.
2.38
Pipeline: Milestone Step
Plugin that provides the milestone step
1.3.1
Pipeline: Model API
Model API for Declarative Pipeline.
1.7.0
Pipeline: Multibranch
Enhances Pipeline plugin to handle branches better by automatically grouping builds from different branches.
2.21
Pipeline: Nodes and Processes
Pipeline steps locking agents and workspaces, and running external processes that may survive a Jenkins restart or slave reconnection.
2.35
Pipeline: REST API Plugin
Provides a REST API to access pipeline and pipeline run data.
2.13
Pipeline: SCM Step
Adds a Pipeline step to check out or update working sources from various SCMs (version control).
2.11
Pipeline: Shared Groovy Libraries
Shared libraries for Pipeline scripts.
2.16
Pipeline: Stage Step
Adds the Pipeline step stage to delineate portions of a build.
2.5
Pipeline: Stage Tags Metadata
Library plugin for Pipeline stage tag metadata.
1.7.0
Pipeline: Stage View Plugin
Pipeline Stage View Plugin.
2.13
Pipeline: Step API
API for asynchronous build step primitive.
2.22
Pipeline: Supporting APIs
Common utility implementations to build Pipeline Plugin
3.4
Plain Credentials Plugin
Allows use of plain strings and files as credentials.
1.7
Pre SCM BuildStep Plugin
This plugin allows build steps to be performed before the SCM step performs an action.
0.3
Resource Disposer Plugin
Dispose resources asynchronously. Utility plugin for resources that require more retries or take a long time to delete.
0.14
Role-based Authorization Strategy
Enables user authorization using a Role-Based strategy. Roles can be defined globally or for particular jobs or nodes selected by regular expressions.
2.16
SCM API Plugin
This plugin provides a new enhanced API for interacting with SCM systems.
2.6.3
Script Security Plugin
Allows Jenkins administrators to control what in-process scripts can be run by less-privileged users.
1.74
Snakeyaml API Plugin
This plugin provides Snakeyaml for other plugins.
1.26.4
SSH Agent
This plugin allows you to provide SSH credentials to builds via a ssh-agent in Jenkins
1.19
SSH Build Agents plugin
Allows to launch agents over SSH, using a Java implementation of the SSH protocol.
1.31.2
SSH Credentials Plugin
Allows storage of SSH credentials in Jenkins
1.18.1
SSH plugin
This plugin executes shell commands remotely using SSH protocol.
2.6.1
Structs Plugin
Library plugin for DSL plugins that need names for Jenkins objects.
1.20
Subversion Plug-in
2.13.1
Timestamper
Adds timestamps to the Console Output
1.11.2
Token Macro Plugin
This plug-in adds reusable macro expansion capability for other plug-ins to use.
2.12
Trilead API Plugin
Trilead API Plugin provides the Trilead library to any dependent plugins in an easily update-able manner.
1.0.8
Variant Plugin
This user-invisible library plugin allows other multi-modal plugins to behave differently depending on where they run.
1.3
WMI Windows Agents Plugin
Allows you to setup agents on Windows machines over Windows Management Instrumentation (WMI)
1.6
Workspace Cleanup Plugin
This plugin deletes the project workspace when invoked.