1 Star 0 Fork 19

jifang/euler-copilot-web

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Jenkinsfile 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
吴肉桂 提交于 2025-01-15 18:04 +08:00 . dev
node {
properties([
parameters([
string(name: "REPO", defaultValue: "web-dev", description: "当前项目名")
])
])
echo "拉取代码仓库"
checkout scm
def BUILD = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
def reg = ""
withCredentials([string(credentialsId: "reg_host", variable: "REG_HOST")]) {
reg = "${REG_HOST}"
}
echo "构建当前分支Docker Image镜像"
docker.withRegistry("https://${reg}", "dockerAuth") {
def image = docker.build("${reg}/${params.REPO}:${BUILD}", "-f ./deploy/prod/Dockerfile .")
image.push()
}
def remote = [:]
remote.name = "machine"
withCredentials([string(credentialsId: "ssh_host", variable: "HOST")]) {
remote.host = "${HOST}"
}
withCredentials([usernamePassword(credentialsId: "ssh", usernameVariable: 'sshUser', passwordVariable: 'sshPass')]) {
remote.user = sshUser
remote.password = sshPass
}
remote.allowAnyHosts = true
echo "清除构建缓存"
sshCommand remote: remote, command: "sh -c \"docker rmi ${reg}/${params.REPO}:${BUILD} || true\";"
sshCommand remote: remote, command: "sh -c \"docker image prune -f || true\";";
sshCommand remote: remote, command: "sh -c \"docker builder prune -f || true\";";
echo "重新部署"
sshCommand remote: remote, command: "sh -c \"kubectl -n euler-copilot set image deployment/web-deploy web=${reg}/${params.REPO}:${BUILD}\";"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pipihugh/euler-copilot-web.git
git@gitee.com:pipihugh/euler-copilot-web.git
pipihugh
euler-copilot-web
euler-copilot-web
master

搜索帮助