Image for post
Image for post
Photo by Vishnu R Nair on Unsplash

What is CI/CD?

CI/CD may be overkill for small projects

How CRON can help

How to set up

Example project

Deploy the app

git clone address_of_remote_repository

Configure git

Create deploy scripts

#!/bin/bashsource ~/.virtualenvs/my_app/bin/activate
cd my_app
git pullpip install -r my_app/requirements.txtpython3 manage.py migrate
python3 manage.py collectstatic --noinput
#!/bin/bash
systemctl restart gunicorn
systemctl reload nginx

Setting up crontab

00 02 * * * /bin/bash /home/my_user/refresh.sh
05 02 * * * /bin/bash /home/my_user/reload.sh

Debugging issues

Final thoughts

Written by

Insurance meets tech meets music. #insurtech

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store