By Zach Brown
Hi! I’ve been looking into GitLab’s CI/CD features recently and I can’t seem to understand how to automatically deploy files from my master branch to my droplet. Can anyone help me out here and explain it? I’m pretty new to CI/CD. Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey friend,
So this is a bit open ended. There’s no one right way to do this, and I’d propose no wrong way either. Personally I create bash scripts to update code on my systems over Git, but my ways tend to make others cringe. For example, I run this on a 5 minute cron on a bunch of my servers:
https://github.com/mxroute/MX-Scripts/blob/master/update_manager.sh
Here’s an example of how someone else deploys their code:
https://gist.github.com/noelboss/3fe13927025b89757f8fb12e9066f2fa
Another still:
https://medium.com/@francoisromain/vps-deploy-with-git-fea605f1303b
Pretty much any way that fits your needs and doesn’t cause problems, I’d call it the right answer :)
Jarland
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.