修复开发部署 SSH 指纹读取
This commit is contained in:
Vendored
+3
-1
@@ -4,6 +4,7 @@ pipeline {
|
||||
environment {
|
||||
DEVELOPMENT_SSH_TARGET = 'deploy@172.31.198.8'
|
||||
DEVELOPMENT_SSH_KEY = '/var/jenkins_home/.ssh/dev_deploy'
|
||||
DEVELOPMENT_SSH_KNOWN_HOSTS = '/var/jenkins_home/.ssh/known_hosts'
|
||||
DEVELOPMENT_DEPLOY_DIR = '/opt/firstleg/frontend/admin-web'
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ pipeline {
|
||||
sh '''
|
||||
set -eu
|
||||
image="admin-web-development:${SOURCE_TAG}"
|
||||
ssh_args="-i ${DEVELOPMENT_SSH_KEY} -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=10"
|
||||
ssh_args="-i ${DEVELOPMENT_SSH_KEY} -o BatchMode=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=${DEVELOPMENT_SSH_KNOWN_HOSTS} -o ConnectTimeout=10"
|
||||
|
||||
docker build \
|
||||
--build-arg VITE_CLIENT_WEB_URL=http://8.163.49.32:9002 \
|
||||
@@ -82,6 +83,7 @@ REMOTE
|
||||
sh '''
|
||||
if [ "${IS_DEVELOPMENT:-false}" = "true" ]; then
|
||||
ssh -i "$DEVELOPMENT_SSH_KEY" -o BatchMode=yes -o StrictHostKeyChecking=yes \
|
||||
-o UserKnownHostsFile="$DEVELOPMENT_SSH_KNOWN_HOSTS" \
|
||||
"$DEVELOPMENT_SSH_TARGET" 'docker logs --tail=100 admin-web-development || true' || true
|
||||
else
|
||||
docker compose -f docker-compose.test.yml logs --tail=100 || true
|
||||
|
||||
Reference in New Issue
Block a user