image: atlassian/default-image:3

pipelines:
  branches:
    develop:
      - step:
          name: Deploy to develop
          deployment: develop
          script:
            - pipe: atlassian/ssh-run:0.4.0
              variables:
                SSH_USER: $SERVER_USER
                SERVER: $SERVER_IP
                COMMAND: |
                  ssh-keyscan -H $SERVER_IP >> ~/.ssh/known_hosts
                  set -e
                  cd /var/www/jawwal/
                  git pull origin develop
                  export COMPOSER_ALLOW_SUPERUSER=1
                  composer install --dry-run
                  composer install
                  php artisan migrate --pretend
                  php artisan migrate
  