jenkins+git+springboot+maven持续集成构建部署

一、安装jenkins

参考 https://store.docker.com/images/jenkins 进行安装

docker cp 容器id:容器内文件 宿主主机目录 可以拷贝那个key出来(jenkins容器里没有vi 安装vi比较麻烦不如拷贝文件出来方便)

二、安装插件

1.Maven Integration plugin

2.docker-build-step

3.Git plugin 、Git client plugin、 GIT server Plugin

三、jenkins设置

1.设置:Docker server REST API URL

系统管理->系统设置 找到 Docker Builder 

jenkins+git+springboot+maven持续集成构建部署_第1张图片

我的系统是centos7 

1.vim /usr/lib/systemd/system/docker.service 

2.直接在ExecStart=/usr/bin/dockerd 后添加 -H=0.0.0.0:6732 -H=unix:///var/run/docker.sock   

3.执行如下两个命令

systemctl daemon-reload 

systemctl restart docker

jenkins和springboot项目部署在在同一个主机上,我用的ip是私有IP,这样docker 生成镜像时要快些

2.设置Maven

系统管理->Global Tool Configuration 

jenkins+git+springboot+maven持续集成构建部署_第2张图片jenkins+git+springboot+maven持续集成构建部署_第3张图片

四、新建项目

1.新建一个maven项目

jenkins+git+springboot+maven持续集成构建部署_第4张图片

2.源码管理

jenkins+git+springboot+maven持续集成构建部署_第5张图片

3.构建触发器

jenkins+git+springboot+maven持续集成构建部署_第6张图片

我的是gitlab 上面那个地址填在:你那git服务器的web hooks上,当代码提交到git上jenkins就会开始build

jenkins+git+springboot+maven持续集成构建部署_第7张图片

4.设置Build

5.设置Post Steps

jenkins+git+springboot+maven持续集成构建部署_第8张图片

jenkins+git+springboot+maven持续集成构建部署_第9张图片

6.保存

五、测试

点击 立即构建

jenkins+git+springboot+maven持续集成构建部署_第10张图片

或者提交新的git

jenkins+git+springboot+maven持续集成构建部署_第11张图片

点击上面#65 查看Console Output

BeanPostProcessors (for example: not eligible for auto-proxying)

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.2.RELEASE)

2017-08-16 10:06:02.758  INFO 6589 --- [           main] com.dcssn.WeianApplicationTests          : No active profile set, falling back to default profiles: default
2017-08-16 10:06:02.762  INFO 6589 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Refreshing org.springframework.web.context.support.GenericWebApplicationContext@64711bf2: startup date [Wed Aug 16 10:06:02 UTC 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@f1da57d

2017-08-16 10:06:04.141  INFO 6589 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!

2017-08-16 10:06:05.171  INFO 6589 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2017-08-16 10:06:05.263  INFO 6589 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.dcssn.repository.ProductRepository.
2017-08-16 10:06:05.265  INFO 6589 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.dcssn.repository.DepartmentRepository.
2017-08-16 10:06:05.266  INFO 6589 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.dcssn.repository.FlinkRepository.
2017-08-16 10:06:05.266  INFO 6589 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.dcssn.repository.NewsRepository.
2017-08-16 10:06:05.267  INFO 6589 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.dcssn.repository.TypeRepository.

2017-08-16 10:06:05.280  INFO 6589 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.dcssn.repository.UserRepository.
2017-08-16 10:06:05.281  INFO 6589 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.dcssn.repository.RoleRepository.
2017-08-16 10:06:05.412  WARN 6589 --- [           main] o.s.c.a.ConfigurationClassPostProcessor  : Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2017-08-16 10:06:05.854  INFO 6589 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=621c2cec-3059-3fd9-9e49-4656ed1a82ee
2017-08-16 10:06:06.152  INFO 6589 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'jpaConfiguration' of type [com.dcssn.config.JpaConfiguration$$EnhancerBySpringCGLIB$$62f44bbb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2017-08-16 10:06:06.357  INFO 6589 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$85f2e13b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-08-16 10:06:06.697  INFO 6589 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a20ce438] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2017-08-16 10:06:08.030  INFO 6589 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
2017-08-16 10:06:08.159  INFO 6589 --- [           main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2017-08-16 10:06:08.195  INFO 6589 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
	name: default
	...]
2017-08-16 10:06:08.337  INFO 6589 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.0.12.Final}
2017-08-16 10:06:08.338  INFO 6589 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2017-08-16 10:06:08.340  INFO 6589 --- [           main] org.hibernate.cfg.Environment            : HHH000021: Bytecode provider name : javassist
2017-08-16 10:06:08.410  INFO 6589 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}

2017-08-16 10:06:08.647  INFO 6589 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect

