Deploy to Shared Hosting Environment

Hello,

I’m new to roots.io and try to use it in our Shared Hosting Environment.
Our Hosting Environment is build with LiveConfig and I have SSH Access for Webhosting User and also root user.

In our Case the Webhosting Root folder ist /var/www/webXXX/htdocs

If I try to deploy it to Staging “./deploy.sh staging domain.tld” I got the following error message:

TASK [deploy : Run npm install] ************************************************
fatal: [XX.XX.XX.XX]: FAILED! => {“changed”: false, “cmd”: “npm install”, “failed”: true, “msg”: “[Errno 2] No such file or directory”, “rc”: 2}

PLAY RECAP *********************************************************************
XX.XX.XX.XX : ok=13 changed=3 unreachable=0 failed=1
localhost : ok=0 changed=0 unreachable=0 failed=0

crazy Thing is, that if I try it on Server with WebXX User npm install it works…
in the Folder /var/www/webXXX/.npm I can see a lot of folders

Also what I find a little bit confusing is that
webXXX@host:~/htdocs/domain.tld$ ls
releases shared

there are 2 folders releases and shared is this normal?

Thanks for your help.
Br, Klaus

By default, Trellis will not run npm install during a deployment, are you using the build-before tasks in deploy hooks? Is the path of the theme correct in there?

Yes this is normal (there should actually be 3 folders and a symlink in there).

Trellis does what is called an atomic deployment whereby the server will git clone the latest code to a temporary folder, run composer install to grab its dependencies, move all of this to a new timestamped folder in the releases folder and then symlink current to this release. This means that your webserver should be pointing to /srv/www/example.com/current/web as this will always be the latest code and the folder that current points to will be updated on each successful deployment.

I can’t find any generic articles on Atomic deployments but this one from Deploybot goes over why you want this: http://deploybot.com/blog/deploy-complex-apps-with-atomic-sftp-deployments