image: atlassian/default-image:latest

options:
  runtime:
    cloud:
      atlassian-ip-ranges: true


pipelines:
  branches:
    development:
      - step:
          name: Deploy on Development
          size: 4x
          deployment: Development
          script:
            - ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP echo "Starting Deployment"
            - ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "cd /var/www/html/klizos_attendance_new && git reset --hard && git clean -fd && git checkout development && git pull"
            - ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "cd /var/www/html/klizos_attendance_new && php artisan cache:clear"
            - ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "cd /var/www/html/klizos_attendance_new && php artisan optimize:clear"
            - ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "sudo systemctl restart apache2"
            - echo "Deployment finished successfully!"

