Ben Cohen
Ben Cohen

Reputation: 1410

How to merge and deploy react build files correctly?

The problem:

I develop react project on my local machine, creating the build files (index.css, app.js). When i finish, i push them to the current branch. I build this current branch using Jenkins, so QA can deploy it to some environment to test it. When i want to merge this current branch back to develop, the build files always creating conflicts. I prefer to do merges on gitlab only for consistency, and it makes this impossible.

Our current 2 year old solution: The build files are ignored - on build process we save them on S3, and on deploy we take these files from there.

I feel that this solution is probably not the best. I couldn't find a nicer solution so far. If you have any react/git/gitlab/jenkins way to do it better - id love to hear.

Thank you in advance!

Upvotes: 1

Views: 532

Answers (1)

Calvin Zhou
Calvin Zhou

Reputation: 327

The repo is only for source code rather then the built artifacts, e.g. dist folder should not a part of repo

So what Jenkins does is: pull repo -> build -> deploy those build files to target server for every deployment

Upvotes: 1

Related Questions