2017-08-16 10:06:09.834  INFO 6589 --- [           main] org.hibernate.tool.hbm2ddl.SchemaUpdate  : HHH000228: Running hbm2ddl schema update
2017-08-16 10:06:10.444  INFO 6589 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'

2017-08-16 10:06:11.578  INFO 6589 --- [           main] o.h.h.i.QueryTranslatorFactoryInitiator  : HHH000397: Using ASTQueryTranslatorFactory

Hibernate: select role0_.id as id1_5_, role0_.name as name2_5_, role0_.url as url3_5_ from role role0_

2017-08-16 10:06:15.152  INFO 6589 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher@1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@4bf89d3d, org.springframework.security.web.context.SecurityContextPersistenceFilter@74844216, org.springframework.security.web.header.HeaderWriterFilter@403cff1c, org.springframework.security.web.csrf.CsrfFilter@6f4029e9, org.springframework.security.web.authentication.logout.LogoutFilter@3e0e0ba7, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@cbdc0f4, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@35840ecc, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@fd0e118, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@51c6e775, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@40a84ea8, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@457b8fc3, org.springframework.security.web.session.SessionManagementFilter@b548f51, org.springframework.security.web.access.ExceptionTranslationFilter@3bbc47c9, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@1d1fd2aa]
2017-08-16 10:06:15.175  INFO 6589 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration$LazyEndpointPathRequestMatcher@13809363, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@564d3940, org.springframework.security.web.context.SecurityContextPersistenceFilter@1ee22768, org.springframework.security.web.header.HeaderWriterFilter@746f8520, org.springframework.security.web.authentication.logout.LogoutFilter@5cf80dfb, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@5eba9e41, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@38a52072, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@306bf4c3, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@58ad0586, org.springframework.security.web.session.SessionManagementFilter@3d3a28b5, org.springframework.security.web.access.ExceptionTranslationFilter@6108fd23, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@696ce057]
2017-08-16 10:06:15.224  WARN 6589 --- [           main] c.d.c.CustomFilterSecurityInterceptor    : Could not validate configuration attributes as the SecurityMetadataSource did not return any attributes from getAllConfigAttributes()

