Trellis deploy: Push instead Pull

The server being deployed to has to clone from a git repository, does this mean one has to set up a public facing git repository (or use something like Github) for the target server being able to clone from?

Is it also possible to allow pushing? Setting up a SSH tunnel for the target server to connect back to workstation and clone through?

That’s a good question. We have some details on that in our Deploy docs and more in SSH keys.

You can use a remote private repo through SSH forwarding :slight_smile:

1 Like

It would be a nice idea to have this built into the deploy.sh script,
an option that sets up an SSH tunnel to pull the repository from the workstation/ansible control system.

I use private github repos and SSH forwarding for every site I do; it works well!

It is also possible to first push to a git repository on target server and then pull from there during deploy.

There is another alternative: composer install the dependencies on the workstation instead on production and rsyncing the resolved folders to production. This also resembles a bit the approach when building a Docker image.