Best way to deploy a project?

silverstripe-4
Tags: #<Tag:0x00007f10c83cef80>

#1

Silverstripe Version:
4.2.1

Question:
Up until now I’ve been deploying my SilverStripe site simply using FTP to upload the files to the host. I have a different .env file on my local copy to what is on the host and use vendor expose copy to ensure all relevant assets are updated. This is all well and good, except it can be quite tedious if I update the project or SilverStripe files as it’s then hard to keep the 2 copies nicely synchronised and uploading can be very slow.

I’m aware that there’s better deployment options out there, but I’m unsure which to choose or how to go about setting them up with minimal interruption to my current configuration. I don’t have a git repository, nor do I know how to set this up or if this is even the way to go?

Some advice on this would be greatly appreciated!


#2

I guess the first question is: Can you access your hosting environment via SSH?

If so, then the next question is probably: Are you currently using Composer (Composer – SilverStripe Documentation)?

At a bare minimum, using composer and then only syncing your project files to the server, then logging in via SSH and running composer install --no-dev will pull down all the project dependencies.

Beyond that, a lot of people now use deployer (https://deployer.org/) to automate pushing files to the server, running composer, dev/build, etc. But you will need a git repo to connect deployer to.

Hope that helps a bit…


#3

In my opinion the one best way to deploy a project is: You can signup for Cloudways as it provides the managed Amazon hosting which enables you to enjoy hassle-free hosting experience. It takes away all the pain of hosting and management of your web/app. Then, let Cloudways do the rest of the work.


#4

I use Beam GitHub - heyday/beam: A command line utility for deploying websites to servers


#5

I can tell this heavily depends on a lot of factors.

  • Hosting
  • Team size and structure
  • SDLC (the development practices you follow)
    • QA processes and development workflow
    • Continuous Integration / Continuous Deployment

As it’s been mentioned above, version control is very helpful for even one person team. E.g. even if you don’t want to rely on composer, might do a simple git pull, which would synchronize all the files for you with the repository. Either way, it’s important to have a single source of truth (usually that’s a main project repository).
When the team is growing, it may be worth considering to go for Continuous Integration / Continuous Deployment practices. In that case deployment would be automatically triggered by pushing to a particular branch in the project repository. In that case Continuous Integration platform would run the tests for you and then deploy to servers (could be using deployer there or maybe something else). This may be helpful even for 1 person team, depending on the development practices followed.
Surely, there are a lot of other ways to deal with deployments and most of them are suiting particular team workflows. For huge projects there could even be complex multi-step deployment pipelines with responsible team members reviewing and formally approving deployments along the way (e.g. AWS CodeDeploy).

Either way, I’d suggest starting with version control and continuous integration.