Search code examples
laraveldeploymentdigital-oceanforgelaravel-forge

Open URL after deployment with Laravel Forge + Digital Ocean


I am using Laravel Forge + Digital Ocean to deploy my website from github.

I changed my deployment script a little

cd /home/forge/default
git pull origin dev
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate:refresh --force --seed
xdg-open http://url-to-my-domain.com/page-performs-release-tasks

Deployment is ok when i leave out the last line (xdg-open). When i paste the last line back the error shows:

/home/forge/.forge/provision-4912400.sh: line 7: kde-open: command not found

All types i tried give the same error

  • xdg-open
  • gnome-open
  • exo-open
  • gvfs-open
  • kde-open

What should i put in the deployment script to open a web page in a random browser (and automaticly close it)?


Solution

  • The server has no display. You would have to run a browser on your computer that connects to your server.

    You could install something like lynx, which is a console based browser, if you need a browser on your server.

    It might be better to take the functionality of this URL you want to hit and put it into an artisan command and execute that instead.