|
@@ -2,7 +2,7 @@ pipeline {
|
|
|
agent any
|
|
agent any
|
|
|
|
|
|
|
|
environment {
|
|
environment {
|
|
|
- DEPLOY_SERVER = "greentech@101.200.76.30"
|
|
|
|
|
|
|
+ DEPLOY_SERVER = "greentech@39.105.38.31"
|
|
|
DEPLOY_REPO_PATH = "/home/greentech/services/ultrafiltration_model"
|
|
DEPLOY_REPO_PATH = "/home/greentech/services/ultrafiltration_model"
|
|
|
HARBOR_URL = "172.16.0.165:5000/simulations"
|
|
HARBOR_URL = "172.16.0.165:5000/simulations"
|
|
|
IMAGE_NAME = "ultrafiltration_model"
|
|
IMAGE_NAME = "ultrafiltration_model"
|
|
@@ -20,12 +20,12 @@ pipeline {
|
|
|
stage('拉取代码') {
|
|
stage('拉取代码') {
|
|
|
steps {
|
|
steps {
|
|
|
withCredentials([usernamePassword(
|
|
withCredentials([usernamePassword(
|
|
|
- credentialsId: 'gpu2key',
|
|
|
|
|
|
|
+ credentialsId: 'gpu1key',
|
|
|
usernameVariable: 'USER',
|
|
usernameVariable: 'USER',
|
|
|
passwordVariable: 'PWD'
|
|
passwordVariable: 'PWD'
|
|
|
)]) {
|
|
)]) {
|
|
|
sh """
|
|
sh """
|
|
|
- sshpass -p '$PWD' ssh -o StrictHostKeyChecking=no $USER@101.200.76.30 "
|
|
|
|
|
|
|
+ sshpass -p '$PWD' ssh -o StrictHostKeyChecking=no $USER@39.105.38.31 "
|
|
|
cd ${DEPLOY_REPO_PATH} &&
|
|
cd ${DEPLOY_REPO_PATH} &&
|
|
|
git pull origin ${APP_GIT_BRANCH}
|
|
git pull origin ${APP_GIT_BRANCH}
|
|
|
"
|
|
"
|
|
@@ -39,12 +39,12 @@ pipeline {
|
|
|
script {
|
|
script {
|
|
|
def gitCommitShort = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
|
|
def gitCommitShort = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
|
|
|
withCredentials([usernamePassword(
|
|
withCredentials([usernamePassword(
|
|
|
- credentialsId: 'gpu2key',
|
|
|
|
|
|
|
+ credentialsId: 'gpu1key',
|
|
|
usernameVariable: 'USER',
|
|
usernameVariable: 'USER',
|
|
|
passwordVariable: 'PWD'
|
|
passwordVariable: 'PWD'
|
|
|
)]) {
|
|
)]) {
|
|
|
sh """
|
|
sh """
|
|
|
- sshpass -p '$PWD' ssh -o StrictHostKeyChecking=no $USER@101.200.76.30 "
|
|
|
|
|
|
|
+ sshpass -p '$PWD' ssh -o StrictHostKeyChecking=no $USER@39.105.38.31 "
|
|
|
cd ${DEPLOY_REPO_PATH} &&
|
|
cd ${DEPLOY_REPO_PATH} &&
|
|
|
export HARBOR_URL=${HARBOR_URL} &&
|
|
export HARBOR_URL=${HARBOR_URL} &&
|
|
|
export IMAGE_NAME=${IMAGE_NAME} &&
|
|
export IMAGE_NAME=${IMAGE_NAME} &&
|
|
@@ -58,18 +58,18 @@ pipeline {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- stage('部署到测试环境') {
|
|
|
|
|
|
|
+ stage('部署到生产环境') {
|
|
|
steps {
|
|
steps {
|
|
|
script {
|
|
script {
|
|
|
def gitCommitShort = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
|
|
def gitCommitShort = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
|
|
|
|
|
|
|
|
withCredentials([usernamePassword(
|
|
withCredentials([usernamePassword(
|
|
|
- credentialsId: 'gpu2key',
|
|
|
|
|
|
|
+ credentialsId: 'gpu1key',
|
|
|
usernameVariable: 'USER',
|
|
usernameVariable: 'USER',
|
|
|
passwordVariable: 'PWD'
|
|
passwordVariable: 'PWD'
|
|
|
)]) {
|
|
)]) {
|
|
|
sh """
|
|
sh """
|
|
|
- sshpass -p '$PWD' ssh -o StrictHostKeyChecking=no $USER@101.200.76.30 "
|
|
|
|
|
|
|
+ sshpass -p '$PWD' ssh -o StrictHostKeyChecking=no $USER@39.105.38.31 "
|
|
|
export GIT_COMMIT_SHORT=${gitCommitShort}
|
|
export GIT_COMMIT_SHORT=${gitCommitShort}
|
|
|
cd ${DEPLOY_REPO_PATH} &&
|
|
cd ${DEPLOY_REPO_PATH} &&
|
|
|
docker compose pull && docker compose up -dV
|
|
docker compose pull && docker compose up -dV
|