【Jenkins】windows安装步骤

news2024/10/19 23:49:02

【Jenkins】windows安装步骤

  • 官网
  • 使用WAR包方式运行
  • 浏览器访问Jenkins
  • windows-installer安装
  • 安装过程问题解决
    • This account either does not hava the privilege to logon as a service or the account was unable to be verified
  • 安装成功
  • 修改jenkins.xml
  • 启动jenkins
  • 访问jenkins
  • 安装插件
    • 离线安装插件
  • 常用插件
  • 常用Jenkins页面

官网

  • 官网: https://www.jenkins.io/
  • windows下载地址: https://www.jenkins.io/download/thank-you-downloading-windows-installer/
  • 通用包下载,点击Generic Java package (.war):
    • https://mirrors.tuna.tsinghua.edu.cn/jenkins/war-stable/2.387.1/jenkins.war
    • https://mirror.twds.com.tw/jenkins/war-stable/2.462.3/jenkins.war
  • Jenkins安装软硬件要求: https://www.jenkins.io/doc/book/installing/linux/#prerequisites
    • Java版本要求: https://www.jenkins.io/doc/book/platform-information/support-policy-java/
  • 官方用户指南: https://www.jenkins.io/doc/
  • jenkins.io如果官网访问不了,尝试修改DNS114.114.114.1148.8.8.8

使用WAR包方式运行

  • 新建一个安装目录,例如D:\ProgramFiles\Jenkins
  • jenkins.war复制到安装目录
  • 新建环境变量: JENKINS_HOME=D:\ProgramFiles\Jenkins
    在这里插入图片描述

    解压的war包默认是放在C盘的用户目录,通过JENKINS_HOME环境变量可以快捷指定解压的WAR包路径、插件路径、日志路径等

  • 查看帮助: java -jar jenkins.war --help
Microsoft Windows [版本 10.0.22631.4317]
(c) Microsoft Corporation。保留所有权利。

D:\ProgramFiles\Jenkins>java -jar jenkins.war --help
Running from: D:\ProgramFiles\Jenkins\jenkins.war
webroot: D:\ProgramFiles\Jenkins\war
Jenkins Automation Server Engine 2.462.3
Usage: java -jar jenkins.war [--option=value] [--option=value]

