September 19, 2021

How to separate development/deployment code?

How to separate development/deployment code?

Hi everyone,

I have a project that is on my one and only branch. Every time I push to it from my local machine, my deployed server pulls from it and restarts (I know it's bad, but I don't want to touch it for now).

The problem is that my local machine is a Windows machine, and my server is on Ubuntu. I recently added certificates for SSL to Ubuntu and added a hardcoded path to them on my Node.js backend. Now when I want to develop locally on my Windows, I can't run the server because I do not have the certificates in that particular path.

I have some ideas for fixing this problem including just putting the certificates where they should be, or commenting out the SSL code while I develop locally and then uncommenting it again when I push. But I think there should be a better option. Some technology that helps me say "Hey, don't do this if I am developing on my local machine, but you can on the deployed server". Some DevOps type technology?

I know my whole structure is not that great and I maybe should have other things to fix on my priority list like adding branches for development and deployment. But right now I am interested in this thing and was wondering if anyone has a pointer on what to learn for this situation.

submitted by /u/oKennYo
[link] [comments]