From 37027bf0682c968ee8d7ed2e42fa8dc78c1e2a64 Mon Sep 17 00:00:00 2001 From: lewis_yan Date: Tue, 31 Mar 2026 19:23:42 +0800 Subject: [PATCH] chore: remove deploy stage, only build and push to Harbor --- backend/Jenkinsfile | 25 +------------------------ web/Jenkinsfile | 25 +------------------------ 2 files changed, 2 insertions(+), 48 deletions(-) diff --git a/backend/Jenkinsfile b/backend/Jenkinsfile index 95581e8..8e59d25 100644 --- a/backend/Jenkinsfile +++ b/backend/Jenkinsfile @@ -5,10 +5,7 @@ pipeline { HARBOR_URL = '192.168.80.90:8090' HARBOR_PROJECT = 'pis' IMAGE_NAME = 'pis-backend' - SERVER_HOST = '192.168.80.90' - COMPOSE_PATH = '/mnt/data/pis' CREDENTIALS_ID = 'harbor-credentials' - SSH_CREDENTIALS_ID = 'server-ssh-key' } stages { @@ -48,26 +45,6 @@ pipeline { } } } - - stage('Deploy') { - steps { - script { - withCredentials([usernamePassword( - credentialsId: 'server-ssh-creds', - usernameVariable: 'SSH_USER', - passwordVariable: 'SSH_PASS' - )]) { - sh """ - sshpass -p "${SSH_PASS}" ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SERVER_HOST} << 'EOF' - cd ${COMPOSE_PATH} - docker-compose pull pis-backend - docker-compose up -d --no-deps pis-backend - EOF - """ - } - } - } - } } post { @@ -75,7 +52,7 @@ pipeline { echo "Backend Pipeline failed! Check Jenkins logs." } success { - echo "Backend deployed successfully!" + echo "Backend image pushed to Harbor: ${IMAGE_TAG}" } } } diff --git a/web/Jenkinsfile b/web/Jenkinsfile index c0acde6..de32cca 100644 --- a/web/Jenkinsfile +++ b/web/Jenkinsfile @@ -5,10 +5,7 @@ pipeline { HARBOR_URL = '192.168.80.90:8090' HARBOR_PROJECT = 'pis' IMAGE_NAME = 'pis-web' - SERVER_HOST = '192.168.80.90' - COMPOSE_PATH = '/mnt/data/pis' CREDENTIALS_ID = 'harbor-credentials' - SSH_CREDENTIALS_ID = 'server-ssh-key' } stages { @@ -64,26 +61,6 @@ pipeline { } } } - - stage('Deploy') { - steps { - script { - withCredentials([usernamePassword( - credentialsId: 'server-ssh-creds', - usernameVariable: 'SSH_USER', - passwordVariable: 'SSH_PASS' - )]) { - sh """ - sshpass -p "${SSH_PASS}" ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SERVER_HOST} << 'EOF' - cd ${COMPOSE_PATH} - docker-compose pull pis-web - docker-compose up -d --no-deps pis-web - EOF - """ - } - } - } - } } post { @@ -91,7 +68,7 @@ pipeline { echo "Frontend Pipeline failed! Check Jenkins logs." } success { - echo "Frontend deployed successfully!" + echo "Frontend image pushed to Harbor: ${IMAGE_TAG}" } } }