Sync Script + Homestead/Bedrock + Forge

Hello everyone,

I am experimenting a bit with Laravel Forge and Homestead. I have been working with Sync Script under a Trellis environment and it worked perfectly. So now I am trying to do the same with an Homestead/Forge system and I can’t seem to establish a connection with the production server under Forge.

wp-cli.yml

path: web/wp
server:
  docroot: web

@development:
  ssh: vagrant@test.cedilla.test/srv/www/test/current
@staging:
  ssh: web@staging.test.cedilla.io/srv/www/test.cedilla.io/current
@production:
  ssh: web@test.cedilla.io/srv/www/test.cedilla.io/current

sync.sh

DEVDIR="web/app/uploads/"
DEVSITE="http://test.cedilla.test"

PRODDIR="web@test.cedilla.io:/srv/www/test.cedilla.io/shared/uploads/"
PRODSITE="https://test.cedilla.io"

STAGDIR="web@staging.test.cedilla.io:/srv/www/test.cedilla.io/shared/uploads/"
STAGSITE="https://staging.test.cedilla.io"

Does anyone knows the correct production path for an Homestead/Forge production server? Is it different from Trellis? Or am I doing something obviously wrong?

Thanks a lot!

I figured out the path for a Forge / Bedrock / Homestead install. I needed to specify the home/forge directories and use the “forge” user automatically generated by Forge that was also being assigned a SSH key in my dashboard options.

@development:
  ssh: vagrant@example-folder-name/srv/www/example-folder-name/current
@staging:
  ssh: forge@staging.example.com/home/forge/staging.example.com/

Running both wp @development and wp @staging are succesful in these conditions.

BUT when I try to use the script itself, let’s say ./sync.sh staging development, I get:

:white_check_mark: Able to connect to staging
:x: Unable to connect to development

Vagrant ssh works, wp @development is still good. I did reprovision my VM and I also tried to reset my known hosts file.

I’m out of ideas, so if anyone can suggest me something it would be gladly appreciated. Once again, pardon my ignorance and thanks a lot.

I got it (thanks to Patrick)

wp-cli.yml

path: web/wp
server:
  docroot: web

@development:
  ssh: vagrant@cedilla/home/vagrant/code
@production:
  ssh: forge@cedilla.io/home/forge/cedilla.io/

sync.sh

DEVDIR="web/app/uploads/"
DEVSITE="https://cedilla.test"

PRODDIR="forge@cedilla.io:/home/forge/cedilla.io/web/app/uploads/"
PRODSITE="https://cedilla.io"
1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.