Deploying roots/sage with Trellis

I have setup roots/sage locally with bedrock and trellis.

Locally it is all working fine.

However i am quite uncertain about deploying to a server. I feel i’m editing files that are probably auto generated somewhere. I’ve tried various .yml files or .env.* files.

Firstly am i right in thinking

`yarn build:production`

will do this once setup?

Will this only send production files or will it send local database to a target database?

Example Domain

mydomain.org

If my production server details are —

serverIP
serveruser (root if needed?)
serverPass (perhaps not needed for ssh as have added my local key)
serverPort (we don't use standard ports)
targetDomain (using plesk so /var/www/vhost/mydomain.org/httpdocs)

Domains are attributed to users

targetDomainUser
targetDomainPasssword

If part of the deploy system —

Database
DatabaseUser
DatabasePassword

What file(s) do i add these too? Full paths much appreciated!

And what role does a git repo play in this if anything? I can see it is requested in production/wordpress_sites.yml files but not sure what for.

Massive thanks in advance. It will be great to get through this final hurdle. A bit overwhelmed by the config files and where they are.

To build and deploy Sage (or a similar theme) with Trellis, you use the build-before hook:

You can see this in use at https://github.com/roots/roots-example-project.com

Trellis deploys don’t touch/sync databases.

I’m not sure what you’re talking about with the rest of your post. You already have a Plesk server setup and you’re trying to use Trellis to deploy to it? Ideally Trellis is what is what runs your production server, too. You can reference https://roots.io/guides/deploying-to-kinsta-with-trellis/ and other posts on this forum for info on how you might be able to deploy to a non-Trellis server as long as the dependencies are met on it (Composer, WP-CLI, Git)

What do you mean by this? Have you read through the docs?

https://roots.io/trellis/docs/deploys/

1 Like

Thanks Ben - so yes it wasn’t clear to me that Trellis has to be on (or be) the server. I thought everything was about local development and then deployment of compiled production files.

I thought that once the connection to production was setup composer etc would be ran there installing what was needed.

If i’m not going to deploy to a Trellis server should i not use this setup in the first place?

I’ve looked through the docs and forum and can’t see anything solid for deploying to Plesk hence asking here. NPM, grunt & gulp methods were pretty easy to pickup and adapt. There seems to be a lot more going on here!

This post one seems to be the most likely but not knowing where exactly to run composer require florianmoser/plesk-deployer from makes debugging pretty tricky.
The poster Flumo isn’t active anymore. The repo hasn’t been touch in 2 years…

Regarding the repo info requested it was in production/wordpress_sites.yml. So i thought maybe that was a deployment method. Is this required in any of the */wordpress_sites.yml ?

Hi Daniel. I added a response to your question in the other thread.

The repo was touched last year only, because there weren’t any issues and I see no need for improvement. But I still successfully use these recipes for all my deployments to Plesk environments.

1 Like

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