1 Star 0 Fork 3.9K

Alex / pig-ui

forked from lengleng / pig-ui 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Jenkinsfile 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
Alex 提交于 2021-02-05 15:39 . ui
node('haimaxy-jnlp'){
stage("CheckOut"){
SERVER_NAME = "pig-ui"
HOME_DIR = "/home/jenkins/agent/workspace/${SERVER_NAME}"
VERSION = "v1.0.0"
IMAGE_NAME = "binguanghui/${SERVER_NAME}"
ALIYUN_CS = "registry.cn-hangzhou.aliyuncs.com"
HUB_PREFIX = "${ALIYUN_CS}/docker_part1"
echo "1.Check Out Sources Stage"
git credentialsId: 'gitee', url: 'https://gitee.com/bingh/pig-ui.git'
echo "last commit:"
sh "git log --pretty=format:\"%h %cd %an ==>%s\" | head -1"
}
stage('Install Dependence'){
echo "2.Install Dependence And Build"
sh '''
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install
'''
}
stage('Build') {
echo "3.Build Docker Image Stage"
sh "docker build -t ${IMAGE_NAME} ${HOME_DIR}"
}
stage("Docker Build Stage"){
echo "4.Push Docker Image Stage"
withCredentials([usernamePassword(credentialsId: 'aliyuncsHub', passwordVariable: 'aliyuncsHubPassword', usernameVariable: 'aliyuncsHubUser')]) {
sh "docker tag ${IMAGE_NAME} ${HUB_PREFIX}/${SERVER_NAME}:${VERSION}"
sh "docker login --username=${aliyuncsHubUser} --password=${aliyuncsHubPassword} ${ALIYUN_CS}"
sh "docker push ${HUB_PREFIX}/${SERVER_NAME}:${VERSION}"
}
}
stage('Deploy') {
echo "5.Deploy Stage"
sh "kubectl apply -f ${HOME_DIR}/pig-ui.yaml --record"
}
}
JavaScript
1
https://gitee.com/bingh/pig-ui.git
git@gitee.com:bingh/pig-ui.git
bingh
pig-ui
pig-ui
master

搜索帮助