2 Commits
Author SHA1 Message Date
backdev 8b6f0f1072 Merge pull request 'NCBACK-9' (#7) from NCBACK-9 into dev
Test Workflow / test (push) Successful in 3s
Reviewed-on: #7
2025-12-17 13:41:27 +08:00
vladp 07aad9f51c return good piplne
Test Workflow / test (push) Has been cancelled
2025-12-13 01:52:53 +07:00
+11 -8
View File
@@ -96,7 +96,7 @@ pipeline {
elif [ -f 'docker-compose.yml' ]; then
docker-compose -f docker-compose.yml build
else
echo 'Exception:don't found docker-compose'
echo 'Exception: docker-compose file not found'
exit 1
fi
"
@@ -120,6 +120,9 @@ pipeline {
sshpass -p '$SSH_PASS' ssh $SSH_USER@92.242.61.23 "
cd /opt/deployments/frontend/${params.BRANCH}
# Проверяем и подключаем к сети app-network если нужно
docker network inspect app-network 2>/dev/null || echo 'Warning: app-network not found'
if [ -f 'docker-compose.yaml' ]; then
docker-compose -f docker-compose.yaml up -d
elif [ -f 'docker-compose.yml' ]; then
@@ -150,16 +153,16 @@ pipeline {
sh """
sshpass -p '$SSH_PASS' ssh $SSH_USER@92.242.61.23 "
if docker ps --format '{{.Names}}' | grep -q 'no-copy-frontend'; then
echo 'Container start'
echo 'Container started'
sleep 5
HTTP_CODE=\$(curl -s -o /dev/null -w '%{http_code}' http://localhost:2998 || echo '000')
echo 'HTTP код: ' \$HTTP_CODE
echo 'HTTP code: \$HTTP_CODE'
echo 'Frong start on http://92.242.61.23:2998'
echo 'Frontend available on http://92.242.61.23:2998'
else
echo 'Exception: container don't start'
echo 'Exception: container did not start'
docker ps -a | grep frontend
exit 1
fi
@@ -173,11 +176,11 @@ pipeline {
post {
success {
echo "Front branch ${params.BRANCH} completed"
echo "Use on http://92.242.61.23:2998"
echo "Front branch ${params.BRANCH} deployment completed"
echo "Frontend available on http://92.242.61.23:2998"
}
failure {
echo "Failed"
echo "Deployment failed"
}
}
}