Jenkins---部署Spring Cloud项目

1.前期准备

1.1 环境准备

搭建docker,搭建k8s集群,
搭建maven私服Nexus,
搭建Harbor,
搭建Jenkins,并且系统配置已经配置k8s云
在这里插入图片描述
准备springCloud项目。

1.2 上传Maven仓库jar包到Nexus

参考之前的文章《Jenkins—批量上传Maven仓库jar包到Nexus》

2.SpringCloud项目框架

2.1Dockfile

用于构建docker镜像(每个需要构建的项目都需要配置,放在所在项目的根目录下)
在这里插入图片描述

2.2 pom文件

在root的pom文件添加以下内容

	<!--默认使用Nexus私服,避免连接国外的Maven仓库下载 -->
	<repositories>
		<repository>
			<id>nexus_public</id>
			<url>http://Nexus的ip:端口/repository/上传的目录/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>
	<!--默认使用Nexus私服 -->
	<pluginRepositories>
		<pluginRepository>
			<id>nexus_public</id>
			<url>http://Nexus的ip:端口/repository/上传的目录/</url>
			<releases>
				<enabled>true
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值