1.拉取代码
https: / / gitee. com/ Wjc_project/ yygh- parent. git
2、项目编译
mvn clean package - Dmaven. test. skip= true
ls hospital- manage/ target
3、构建镜像
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、镜像推送
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环境
"$KUBECONFIG_CREDENTIAL_ID"
hospital- manage/ deploy
6、发送确认邮件