Options:
   --webroot                = folder where the WAR file is expanded into. Default is ${JENKINS_HOME}/war
   --pluginroot             = folder where the plugin archives are expanded into. Default is ${JENKINS_HOME}/plugins
                              (NOTE: this option does not change the directory where the plugin archives are stored)
   --extractedFilesFolder   = folder where extracted files are to be located. Default is the temp folder
   --enable-future-java     = allows running with Java versions which are not fully supported
   --paramsFromStdIn        = Read parameters from standard input (stdin)
   --version                = Print version to standard output (stdout) and exit
   --javaHome               = Override the JAVA_HOME variable
   --config                 = load configuration properties from here. Default is ./winstone.properties
   --prefix                 = add this prefix to all URLs (eg http://localhost:8080/prefix/resource). Default is none
   --commonLibFolder        = folder for additional jar files. Default is ./lib

   --logfile                = redirect log messages to this file
   --logThrowingLineNo      = show the line no that logged the message (slow). Default is false
   --logThrowingThread      = show the thread that logged the message. Default is false
   --debug                  = set the level of Winstone debug msgs (1-9). Default is 5 (INFO level)

   --httpPort               = set the http listening port. -1 to disable, Default is 8080
   --httpListenAddress      = set the http listening address. Default is all interfaces
   --httpUnixDomainPath     = set the http unix domain path. Default is no path
   --httpKeepAliveTimeout   = how long idle HTTP keep-alive connections are kept around (in ms; default 30000)?
   --httpsPort              = set the https listening port. -1 to disable, Default is disabled
   --httpsListenAddress     = set the https listening address. Default is all interfaces
   --httpsKeepAliveTimeout  = how long idle HTTPS keep-alive connections are kept around (in ms; default 30000)?
   --httpsKeyStore          = the location of the SSL KeyStore file. Default is ./winstone.ks
   --httpsKeyStorePassword  = the password for the SSL KeyStore file. Default is null
   --httpsKeyManagerType    = the SSL KeyManagerFactory type (eg SunX509, IbmX509). Default is SunX509
   --httpsRedirectHttp      = redirect http requests to https (requires both --httpPort and --httpsPort)
   --http2Port              = set the http2 listening port. -1 to disable, Default is disabled
   --httpsSniHostCheck      = if the SNI Host name must match when there is an SNI certificate. Check disabled per default
   --httpsSniRequired       = if a SNI certificate is required. Disabled per default
   --http2ListenAddress     = set the http2 listening address. Default is all interfaces
   --httpsVerifyClient      = if the client needs a certificate. Can be true (clients always needs a certificate),
                              optional or false.
   --excludeProtocols       = set protocol versions to exclude. (comma separated list, use blank quote " " to exclude none)
                              (default is "SSL", "SSLv2", "SSLv2Hello", "SSLv3")
   --excludeCipherSuites    = set the ciphers to exclude (comma separated, use blank quote " " to exclude none) (default is
                           // Exclude weak / insecure ciphers
                           "^.*_(MD5|SHA|SHA1)$",
                           // Exclude ciphers that don't support forward secrecy
                           "^TLS_RSA_.*$",
                           // The following exclusions are present to cleanup known bad cipher
                           // suites that may be accidentally included via include patterns.
                           // The default enabled cipher list in Java will not include these
                           // (but they are available in the supported list).
                           "^SSL_.*$",
                           "^.*_NULL_.*$",
                           "^.*_anon_.*$"
   --controlPort            = set the shutdown/control port. -1 to disable, Default disabled

   --compression            = set the compression scheme (gzip or none to disable compression). Default is gzip.
   --sessionTimeout         = set the http session timeout value in minutes. Default to what webapp specifies, and then to 60 minutes
   --sessionEviction        = set the session eviction timeout for idle sessions in seconds. Default value is 180. -1 never evict, 0 evict on exit
   --mimeTypes=ARG          = define additional MIME type mappings. ARG would be EXT=MIMETYPE:EXT=MIMETYPE:...
                              (e.g., xls=application/vnd.ms-excel:wmf=application/x-msmetafile)
   --requestHeaderSize=N    = set the maximum size in bytes of the request header. Default is 8192.
   --responseHeaderSize=N    = set the maximum size in bytes of the response header. Default is 8192.
   --maxParamCount=N        = set the max number of parameters allowed in a form submission to protect
                              against hash DoS attack (oCERT #2011-003). Default is 10000.
   --useJmx                 = Enable Jetty Jmx
   --qtpMaxThreadsCount     = max threads number when using Jetty Queued Thread Pool
   --jettyAcceptorsCount    = Jetty Acceptors number
   --jettySelectorsCount    = Jetty Selectors number
   --usage / --help         = show this message
 Security options:
   --realmClassName               = Set the realm class to use for user authentication. Defaults to ArgumentsRealm class

   --argumentsRealm.passwd.<user> = Password for user <user>. Only valid for the ArgumentsRealm realm class
   --argumentsRealm.roles.<user>  = Roles for user <user> (comma separated). Only valid for the ArgumentsRealm realm class

   --fileRealm.configFile         = File containing users/passwds/roles. Only valid for the FileRealm realm class

 Access logging:
   --accessLoggerClassName        = Set the access logger class to use for user authentication. Defaults to disabled
   --simpleAccessLogger.format    = The log format to use. Supports combined/common/resin/custom (SimpleAccessLogger only)
   --simpleAccessLogger.file      = The location pattern for the log file(SimpleAccessLogger only)
  • 指定端口启动Jenkins: java -jar jenkins.war --httpPort=8890
D:\ProgramFiles\Jenkins>java -jar jenkins.war --httpPort=8890
Running from: D:\ProgramFiles\Jenkins\jenkins.war
webroot: D:\ProgramFiles\Jenkins\war
2024-10-11 01:27:24.897+0000 [id=1]     INFO    winstone.Logger#logInternal: Beginning extraction from war file
2024-10-11 01:27:25.753+0000 [id=1]     WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2024-10-11 01:27:25.813+0000 [id=1]     INFO    org.eclipse.jetty.server.Server#doStart: jetty-10.0.24; built: 2024-08-26T17:58:21.070Z; git: d5384207795da96fad32db8ea8d26b69955bcc03; jvm 21+35-2513
2024-10-11 01:27:32.225+0000 [id=1]     INFO    o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2024-10-11 01:27:32.276+0000 [id=1]     INFO    o.e.j.s.s.DefaultSessionIdManager#doStart: Session workerName=node0
2024-10-11 01:27:33.699+0000 [id=1]     INFO    hudson.WebAppMain#contextInitialized: Jenkins home directory: D:\ProgramFiles\Jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
2024-10-11 01:27:34.326+0000 [id=1]     INFO    o.e.j.s.handler.ContextHandler#doStart: Started w.@7ea08277{Jenkins v2.462.3,/,file:///D:/ProgramFiles/Jenkins/war/,AVAILABLE}{D:\ProgramFiles\Jenkins\war}
2024-10-11 01:27:34.451+0000 [id=1]     INFO    o.e.j.server.AbstractConnector#doStart: Started ServerConnector@2e48362c{HTTP/1.1, (http/1.1)}{0.0.0.0:8890}
2024-10-11 01:27:34.796+0000 [id=1]     INFO    org.eclipse.jetty.server.Server#doStart: Started Server@14fc1f0{STARTING}[10.0.24,sto=0] @10278ms
2024-10-11 01:27:34.796+0000 [id=69]    INFO    winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
2024-10-11 01:27:34.952+0000 [id=78]    INFO    jenkins.InitReactorRunner$1#onAttained: Started initialization
2024-10-11 01:27:34.999+0000 [id=98]    INFO    jenkins.InitReactorRunner$1#onAttained: Listed all plugins
2024-10-11 01:27:37.490+0000 [id=106]   INFO    jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
2024-10-11 01:27:37.521+0000 [id=116]   INFO    jenkins.InitReactorRunner$1#onAttained: Started all plugins
2024-10-11 01:27:37.540+0000 [id=119]   INFO    jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
2024-10-11 01:27:38.148+0000 [id=119]   INFO    jenkins.InitReactorRunner$1#onAttained: System config loaded
2024-10-11 01:27:38.148+0000 [id=119]   INFO    jenkins.InitReactorRunner$1#onAttained: System config adapted
2024-10-11 01:27:38.148+0000 [id=92]    INFO    jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2024-10-11 01:27:38.163+0000 [id=92]    INFO    jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2024-10-11 01:27:38.226+0000 [id=136]   INFO    hudson.util.Retrier#start: Attempt #1 to do the action check updates server
2024-10-11 01:27:39.150+0000 [id=107]   INFO    jenkins.install.SetupWizard#init:

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

562cc0d6bc444f299ef44f79460f4589

This may also be found at: D:\ProgramFiles\Jenkins\secrets\initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

2024-10-11 01:27:47.879+0000 [id=136]   INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
2024-10-11 01:27:47.879+0000 [id=136]   INFO    hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt #1
2024-10-11 01:27:51.060+0000 [id=107]   INFO    jenkins.InitReactorRunner$1#onAttained: Completed initialization
2024-10-11 01:27:51.060+0000 [id=58]    INFO    hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running

Jenkins第一次启动,会在控制台打印管理员初始化密码,比如562cc0d6bc444f299ef44f79460f4589,同时jenkins目录下也生成了很多个文件夹
在这里插入图片描述

浏览器访问Jenkins

  • 访问http://localhost:8890
    在这里插入图片描述
  • 输入密码562cc0d6bc444f299ef44f79460f4589,进入jenkins首页

    如果忘记了或找不到启动时的初始密码,可以从这个位置查看初始密码: D:\ProgramFiles\Jenkins\secrets\initialAdminPassword

  • 选哪个都可以,我一般会选择选择插件来安装,可以看看默认勾选的是哪些插件
    在这里插入图片描述
  • 根据需要勾选插件,然后点右下角的安装
    在这里插入图片描述
  • 接下来就是等待Jenkins下载和安装上一步勾选的插件
    在这里插入图片描述
  • 安装完插件后,会进入下一个页面,创建管理员账号
    在这里插入图片描述

    也可以不创建用户,直接点击使用admin账户继续

  • 配置Jenkins访问地址

    在这里插入图片描述

  • 这样就完成了Jenkins的基本配置

    在这里插入图片描述

  • 成功进入Jenkins首页

    在这里插入图片描述

windows-installer安装

除了WAR包方式,windows还可以下载installer安装程序进行安装

安装过程问题解决

This account either does not hava the privilege to logon as a service or the account was unable to be verified

在这里插入图片描述

  • 如果出现这个错误提示,则参考资料: https://blog.csdn.net/wuxiaoying888/article/details/124457546
  • 命令行输入secpol.msc打开本地安全策略
  • 本地策略 --> 用户权限分配 --> 作为服务登录 --> 添加当前登录用户

安装成功

会在windows服务列表中新增一个Jenkins服务

修改jenkins.xml

  • <env name="JENKINS_HOME" value="D:\ProgramFiles\Jenkins\.jenkins"/>
  • <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "D:\ProgramFiles\Jenkins\jenkins.war" --httpPort=8080 --webroot="D:\ProgramFiles\Jenkins\war"</arguments>
  • <pidfile>D:\ProgramFiles\Jenkins\jenkins.pid</pidfile>

启动jenkins

net start Jenkins

访问jenkins

  • 在浏览器输入http://localhost:8080
    在这里插入图片描述
  • 打开D:\ProgramFiles\Jenkins\.jenkins\secrets\initialAdminPassword复制初始化密码
  • 安装社区推荐的插件
    在这里插入图片描述
    • Folders
    • OWASP Markup Formatter
    • Build Timeout
    • Credentials Binding
    • Timestamper
    • Workspace Cleanup
    • Ant
    • Gradle
    • Pipeline
    • GitHub Branch Source
    • Pipeline: GitHub Groovy Libraries
    • Pipeline: Stage View
    • Git
    • SSH Build Agents
    • Matrix Authorization Strategy
    • PAM Authentication
    • LDAP
    • Email Extension
    • Mailer
    • Localization: Chinese (Simplified)
  • 跳过
    在这里插入图片描述

安装插件

离线安装插件

  • D:\ProgramFiles\Jenkins\.jenkins\plugins直接将jpi放入Jenkinsplugins文件夹下,然后重启Jenkins即可
  • 重启Jenkins,在浏览器输入http://localhost:8080/restart

常用插件

  • Git: https://plugins.jenkins.io/git/#releases
  • Subversion: https://plugins.jenkins.io/subversion/#releases
  • Gitee: https://plugins.jenkins.io/gitee/#releases
  • Pipeline: https://plugins.jenkins.io/workflow-aggregator/#releases
    Pipeline还依赖下面这几个插件
    • Pipeline: Stage View
    • Pipeline: Nodes and Processes
    • Pipeline: Basic Steps
  • Localization: Chinese (Simplified)
  • Publish Over SSH: https://plugins.jenkins.io/publish-over-ssh/#releases

常用Jenkins页面

  • Jenkins环境变量: http://localhost:8080/env-vars.html/
  • 全局变量: http://localhost:8080/job/ssh-test/pipeline-syntax/globals
  • Pipeline语法生成器: http://localhost:8080/job/ssh-test/pipeline-syntax/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2218838.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

如何测试IP速度?

了解代理的连接速度是否快速是确保网络使用效率和体验的关键因素之一。本文来为大家如何有效地评估和测试代理IP的连接速度&#xff0c;以及一些实用的方法和工具&#xff0c;帮助用户做出明智的选择和决策。 一、如何评估代理IP的连接速度 1. 使用在线速度测试工具 为了快速…

阿里云云盘在卸载时关联到PHP进程,如何在不影响PHP进程情况下卸载磁盘

1.问题&#xff1a; 在使用umount /dev/vdc1 卸载磁盘时&#xff0c;提示如下&#xff0c;导致无法在Linux系统下卸载磁盘 umount /dev/vdc1 umount: /var/www/html/*/eshop/IFile3: target is busy.(In some cases useful info about processes that usethe device is found…

鸿蒙Next设备上的ProxyMan、Charles网络抓包配置教程

一、Proxyman配置 1. 导出证书 ProxyMan菜单栏依次点击 证书—>导出—>根证书为PEM 然后保存.pem文件传送(如hdc命令<下文会有介绍>)至鸿蒙Next设备存储任意位置 2. 安装证书 系统设置搜索“证书”&#xff0c;结果列表中点击“证书与凭据” 点击“从存储设备…

AI周报(10.13-10.19)

AI应用-清华校友用AI破解162个高数定理 加州理工、斯坦福和威大的研究人员提出了LeanAgent——一个终身学习&#xff0c;并能证明定理的AI智能体。LeanAgent会根据数学难度优化的学习轨迹课程&#xff0c;来提高学习策略。并且&#xff0c;它还有一个动态数据库&#xff0c;有效…

数据结构练习题4(链表)

1两两交换链表中的节点 给你一个链表&#xff0c;两两交换其中相邻的节点&#xff0c;并返回交换后链表的头节点。你必须在不修改节点内部的值的情况下完成本题&#xff08;即&#xff0c;只能进行节点交换&#xff09;。 示例 1&#xff1a; 输入&#xff1a;head [1,2,3,4]…

Sqli-labs less-27

Sqli-labs less-27 过滤union\select绕过方式 ### 1. 逻辑绕过 例&#xff1a; 过滤代码 union select user,password from users 绕过方式 1 && (select user from users where userid1)‘admin’### 2.十六进制字符绕过 select ——> selec\x74 union——>un…

AutoFixture:.NET 的假数据生成工具

上次推荐过《Bogus&#xff1a;.NET的假数据生成利器》方便我们制造假数据测试。今天继续推荐另外一个也是非常流行的工具。 01 项目简介 AutoFixture 是一个用于 .NET 的测试工具&#xff0c;它允许开发者在单元测试中自动生成随机的测试数据。它支持广泛的数据类型&#xf…

充电桩高压快充发展趋势

一、为什么要升级充电电压 1、新能源发展的困境 随着电动汽车加快发展&#xff0c;用户对电动汽车接受度不断提高&#xff0c;充电问题是影响电动车普及的重要因素&#xff0c;用户快速补能的需求强烈&#xff0c;例如节假日经常会遇到&#xff0c;高速充电1小时&#xff0c;…

编码方式知识整理【ASCII、Unicode和UTF-8】

编码方式 一、ASCII编码二、Unicode 编码三、UTF-8编码四、GB2312编码五、GBK编码 计算机中对数据的存储为二进制形式&#xff0c;但采用什么样的编码方式存储&#xff0c;效率更高。主要编码方式有 ASCII、Unicode、UTF-8等。 英文一般为1个字节&#xff0c;汉字一般为3个字节…

智联云采 SRM2.0 testService SQL注入漏洞复现

0x01 产品简介 智联云采是一款针对企业供应链管理难题及智能化转型升级需求而设计的解决方案,针对企业供应链管理难题,及智能化转型升级需求,智联云采依托人工智能、物联网、大数据、云等技术,通过软硬件系统化方案,帮助企业实现供应商关系管理和采购线上化、移动化、智能…

Pytorch复习(二)

一、非线性回归 import torch import matplotlib.pyplot as plt from torch import nn,optim from torch.autograd import Variable import numpy as npx_data np.linspace(-2,2,200)[:,np.newaxis] noise np.random.normal(0,0.2,x_data.shape) y_data np.square(x_data) …

.Net自动更新程序GeneralUpdate,适用于wpf,winfrom,控制台应用

GeneralUpdate是基于.net framwork4.5.2开发的一款&#xff08;c/s应用&#xff09;自动升级程序。 第一个版本叫Autoupdate 有人会奇怪为什么会改名称&#xff0c;稍微解释一下是因为在nuget上有重名的项目再者就是新版本更新功能不仅限于wpf程序的更新。 将更新的核心部分抽…

VS Code开发qt项目

没整明白&#xff0c;尴尬 安装扩展 设置cmake路径 前提是已经安装了QT 报错 用msvc选windows启动&#xff0c;用mingw则选gdb启动

pandas处理时间序列-基础入门

公众号&#xff1a;尤而小屋编辑&#xff1a;Peter作者&#xff1a;Peter 大家好&#xff0c;我是Peter~ Pandas 是一个强大的 Python 数据分析库&#xff0c;它提供了非常灵活和高效的方式来处理时间序列数据。 时间序列数据是指按照时间顺序排列的数据点集合&#xff0c;通…

LabVIEW示波器通信及应用

基于LabVIEW平台开发的罗德与施瓦茨示波器通信与应用系统实现了示波器的远程控制及波形数据的实时分析&#xff0c;通过TCP/IP或USB接口与计算机通信&#xff0c;利用VISA技术进行指令传输&#xff0c;从而实现高效的数据采集与处理功能。 项目背景 随着现代电子测试需求的日益…

滑铁卢大学大模型公开课资料来了,大模型入门到精通,非常详细收藏我这一篇就够了

今天给大家推荐的是加拿大滑铁卢大学大模型公开课资源&#xff0c;根据QS世界大学排名&#xff0c;其计算机专业排名全球22。 课程内容主要分为五部分&#xff1a;大模型基础、Transformer架构、大语言模型、多模态大模型、智能体。 每一课除了PPT和视频链接&#xff0c;还有…

013_django基于大数据的高血压人群分析系统2024_dcb7986h_055

目录 系统展示 开发背景 代码实现 项目案例 获取源码 博主介绍&#xff1a;CodeMentor毕业设计领航者、全网关注者30W群落&#xff0c;InfoQ特邀专栏作家、技术博客领航者、InfoQ新星培育计划导师、Web开发领域杰出贡献者&#xff0c;博客领航之星、开发者头条/腾讯云/AW…

VScode实现服务器免密登录(亲测有效)

目录 1 免密步骤1.1 在本地生成密钥1.2 在vscode中下载Remote-SSH1.3 配置SSH文件1.4 在服务器中添加本地公开密钥1.5 远程免密连接试验 2 后记 1 免密步骤 1.1 在本地生成密钥 window R打开命令面板 ssh-keygen1.2 在vscode中下载Remote-SSH 1.3 配置SSH文件 本地密钥的文…

Java 入门基础篇14 - java面向对象思想以及特性

学习目标&#xff1a; 一、目标 面向对象思想类和对象对象的创建和使用属性和方法封装 开始学习&#xff1a; 二、编程思想 2.1 什么是编程思想 做人有做人的原则&#xff0c;编程也有编程的原则。这些编程的原则&#xff0c;就叫做编程思想。 2.2 面向过程和面向对象 二…

卡尔曼讲解与各种典型进阶MATLAB编程(专栏目录,持续更新……)

专栏链接&#xff1a;https://blog.csdn.net/callmeup/category_12574912.html 文章目录 专栏介绍重点文章卡尔曼滤波的原理卡尔曼滤波的例程 进阶MATLAB编程后续更新 专栏介绍 本专栏旨在深入探讨卡尔曼滤波及其在各类应用中的实现&#xff0c;尤其是通过MATLAB编程进行的典…