代码拉取完成,页面将自动刷新
pipeline {
agent {
node {
label 'nodejs'
}
}
environment {
GIT_CREDENTIAL_ID = 'cac-java-git-id'
DOCKER_CREDENTIAL_ID = 'cachub'
KUBECONFIG_CREDENTIAL_ID = 'cac-kubeconfig-id'
GIT_URL = 'http://172.31.146.73:9090/front/cac-website.git'
REGISTRY = 'registry.cn-chengdu.aliyuncs.com'
DOCKER_NAMESPACE = 'cac-k8s'
K8S_PROJECTNAME = 'cac'
DOCKER_IMAGE_TAG = 'v1'
PROJECTNAME = 'cac-h5'
}
stages {
stage('编译') {
steps {
git(url: 'http://172.31.146.73:9090/front/cac-website.git', credentialsId: "$GIT_CREDENTIAL_ID", branch: 'main', changelog: true, poll: false)
container('nodejs') {
}
}
}
stage('部署') {
steps {
container('nodejs') {
withCredentials([
usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,),
kubeconfigFile(credentialsId: env.KUBECONFIG_CREDENTIAL_ID,variable: 'KUBECONFIG')]) {
sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY/$DOCKER_NAMESPACE -u "$DOCKER_USERNAME" --password-stdin'
sh 'source ./deploy.sh'
}
}
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。