jenkins流水线

1.拉取代码

csharp 复制代码
https://gitee.com/Wjc_project/yygh-parent.git

2、项目编译

csharp 复制代码
mvn clean package -Dmaven.test.skip=true
ls hospital-manage/target

3、构建镜像

csharp 复制代码
ls hospital-manage/target
docker build -t hospital-manage:latest -f hospital-manage/Dockerfile ./hospital-manage/

ls server-gateway/target
docker build -t server-gateway:latest -f server-gateway/Dockerfile ./server-gateway/

ls service/service-cmn/target
docker build -t service-cmn:latest -f service/service-cmn/Dockerfile ./service/service-cmn/

ls service/service-hosp/target
docker build -t service-hosp:latest -f service/service-hosp/Dockerfile ./service/service-hosp/

ls service/service-order/target
docker build -t service-order:latest -f service/service-order/Dockerfile ./service/service-order/

ls service/service-oss/target
docker build -t service-oss:latest -f service/service-oss/Dockerfile ./service/service-oss/

ls service/service-sms/target
docker build -t service-sms:latest -f service/service-sms/Dockerfile ./service/service-sms/

ls service/service-statistics/target
docker build -t service-statistics:latest -f service/service-statistics/Dockerfile ./service/service-statistics/

ls service/service-task/target
docker build -t service-task:latest -f service/service-task/Dockerfile ./service/service-task/

ls service/service-user/target
docker build -t service-user:latest -f service/service-user/Dockerfile ./service/service-user/

4、镜像推送

csharp 复制代码
echo "$DOCKER_PWD_VAR" | docker login $REGISTRY -u "$DOCKER_USER_VAR" --password-stdin

docker tag hospital-manage:latest $REGISTRY/$DOCKERHUB_NAMESPACE/hospital-manage:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/hospital-manage:SNAPSHOT-$BUILD_NUMBER

docker tag server-gateway:latest $REGISTRY/$DOCKERHUB_NAMESPACE/server-gateway:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/server-gateway:SNAPSHOT-$BUILD_NUMBER

docker tag service-cmn:latest $REGISTRY/$DOCKERHUB_NAMESPACE/service-cmn:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/service-cmn:SNAPSHOT-$BUILD_NUMBER

docker tag service-hosp:latest $REGISTRY/$DOCKERHUB_NAMESPACE/service-hosp:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/service-hosp:SNAPSHOT-$BUILD_NUMBER

docker tag service-order:latest $REGISTRY/$DOCKERHUB_NAMESPACE/service-order:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/service-order:SNAPSHOT-$BUILD_NUMBER

docker tag service-oss:latest $REGISTRY/$DOCKERHUB_NAMESPACE/service-oss:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/service-oss:SNAPSHOT-$BUILD_NUMBER

docker tag service-sms:latest $REGISTRY/$DOCKERHUB_NAMESPACE/service-sms:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/service-sms:SNAPSHOT-$BUILD_NUMBER

docker tag service-statistics:latest $REGISTRY/$DOCKERHUB_NAMESPACE/service-statistics:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/service-statistics:SNAPSHOT-$BUILD_NUMBER

docker tag service-task:latest $REGISTRY/$DOCKERHUB_NAMESPACE/service-task:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/service-task:SNAPSHOT-$BUILD_NUMBER

docker tag service-user:latest $REGISTRY/$DOCKERHUB_NAMESPACE/service-user:SNAPSHOT-$BUILD_NUMBER

docker push $REGISTRY/$DOCKERHUB_NAMESPACE/service-user:SNAPSHOT-$BUILD_NUMBER

5、部署dev环境

csharp 复制代码
"$KUBECONFIG_CREDENTIAL_ID"

hospital-manage/deploy/**
server-gateway/deploy/**
service/service-cmn/deploy/**
service/service-hosp/deploy/**
service/service-order/deploy/**
service/service-oss/deploy/**
service/service-sms/deploy/**
service/service-statistics/deploy/**
service/service-task/deploy/**
service/service-user/deploy/**

6、发送确认邮件

相关推荐
q***614117 分钟前
Spring中Aware的用法以及实现
java·数据库·spring
代码or搬砖38 分钟前
SpringMVC的执行流程
java·spring boot·后端
大柏怎么被偷了1 小时前
【Linux】进程等待
linux·运维·服务器
Appreciate(欣赏)1 小时前
JAVA使用poi类读取xlxs文件内容拼接成添加数据SQL
java·开发语言·sql
极光代码工作室1 小时前
基于SpringBoot的流浪狗管理系统的设计与实现
java·spring boot·后端
毕设源码-朱学姐1 小时前
【开题答辩全过程】以 基于JAVA的恒星酒店客房管理系统为例,包含答辩的问题和答案
java·开发语言
思密吗喽2 小时前
景区行李寄存管理系统
java·开发语言·spring boot·毕业设计·课程设计
star_11122 小时前
Jenkins部署后端springboot微服务项目
spring boot·微服务·jenkins
云和数据.ChenGuang2 小时前
运维面试题之oracle和mysql单表最大容量
运维·mysql·oracle
gladiator+2 小时前
Redis之BigKey的常见问题以及大厂相关面试题
java·数据库·redis