Add Dockerfile and Jenkinsfile

This commit is contained in:
2026-05-19 00:05:03 +01:00
parent 53f36d0ac7
commit 8fdf930ae9
3 changed files with 72 additions and 0 deletions

54
platform/Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,54 @@
pipeline {
agent any
stages {
stage('Checkout') {
steps {
echo 'Code checked out'
}
}
stage('Install Dependencies') {
steps {
sh '''
cd platform
python3 -m venv venv
venv/bin/pip install -r requirements.txt --quiet
'''
}
}
stage('Test') {
steps {
sh '''
cd platform
echo "Running basic syntax check..."
venv/bin/python -m py_compile app.py && echo "✅ app.py syntax OK"
'''
}
}
stage('Deploy to Server 1') {
steps {
sh '''
cp -r platform/* /root/management-platform/
cd /root/management-platform
venv/bin/pip install -r requirements.txt --quiet 2>/dev/null || true
systemctl restart management-platform
sleep 4
systemctl is-active --quiet management-platform && echo "✅ Deployed OK" || exit 1
'''
}
}
}
post {
success {
echo '✅ Pipeline succeeded — platform deployed'
}
failure {
echo '❌ Pipeline failed — old version still running'
}
}
}