Files
api-extranetwork/.drone.yml
2026-05-13 14:54:27 +03:00

51 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

kind: pipeline
type: docker
name: api-extranetwork-test-deploy
trigger:
branch:
- test
event:
- push
steps:
- name: deploy-to-test-server
image: appleboy/drone-ssh
settings:
host: 178.105.136.25
username:
from_secret: DEPLOY_USER
key:
from_secret: DEPLOY_SSH_KEY
port: 22
command_timeout: 20m
script:
- set -e
- echo "TEST deploy başladı - $(date)"
- whoami
- hostname
- cd /opt/docker/projects/api.extranetwork.com
- echo "Test branch güncelleniyor..."
- git fetch origin test
- git checkout test
- git reset --hard origin/test
- echo "Docker test container build/up başlıyor..."
- docker compose -f docker-compose.prod.yml up -d --build --remove-orphans
- echo "Permission fix çalışıyor..."
- docker compose -f docker-compose.prod.yml exec -T app bash -lc "cd /var/www/html && mkdir -p storage/framework/cache/data storage/framework/sessions storage/framework/views storage/logs bootstrap/cache /home/uploads && chmod -R 777 storage bootstrap/cache /home/uploads"
- echo "Cache temizleniyor..."
- docker compose -f docker-compose.prod.yml exec -T app php artisan config:clear || true
- docker compose -f docker-compose.prod.yml exec -T app php artisan cache:clear || true
- docker compose -f docker-compose.prod.yml exec -T app php artisan route:clear || true
- docker compose -f docker-compose.prod.yml exec -T app php artisan view:clear || true
- echo "Container durumu:"
- docker compose -f docker-compose.prod.yml ps
- echo "TEST deploy tamamlandı - $(date)"