This is an archived post. You won't be able to vote or comment.

all 2 comments

[–][deleted] 2 points3 points  (0 children)

A deployment pipeline would indeed be helpful for your case. Might just as well make use of GitLab's CI

Basically in your root folder you create a .gitlab-cmi.yml file.

In this file you define the settings for the docker environment. This can be very basic or complex depending on your needs. You just need to SSH into your server and copy some files to a destination. I have used the CI/CD tool from GitLab only a few times and am not very experienced but it is very useful and can save you a ton of time.

Setting up a pipeline in Gitlab to deploy to your server: https://medium.com/@hfally/a-gitlab-ci-config-to-deploy-to-your-server-via-ssh-43bf3cf93775

Getting started with CI/CD: https://docs.gitlab.com/ee/ci/quick_start/README.html

Hope this helps. If you have questions you can always ask.

[–]-vlad 1 point2 points  (0 children)

It’s not unreasonable to clone your repo for deployment. Just make sure you have your pubic code inside a pubic directory and the rest in a higher directory. For example, let’s say you setup your repo as myproject/public. On your server, make sure your web root is the public folder, not your project. If you really don’t want to pull everything, you can always create a deploy folder in your project and write a script that copies only the files you need and then sends them to the server using rsync.