2017-08-16 10:06:15.951  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@64711bf2: startup date [Wed Aug 16 10:06:02 UTC 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@f1da57d
2017-08-16 10:06:16.140  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/about.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.AboutController.index()
2017-08-16 10:06:16.143  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/contact.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.ContactController.index(java.lang.String,org.springframework.ui.Model)
2017-08-16 10:06:16.152  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/contact/message],methods=[POST]}" onto public java.lang.String com.dcssn.Controller.ContactController.message(java.lang.String,java.lang.String,java.lang.String)
2017-08-16 10:06:16.153  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.IndexController.index(org.springframework.ui.Model,javax.servlet.http.HttpServletRequest) throws java.io.IOException
2017-08-16 10:06:16.154  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/news/{id}.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.NewsController.detail(java.lang.Long,org.springframework.ui.Model)
2017-08-16 10:06:16.154  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/news/page/{curpage}.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.NewsController.index(int,org.springframework.ui.Model)
2017-08-16 10:06:16.155  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/product/{productId}.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.ProductController.detail(java.lang.Long,org.springframework.ui.Model)
2017-08-16 10:06:16.155  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/product/index.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.ProductController.index(org.springframework.ui.Model)
2017-08-16 10:06:16.155  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/product/type/{typeId}.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.ProductController.type(java.lang.Long,org.springframework.ui.Model)
2017-08-16 10:06:16.156  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/ueditorcontrol]}" onto public java.lang.String com.dcssn.Controller.UeditorController.ueditor(javax.servlet.http.HttpServletRequest) throws org.json.JSONException
2017-08-16 10:06:16.156  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/upload],methods=[POST]}" onto public java.lang.String com.dcssn.Controller.common.UploadController.upload(org.springframework.web.multipart.MultipartFile)
2017-08-16 10:06:16.157  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/flink/findById],methods=[POST]}" onto public com.dcssn.entity.Flink com.dcssn.Controller.system.flink.FlinkController.findById(java.lang.Long)
2017-08-16 10:06:16.157  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/flink.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.system.flink.FlinkController.index(org.springframework.ui.Model)
2017-08-16 10:06:16.157  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/flink/update],methods=[POST]}" onto public java.lang.String com.dcssn.Controller.system.flink.FlinkController.update(com.dcssn.entity.Flink)
2017-08-16 10:06:16.157  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/flink/delete],methods=[POST]}" onto public java.lang.String com.dcssn.Controller.system.flink.FlinkController.delete(java.lang.Long)
2017-08-16 10:06:16.158  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/index.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.system.index.SysIndexController.index()
2017-08-16 10:06:16.158  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/login.html]}" onto public java.lang.String com.dcssn.Controller.system.login.LoginController.login()
2017-08-16 10:06:16.158  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/logout]}" onto public java.lang.String com.dcssn.Controller.system.login.LoginController.logout()
2017-08-16 10:06:16.160  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/news/del],methods=[POST],produces=[application/json]}" onto public java.lang.String com.dcssn.Controller.system.news.SysNewsController.del(java.lang.Long)
2017-08-16 10:06:16.160  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/news/add.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.system.news.SysNewsController.addHtml()
2017-08-16 10:06:16.160  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/news/muldel],methods=[POST],produces=[application/json]}" onto public java.lang.String com.dcssn.Controller.system.news.SysNewsController.mulDel(java.lang.String)
2017-08-16 10:06:16.160  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/news/edit.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.system.news.SysNewsController.editHtml(java.lang.Long,org.springframework.ui.Model)
2017-08-16 10:06:16.160  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/news/{curpage}.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.system.news.SysNewsController.index(int,com.dcssn.entity.News,org.springframework.ui.Model)
2017-08-16 10:06:16.161  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/news/update],methods=[POST]}" onto public java.lang.String com.dcssn.Controller.system.news.SysNewsController.update(com.dcssn.entity.News,org.springframework.validation.Errors,org.springframework.ui.Model)
2017-08-16 10:06:16.161  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/news/create],methods=[POST]}" onto public java.lang.String com.dcssn.Controller.system.news.SysNewsController.create(com.dcssn.entity.News,org.springframework.validation.Errors,org.springframework.ui.Model)
2017-08-16 10:06:16.206  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/product/del],methods=[POST],produces=[application/json]}" onto public java.lang.String com.dcssn.Controller.system.product.SysProductController.del(java.lang.Long)
2017-08-16 10:06:16.207  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/product/add.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.system.product.SysProductController.addHtml()
2017-08-16 10:06:16.207  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/product/muldel],methods=[POST],produces=[application/json]}" onto public java.lang.String com.dcssn.Controller.system.product.SysProductController.mulDel(java.lang.String)
2017-08-16 10:06:16.207  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/product/edit.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.system.product.SysProductController.editHtml(java.lang.Long,org.springframework.ui.Model)
2017-08-16 10:06:16.207  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/product/{curpage}.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.system.product.SysProductController.index(int,com.dcssn.entity.Product,org.springframework.ui.Model)
2017-08-16 10:06:16.207  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/product/update],methods=[POST]}" onto public java.lang.String com.dcssn.Controller.system.product.SysProductController.update(com.dcssn.entity.Product,org.springframework.validation.Errors,org.springframework.ui.Model)
2017-08-16 10:06:16.208  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/product/create],methods=[POST]}" onto public java.lang.String com.dcssn.Controller.system.product.SysProductController.create(com.dcssn.entity.Product,org.springframework.validation.Errors,org.springframework.ui.Model)
2017-08-16 10:06:16.211  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/type/findById],methods=[POST],produces=[application/json]}" onto public com.dcssn.entity.Type com.dcssn.Controller.system.type.TypeController.findById(java.lang.Long)
2017-08-16 10:06:16.211  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/type/findByPid],methods=[POST],produces=[application/json]}" onto public java.util.List com.dcssn.Controller.system.type.TypeController.findByPid(java.lang.Long)
2017-08-16 10:06:16.211  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/type.html],methods=[GET]}" onto public java.lang.String com.dcssn.Controller.system.type.TypeController.index(org.springframework.ui.Model)
2017-08-16 10:06:16.211  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/type/update],methods=[POST],produces=[application/json]}" onto public java.lang.String com.dcssn.Controller.system.type.TypeController.update(com.dcssn.entity.Type)
2017-08-16 10:06:16.212  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/type/delete],methods=[POST],produces=[application/json]}" onto public java.lang.String com.dcssn.Controller.system.type.TypeController.delete(java.lang.Long)
2017-08-16 10:06:16.212  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/system/type/create],methods=[POST],produces=[application/json]}" onto public java.lang.String com.dcssn.Controller.system.type.TypeController.create(com.dcssn.entity.Type)
2017-08-16 10:06:16.214  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2017-08-16 10:06:16.214  INFO 6589 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2017-08-16 10:06:16.315  INFO 6589 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-08-16 10:06:16.315  INFO 6589 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-08-16 10:06:16.432  INFO 6589 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

