<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Springboot on 翟志军 Jack Zhai</title>
    <link>https://showme.codes/tags/springboot/</link>
    <description>Recent content in Springboot on 翟志军 Jack Zhai</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <copyright>showme.codes</copyright>
    <lastBuildDate>Wed, 15 May 2019 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://showme.codes/tags/springboot/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>使用 Jenkins &#43; Ansible 实现 Springboot 自动化部署101</title>
      <link>https://showme.codes/zh-cn/2019-05-15-jenkins-ansible-springboot/</link>
      <pubDate>Wed, 15 May 2019 00:00:00 +0000</pubDate>
      <guid>https://showme.codes/zh-cn/2019-05-15-jenkins-ansible-springboot/</guid>
      <description>&lt;p&gt;&lt;img alt=&#34;image.png&#34; loading=&#34;lazy&#34; src=&#34;https://showme.codes/assets/images/292372-3d64f9fe7b80ed98.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;本文要点：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;设计一条 Springboot 最基本的流水线：包括构建、制品上传、部署。&lt;/li&gt;
&lt;li&gt;使用 Docker 容器运行构建逻辑。&lt;/li&gt;
&lt;li&gt;自动化整个实验环境：包括 Jenkins 的配置，Jenkins slave 的配置等。&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;1-代码仓库安排&#34;&gt;1. 代码仓库安排&lt;/h3&gt;
&lt;p&gt;本次实验涉及以下多个代码仓库：&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;% tree -L 1
├── 1-cd-platform # 实验环境相关代码
├── 1-env-conf # 环境配置代码-实现配置独立
└── 1-springboot # Springboot 应用的代码及其部署代码
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;1-springboot 的目录结构如下：&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;% cd 1-springboot
% tree -L 1 
├── Jenkinsfile # 流水线代码
├── README.md
├── deploy # 部署代码
├── pom.xml 
└── src # 业务代码
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;所有代码，均放在 GitHub: &lt;a href=&#34;https://github.com/cd-in-practice&#34;&gt;https://github.com/cd-in-practice&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;2-实验环境准备&#34;&gt;2. 实验环境准备&lt;/h3&gt;
&lt;p&gt;笔者使用 Docker Compose + Vagrant 进行实验。环境包括以下几个系统：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Jenkins * 1
Jenkins master，全自动安装插件、默认用户名密码：admin/admin。&lt;/li&gt;
&lt;li&gt;Jenkins agent * 2
Jenkins agent 运行在 Docker 容器中，共启动两个。&lt;/li&gt;
&lt;li&gt;Artifactory * 1
一个商业版的制品库。笔者申请了一个 30 天的商业版。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;使用 Vagrant  是为了启动虚拟机，用于部署 Springboot 应用。如果你的开发机器无法使用 Vagrant，使用 VirtualBox 也可以达到同样的效果。但是有一点需要注意，那就是网络。如果在虚拟机中要访问 Docker 容器内提供的服务，需要在 DNS 上或者 hosts 上做相应的调整。所有的虚拟机的镜像使用 Centos7。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
