ADD: sites and architecture module fix
This commit is contained in:
@@ -14,5 +14,6 @@ COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt flask psutil
|
||||
|
||||
COPY . .
|
||||
EXPOSE 8000
|
||||
|
||||
EXPOSE 5000
|
||||
CMD ["python", "app.py"]
|
||||
22
platform/Jenkinsfile
vendored
22
platform/Jenkinsfile
vendored
@@ -21,15 +21,9 @@ pipeline {
|
||||
stage('Deploy to Server 1') {
|
||||
steps {
|
||||
sh '''
|
||||
# Sync Python modules to host path — docker run mounts this OVER the image
|
||||
# (new app.py in the image imports modules.sites etc.; host must stay in sync)
|
||||
mkdir -p /root/management-platform/modules
|
||||
cp -f ./platform/modules/*.py /root/management-platform/modules/
|
||||
echo "✅ Synced platform/modules → /root/management-platform/modules"
|
||||
|
||||
docker stop management-platform 2>/dev/null || true
|
||||
docker rm management-platform 2>/dev/null || true
|
||||
|
||||
docker rm management-platform 2>/dev/null || true
|
||||
|
||||
docker run -d \
|
||||
--name management-platform \
|
||||
--restart unless-stopped \
|
||||
@@ -40,16 +34,15 @@ pipeline {
|
||||
-v /etc/passwd:/etc/passwd:ro \
|
||||
-v /etc/shadow:/etc/shadow:ro \
|
||||
-v /root/management-platform/config.py:/app/config.py:ro \
|
||||
-v /root/management-platform/modules:/app/modules:ro \
|
||||
management-platform:latest
|
||||
|
||||
|
||||
sleep 5
|
||||
|
||||
|
||||
if docker ps | grep -q management-platform; then
|
||||
echo "✅ Deployed successfully"
|
||||
else
|
||||
echo "❌ Container failed to start"
|
||||
docker logs management-platform --tail=20
|
||||
docker logs management-platform --tail=30
|
||||
exit 1
|
||||
fi
|
||||
'''
|
||||
@@ -60,7 +53,6 @@ pipeline {
|
||||
steps {
|
||||
sh '''
|
||||
sleep 3
|
||||
# /login is public; / redirects and may not satisfy curl -f in all setups
|
||||
if curl -sf http://localhost:8088/login 2>/dev/null; then
|
||||
echo "✅ Platform responding on :8088"
|
||||
else
|
||||
@@ -74,10 +66,10 @@ pipeline {
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
success {
|
||||
echo '✅ Pipeline succeeded — platform deployed'
|
||||
}
|
||||
failure {
|
||||
failure {
|
||||
echo '❌ Pipeline failed — check logs'
|
||||
sh 'docker logs management-platform --tail=30 2>/dev/null || true'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user