2017-08-16 10:06:18.313  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/loggers/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get(java.lang.String)
2017-08-16 10:06:18.313  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/loggers/{name:.*}],methods=[POST],consumes=[application/vnd.spring-boot.actuator.v1+json || application/json],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set(java.lang.String,java.util.Map)
2017-08-16 10:06:18.313  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/loggers || /loggers.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.314  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/env],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.value(java.util.Map)
2017-08-16 10:06:18.314  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/env/reset],methods=[POST]}" onto public java.util.Map org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.reset()
2017-08-16 10:06:18.314  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/refresh || /refresh.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
2017-08-16 10:06:18.315  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.315  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.316  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2017-08-16 10:06:18.316  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.316  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.317  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2017-08-16 10:06:18.317  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/restart || /restart.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.context.restart.RestartMvcEndpoint.invoke()
2017-08-16 10:06:18.318  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/info || /info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.318  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/health || /health.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,java.security.Principal)
2017-08-16 10:06:18.319  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/auditevents || /auditevents.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.http.ResponseEntity org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType(java.lang.String,java.util.Date,java.lang.String)
2017-08-16 10:06:18.320  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/pause || /pause.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
2017-08-16 10:06:18.321  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.321  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.322  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2017-08-16 10:06:18.322  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/env || /env.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.322  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-16 10:06:18.322  INFO 6589 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/resume || /resume.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()

2017-08-16 10:06:19.572  INFO 6589 --- [           main] com.dcssn.WeianApplicationTests          : Started WeianApplicationTests in 19.894 seconds (JVM running for 21.16)
测试成功
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.232 sec - in com.dcssn.WeianApplicationTests
2017-08-16 10:06:19.729  INFO 6589 --- [       Thread-6] o.s.w.c.s.GenericWebApplicationContext   : Closing org.springframework.web.context.support.GenericWebApplicationContext@64711bf2: startup date [Wed Aug 16 10:06:02 UTC 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@f1da57d
2017-08-16 10:06:19.754  INFO 6589 --- [       Thread-6] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2017-08-16 10:06:19.768  INFO 6589 --- [       Thread-6] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[JENKINS] Recording test results

[INFO] 
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ weian ---
[INFO] Building jar: /var/jenkins_home/workspace/weian/target/weian-0.0.1-SNAPSHOT.jar

[INFO] 
[INFO] --- spring-boot-maven-plugin:1.5.2.RELEASE:repackage (default) @ weian ---

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.755 s
[INFO] Finished at: 2017-08-16T10:06:27Z
[INFO] Final Memory: 39M/111M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /var/jenkins_home/workspace/weian/pom.xml to com.dcssn/weian/0.0.1-SNAPSHOT/weian-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /var/jenkins_home/workspace/weian/target/weian-0.0.1-SNAPSHOT.jar to com.dcssn/weian/0.0.1-SNAPSHOT/weian-0.0.1-SNAPSHOT.jar
channel stopped
[Docker] INFO: removed container id weian-container

[Docker] INFO: Removed image weian
[Docker] INFO: Creating docker image from /var/jenkins_home/workspace/weian/Dockerfile

[Docker] INFO: BuildResponseItem[stream=Step 1/5 : FROM java:8
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream= ---> d23bdf5b1b1b
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream=Step 2/5 : VOLUME /tmp
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream= ---> Running in cafc44b3c627
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]

[Docker] INFO: BuildResponseItem[stream= ---> 02359bf51528
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream=Removing intermediate container cafc44b3c627
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream=Step 3/5 : ADD target/weian-0.0.1-SNAPSHOT.jar app.jar
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]

[Docker] INFO: BuildResponseItem[stream= ---> 8957939da01c
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream=Step 4/5 : ENV JAVA_OPTS ""
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream= ---> Running in 266c5d845c71
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]

[Docker] INFO: BuildResponseItem[stream= ---> b750ab45831d
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream=Removing intermediate container 266c5d845c71
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream=Step 5/5 : ENTRYPOINT sh -c java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]

[Docker] INFO: BuildResponseItem[stream= ---> Running in acddadef7e38
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]

[Docker] INFO: BuildResponseItem[stream= ---> 99bb603a0c3d
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream=Removing intermediate container acddadef7e38
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream=,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=ResponseItem.AuxDetail[size=,tag=,digest=]]
[Docker] INFO: BuildResponseItem[stream=Successfully built 99bb603a0c3d
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: BuildResponseItem[stream=Successfully tagged weian:latest
,status=,progressDetail=,progress=,id=,from=,time=,errorDetail=,error=,aux=]
[Docker] INFO: Build image id:99bb603a0c3d
[Docker] INFO: set portBindings: 8080:80
[Docker] INFO: created container id 23cd83765e9169d61ec18631b3ac027017ea8ff5e22025f701673914d1d01289 (from image weian)

[Docker] INFO: started container id 23cd83765e9169d61ec18631b3ac027017ea8ff5e22025f701673914d1d01289
Finished: SUCCESS

完成。自动集成确实省时间,之前都是把jar包上传到服务器上,由于带宽限制上传就需要5-6分钟,还要手动执行docker的命令。自动也就需要1分钟就完成了。



此次模拟的站点是www.dcssn.com

此次模拟的站点是www.dcssn.com 点击查看: 防火布,

你可能感兴趣的:(springboot,jenkins+git,持续集成构建部署)