自动化领域比较有影响力的开源框架jenkins,确实比较强大,易用。很多公司将其用来做持续即成CI(continuous integration)。为了拓展和强化自己的软件设计生态系统,也将很久前使用过的jenkins再熟悉一下。在这里做下备忘。
首先就是下载jenkins安装包,其实所谓的安装,是习惯说法,这个直接从官网下载后,一个war包(jenkins.war, 60M大小左右),直接就可以启动运行。我本地安装的是最新版本1.644. 由于jenkins是java写的,运行过程中需要有JDK,即java要先安装且配置好JAVA_HOME。
查看下我的java home信息:
[root@CloudGame jenkins]# echo $JAVA_HOME
/usr/java/jdk1..0_65
这个基本要求具备后,就可以启动jenkins了,这里演示,就直接java -jar jenkins.war来启动,当然,jenkins也可以在任何servlet容器里面运行,比如Tomcat等。
[root@CloudGame jenkins]# java -jar jenkins.war
Running from: /home/webWps/jenkins/jenkins.war
webroot: $user.home/.jenkins
Jan , :: PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Jan , :: PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-winstone-2.9
Jan , :: PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet
Jenkins home directory: /root/.jenkins found at: $user.home/.jenkins
Jan , :: PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started SelectChannelConnector@0.0.0.0:
Jan , :: PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2. running: controlPort=disabled
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Started initialization
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Listed all plugins
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Prepared all plugins
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Started all plugins
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Augmented all extensions
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Loaded all jobs
Jan , :: PM hudson.model.AsyncPeriodicWork$ run
INFO: Started Download metadata
Jan , :: PM hudson.model.AsyncPeriodicWork$ run
INFO: Finished Download metadata. ms
Jan , :: PM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Completed initialization
Jan , :: PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@6ddaa30c: display name [Root WebApplicationContext]; startup date [Wed Jan :: CST ]; root of context hierarchy
Jan , :: PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@6ddaa30c]: org.springframework.beans.factory.support.DefaultListableBeanFactory@17cfc9f4
Jan , :: PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@17cfc9f4: defining beans [authenticationManager]; root of factory hierarchy
Jan , :: PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@574f6e10: display name [Root WebApplicationContext]; startup date [Wed Jan :: CST ]; root of context hierarchy
Jan , :: PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@574f6e10]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1006f1b7
Jan , :: PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1006f1b7: defining beans [filter,legacy]; root of factory hierarchy
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Started initialization
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Listed all plugins
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Prepared all plugins
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Started all plugins
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Augmented all extensions
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Loaded all jobs
Jan , :: PM jenkins.InitReactorRunner$ onAttained
INFO: Completed initialization
Jan , :: PM hudson.WebAppMain$ run
INFO: Jenkins is fully up and running
之所以可以直接java -jar jenkins.war运行,从这个启动日志中可以看到,是因为jenkins内部集成了jetty这个web服务程序,正如spring-boot的框架,默认集成Tomcat服务程序一样。
jenkins的启动后,默认http://localhost:8080就可以打开查看web UI了,易用就体现在所有的相关配置都在web ui上完成。免除对命令行不习惯的用户的烦恼,也不需要这里配置一点,哪里配置一点的脑裂痛苦。还有,也可以自己设置选定的端口号,这样就可以: java -jar jenkins.war --httpPort=8081 , jenkins有很多启动配置选项,可以通过--help查看:
[root@CloudGame jenkins]# java -jar jenkins.war --help
Running from: /home/webWps/jenkins/jenkins.war
webroot: $user.home/.jenkins
Jenkins Continuous Integration Engine 1.644
Usage: java -jar jenkins.war [--option=value] [--option=value] Options:
--extractedFilesFolder = folder where extracted files are to be located. Default is the temp folder
--daemon = fork into background and run as daemon (Unix only)
--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 debug msgs (-). Default is (INFO level) --httpPort = set the http listening port. - to disable, Default is
--httpListenAddress = set the http listening address. Default is all interfaces
--httpDoHostnameLookups = enable host name lookups on incoming http connections (true/false). Default is false
--httpKeepAliveTimeout = how long idle HTTP keep-alive connections are kept around (in ms; default )?
--httpsPort = set the https listening port. - to disable, Default is disabled
if neither --httpsCertificate nor --httpsKeyStore are specified,
https is run with one-time self-signed certificate.
--httpsListenAddress = set the https listening address. Default is all interfaces
--httpsDoHostnameLookups = enable host name lookups on incoming https connections (true/false). Default is false
--httpsKeepAliveTimeout = how long idle HTTPS keep-alive connections are kept around (in ms; default )?
--httpsKeyStore = the location of the SSL KeyStore file.
--httpsKeyStorePassword = the password for the SSL KeyStore file. Default is null
--httpsCertificate = the location of the PEM-encoded SSL certificate file.
(the one that starts with '-----BEGIN CERTIFICATE-----')
must be used with --httpsPrivateKey.
--httpsPrivateKey = the location of the PEM-encoded SSL private key.
(the one that starts with '-----BEGIN RSA PRIVATE KEY-----')
--httpsKeyManagerType = the SSL KeyManagerFactory type (eg SunX509, IbmX509). Default is SunX509
--spdy = Enable SPDY. See http://wiki.eclipse.org/Jetty/Feature/NPN
--ajp13Port = set the ajp13 listening port. - to disable, Default is disabled
--ajp13ListenAddress = set the ajp13 listening address. Default is all interfaces
--controlPort = set the shutdown/control port. - to disable, Default disabled --handlerCountStartup = set the no of worker threads to spawn at startup. Default is
--handlerCountMax = set the max no of worker threads to allow. Default is
--handlerCountMaxIdle = set the max no of idle worker threads to allow. Default is --sessionTimeout = set the http session timeout value in minutes. Default to what webapp specifies, and then to minutes
--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)
--maxParamCount=N = set the max number of parameters allowed in a form submission to protect
against hash DoS attack (oCERT #-). Default is .
--usage / --help = show this message
--version = show the version and quit 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)
下面,打开浏览器看看效果吧:
这里,是我测试用的一个环境,里面有意个mueas的project,这个项目之前都是手动操作build,现在,希望用jenkins来定时操作build。
我会将这个项目删除掉,然后新建一个,演示这个操作过程。删除job,貌似web ui上没有哟,这个其实也很简单,在jenkins的默认运行环境路径下,将其删除即可(~/.jenkins/jobs),删除后,需要重新启动jenkins。不然web ui上还会有记录,这个可能是缓存里面的数据吧。下面,将mueas job删除,从0开始说说基本的配置,由于我这个mueas项目是基于maven的,所以,我就以这个为例子,做介绍。
[root@CloudGame .jenkins]# cd jobs/
[root@CloudGame jobs]# ll
total
drwxr-xr-x root root Jan : mueas
[root@CloudGame jobs]# rm -rf mueas/
现在说配置的事情。我的mueas项目,是用git这个SCM工具管理的,所以,在jenkins里面,需要安装git的插件。jenkins的插件管理非常牛叉啊,现有的插件都有200多个,根据需要,自己选择安装,不需要的还可以uninstall。在jenkins>Manage Jenkins>Manage Plugins>Available下面搜索需要的插件,为了方便后续继续使用,我将git, git-client,git-server都安装了,还有一个GitHub的插件,这个也可以勾上。安装完后,需要重启哟,这个是jenkins的特点,是不是有点像windows安装应用程序后要重启os的感脚。。。由于我已经安装了,我就将安装了的tab页相关信息截图参考一下吧。
先说下,这个是删除掉之前的mueas job后重启完成的界面,由于一个job都没有,提示是否创建job。这是后话。这里主要是说从如何找到plugin的安装页面。下图展示我已经安装了的插件,这里有些是jenkins默认就安装的,红色框的是我安装的git相关的插件。完全可以根据自己项目需要选择安装。
除了上面红色的框,发现没,maven的集成插件也有,若没有,也需要自己安装maven插件的。再说说这个绿色的框,里面有的后面有Downgrade信息的按钮,这个是针对插件更新用的,这个更新是向低版本更新哟。
需要的插件安装完了,那么,就要说说系统环境配置了。如下图所示,也很容易找到Jenkins>Manage jenkins>Configure System
这里说说,最基本的配置信息吧,其他的都采用jenkins默认的配置。需要配置的,如下图,红色框选部分,另外,JDK以及Maven安装信息,要根据自己的系统环境进行配置。我的JDK以及Maven安装路径分别是:/usr/java/jdk1.8.0_65和/usr/local/apache-maven-3.3.3(其他部分的信息,是系统自动填上的,就让其存在吧,有的是必要的,有的是没有用的,对我这个项目来说):
上面显示的就是主要要配置的,配置好后,点击保存即可。
下面进入job的创建了,这里才进入主题哟,呵呵,其实,真正的项目开发中,很多设置环境或则平台搭建的这种不能直接体现出经济效益的事情,更能反映出一个技术人员的功底。废话哈!
然后进一步做配置,下面做详细的配置,主要是git相关的配置。我选择的源码管理工具是git,配置URL,这个就是我们在linux下做clone用的那个url,一模一样,因为jenkins运行的时候也是要从远程repo上clone待build的project。另外一个很重要的配置,就是下面的credential了,这个估计很容易搞错。
那么就说说这个credential的配置,看下图,我在Kind下拉框中选择的是SSH Username with private key,因为我们的git仓库,采用的是SSH key访问的。这里的username填什么呢?这个是要和下面的private key配合的,就是指当前访问git repo远程仓库采用的认证属主,我的demo中,在git远程仓库的根目录下的.ssh里面那个authorized_keys文件里面追加的公钥是root用户的。在这里,也是用这个用户来代理操作clone过程。所以,username是root,private key内容为/root/.ssh/id_rsa这个私钥的内容。我选择的private key的类型是Enter directly,所以,要将私钥的内容完整的拷贝到这里哟。注意,-----BEGIN RSA PRIVATE KEY -----以及对应的结尾信息也一并拷贝过来哟。
接下来,需要配置build的策略了,就是build项目的那个分支,我这里选择的是master,这个也是系统默认的配置。另外,就是build的触发机制,我这里选择的是周期触发,这个配置有些类似linux的corn的规则。我这里配的是希望每天晚上11点半启动build过程。
点击schedule右边的问号按钮,有详细的帮助信息。我这里贴一个简单的规则描述,方便理解上面配置当中各个数字的含义以及可能都有什么配置。
This field follows the syntax of cron (with minor differences). Specifically, each line consists of 5 fields separated by TAB or whitespace:
MINUTE HOUR DOM MONTH DOW
MINUTE Minutes within the hour (0–59)
HOUR The hour of the day (0–23)
DOM The day of the month (1–31)
MONTH The month (1–12)
DOW The day of the week (0–7) where 0 and 7 are Sunday.
最后的配置,就是想做什么的事情。我希望让其打包,并且不需要执行unit test工作,就是红色框中的内容。注意,这里要填写的是Goals (以及选项,当然选项可以没有),不要带上mvn指令,否则会出错的哟。(错误信息主体为:You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id> 。。。。)
当然,这当中还有很多其他的配置,比如build前预处理做什么,以及build完成后的后处理做什么,这些都可以通过脚本定义要做的事情。我这里就什么也不做。至于邮件通知,公司屏蔽了SMTP端口,没有办法发邮件,因为发送的过程中,会报下面的错误:
Failed to send out e-mail javax.mail.MessagingException: Could not connect to SMTP host: smtp..com, port: ;
nested exception is:
java.net.NoRouteToHostException: No route to host
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:)
at javax.mail.Service.connect(Service.java:)
at javax.mail.Service.connect(Service.java:)
at javax.mail.Service.connect(Service.java:)
at javax.mail.Transport.send0(Transport.java:)
at javax.mail.Transport.send(Transport.java:)
at hudson.tasks.Mailer$DescriptorImpl.doSendTestMail(Mailer.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:)
at org.kohsuke.stapler.MetaClass$.doDispatch(MetaClass.java:)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:)
at org.kohsuke.stapler.MetaClass$.doDispatch(MetaClass.java:)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:)
at org.kohsuke.stapler.Stapler.service(Stapler.java:)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:)
at hudson.util.PluginServletFilter$.doFilter(PluginServletFilter.java:)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:)
at hudson.security.ChainedServletFilter$.doFilter(ChainedServletFilter.java:)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:)
at hudson.security.ChainedServletFilter$.doFilter(ChainedServletFilter.java:)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:)
at hudson.security.ChainedServletFilter$.doFilter(ChainedServletFilter.java:)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:)
at hudson.security.ChainedServletFilter$.doFilter(ChainedServletFilter.java:)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:)
at hudson.security.ChainedServletFilter$.doFilter(ChainedServletFilter.java:)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:)
at hudson.security.ChainedServletFilter$.doFilter(ChainedServletFilter.java:)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:)
at hudson.security.ChainedServletFilter$.doFilter(ChainedServletFilter.java:)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:)
at hudson.security.ChainedServletFilter$.doFilter(ChainedServletFilter.java:)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:)
at org.eclipse.jetty.server.Server.handle(Server.java:)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$.run(SelectChannelEndPoint.java:)
at winstone.BoundedExecutorService$.run(BoundedExecutorService.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
Caused by: java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:)
at java.net.Socket.connect(Socket.java:)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:)
... more
到此,一个基本的job就算配置完毕了,下面看看job配置完成后是什么样子呢?
先看看1标记的红框,S表示status,目前是一个新的job,状态是灰色的,表示没有执行过。2标记的信息,看看标题,对应信息可以看出。3标记的图标,是一个按钮,可以立即启动job的执行。
那我这里就立即执行一下吧,看看最后的效果吧。鼠标点击一下3的按钮,执行完毕后,上面的图所示状态变为下面的状态了(S反映的状态变成蓝色的了,若build失败,会是红色的。右边红色框里面,可以看到这个build所用的时间。#1表示第1次build。。。)。相应的日志也贴出了让大家参考下吧。
Started by user anonymous
Building in workspace /root/.jenkins/workspace/mueas
Cloning the remote Git repository
Cloning repository git@109.105.5.108:/data/git/mueas.git
> git init /root/.jenkins/workspace/mueas # timeout=
Fetching upstream changes from git@109.105.5.108:/data/git/mueas.git
> git --version # timeout=
using GIT_SSH to set credentials mueas git authentication
> git -c core.askpass=true fetch --tags --progress git@109.105.5.108:/data/git/mueas.git +refs/heads/*:refs/remotes/origin/*
> git config remote.origin.url git@109.105.5.108:/data/git/mueas.git # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url git@109.105.5.108:/data/git/mueas.git # timeout=10
Fetching upstream changes from git@109.105.5.108:/data/git/mueas.git
using GIT_SSH to set credentials mueas git authentication
> git -c core.askpass=true fetch --tags --progress git@109.105.5.108:/data/git/mueas.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision e8c79c2becf145c173c1441876d8035fd58ef672 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f e8c79c2becf145c173c1441876d8035fd58ef672
First time build. Skipping changelog.
Parsing POMs
Discovered a new module com.tinguish:mueas mueas
Modules changed, recalculating dependency graph
[mueas] $ java -cp /root/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/usr/local/apache-maven-3.3.3/boot/plexus-classworlds-2.5.2.jar:/usr/local/apache-maven-3.3.3/conf/logging jenkins.maven3.agent.Maven31Main /usr/local/apache-maven-3.3.3 /root/.jenkins/war/WEB-INF/lib/remoting-2.53.2.jar /root/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /root/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 60663
<===[JENKINS REMOTING CAPACITY]===>���channel started
Executing Maven: -B -f /root/.jenkins/workspace/mueas/pom.xml -s /root/.m2/settings.xml -gs /usr/local/apache-maven-3.3.3/conf/settings.xml package -Dmaven.test.skip=true
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building mueas 0.0.1-SNAPSHOT
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.6:resources (default-resources) @ mueas ---
[pool-1-thread-1 for channel] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Using 'UTF-8' encoding to copy filtered resources.
[pool-1-thread-1 for channel] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 0 resource
[pool-1-thread-1 for channel] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 863 resources
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.1:compile (default-compile) @ mueas ---
[pool-1-thread-1 for channel] INFO org.apache.maven.plugin.compiler.CompilerMojo - Changes detected - recompiling the module!
[pool-1-thread-1 for channel] INFO org.codehaus.plexus.compiler.javac.JavacCompiler - Compiling 40 source files to /root/.jenkins/workspace/mueas/target/classes
[pool-1-thread-1 for channel] WARN org.apache.maven.plugin.compiler.CompilerMojo - /root/.jenkins/workspace/mueas/src/main/java/com/tinguish/mueas/infra/security/MueasAuthenticationProvider.java: /root/.jenkins/workspace/mueas/src/main/java/com/tinguish/mueas/infra/security/MueasAuthenticationProvider.java uses or overrides a deprecated API.
[pool-1-thread-1 for channel] WARN org.apache.maven.plugin.compiler.CompilerMojo - /root/.jenkins/workspace/mueas/src/main/java/com/tinguish/mueas/infra/security/MueasAuthenticationProvider.java: Recompile with -Xlint:deprecation for details.
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.6:testResources (default-testResources) @ mueas ---
[pool-1-thread-1 for channel] INFO org.apache.maven.plugin.resources.TestResourcesMojo - Not copying test resources
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ mueas ---
[pool-1-thread-1 for channel] INFO org.apache.maven.plugin.compiler.TestCompilerMojo - Not compiling test sources
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-surefire-plugin:2.17:test (default-test) @ mueas ---
[pool-1-thread-1 for channel] INFO org.apache.maven.plugin.surefire.SurefirePlugin - Tests are skipped.
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-war-plugin:2.5:war (default-war) @ mueas ---
[pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Packaging webapp
[pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Assembling webapp [mueas] in [/root/.jenkins/workspace/mueas/target/mueas-0.0.1-SNAPSHOT]
[pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Processing war project
[pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Copying webapp resources [/root/.jenkins/workspace/mueas/src/main/webapp]
[pool-1-thread-1 for channel] INFO org.apache.maven.plugin.war.WarMojo - Webapp assembled in [515 msecs]
[pool-1-thread-1 for channel] INFO org.codehaus.plexus.archiver.war.WarArchiver - Building war: /root/.jenkins/workspace/mueas/target/mueas-0.0.1-SNAPSHOT.war
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- spring-boot-maven-plugin:1.2.7.RELEASE:repackage (default) @ mueas ---
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD SUCCESS
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 11.411 s
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: 2016-01-20T15:54:01+08:00
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - Final Memory: 36M/263M
[pool-1-thread-1 for channel] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[JENKINS] Archiving /root/.jenkins/workspace/mueas/pom.xml to com.tinguish/mueas/0.0.1-SNAPSHOT/mueas-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/mueas/target/mueas-0.0.1-SNAPSHOT.war to com.tinguish/mueas/0.0.1-SNAPSHOT/mueas-0.0.1-SNAPSHOT.war
channel stopped
Finished: SUCCESS
好了,基础篇介绍到此吧,信息量已经比较大了,希望想入门jenkins的小伙伴能够得到一点帮助!