運維筆記-Linux下Jenkins部署指南

Fork me on Gitee

HDIS-Framework

fork star

HDIS-Framework是一個基於SpringBoot、Kubernetes、阿里雲服務,編寫的一個用於支撐微服務的極速開發框架。

其文檔詳盡,Demo全面,設計合理,開箱即用,節省開發時間,提升開發效率。

配套的docker、Kubernetes教程已踩過各種坑,讓你的微服務無障礙的順暢運行起來。

HDIS與Kubernetes或SpringCloud配合使用,能達到最佳效果。

運維筆記-Linux下Jenkins部署指南

前提條件

需要安裝Maven

需要安裝Docker

需要安裝GIT

docker構建

構建命令(例)

#!/bin/sh -l
cd ${WORKSPACE}
mvn clean package
cp Dockerfile ./target
cd target
docker stop wowgo-service-business|| echo "continue execute"
docker rm wowgo-service-business|| echo "continue execute"
docker rmi wowgo-service-business|| echo "continue execute"
docker build -t wowgo-service-business --build-arg FILE_PATH=Application.jar ./ || echo "continue execute"
docker run --name wowgo-service-business -d -p 8080:8080 wowgo-service-business|| echo "continue execute"

k8s微服務構建

jar構建命令(例)

#!/bin/sh -l
cd ${WORKSPACE}
mvn clean package
cp Dockerfile ./target
cd target
docker rmi registry.cn-hangzhou.aliyuncs.com/15928745302/wowgo-service-business || echo "continue execute"
docker build -t registry.cn-hangzhou.aliyuncs.com/15928745302/wowgo-service-business --build-arg FILE_PATH=Application.jar ./ || echo "continue execute"
docker login [email protected] registry.cn-hangzhou.aliyuncs.com -p fuck2you
docker push registry.cn-hangzhou.aliyuncs.com/15928745302/wowgo-service-business
kubectl --kubeconfig /root/.kube/config delete pod -l app=wowgo-service-business -n wowgo-develop

nginx構建命令(例)

#!/bin/sh -l
cd ${WORKSPACE}
docker rmi registry.cn-hangzhou.aliyuncs.com/15928745302/wowgo-service-business || echo "continue execute"
docker build -t registry.cn-hangzhou.aliyuncs.com/15928745302/wowgo-service-business --build-arg FILE_PATH=./ ./ || echo "continue execute"
docker login [email protected] registry.cn-hangzhou.aliyuncs.com -p fuck2you
docker push registry.cn-hangzhou.aliyuncs.com/15928745302/wowgo-service-business
kubectl --kubeconfig /root/.kube/config delete pod -l app=wowgo-service-business -n wowgo-develop
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章