init full backend repo with src + deploy config

This commit is contained in:
2025-07-15 11:37:42 +08:00
commit 8dc1824603
24 changed files with 825 additions and 0 deletions

33
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,33 @@
pipeline {
agent any
environment {
SSH_CREDENTIALS_ID = 'alex-ssh-key'
REMOTE_HOST = '117.72.202.202'
REMOTE_USER = 'alex'
REMOTE_DIR = '/home/alex/alex-api'
}
stages {
stage('Build') {
steps {
sh 'mvn clean package -DskipTests'
}
}
stage('Deploy') {
steps {
sshagent([env.SSH_CREDENTIALS_ID]) {
sh """
scp target/alex-api-0.0.1-SNAPSHOT.jar ${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_DIR}/app/
ssh ${REMOTE_USER}@${REMOTE_HOST} '
cd ${REMOTE_DIR} &&
docker compose down &&
docker compose up -d --build
'
"""
}
}
}
}
}