-1

I want to setup a CI and CD processes for a React App for the company I'm working for, the following technologies are used:

  1. React for frontend
  2. Flask for backend
  3. Docker
  4. GitHub for source control management

currently we are using a script to build the app and than deploy it manually to AWS S3 bucket, I've read some article and watched tutorials and almost all of them cover Java based project and use Maven as a build tool to package the project before deploying.

appreciate if you could help.

Ali Aljarah
  • 1,326
  • 2
  • 9
  • 16
  • At the moment your question is very broad and hard to answer, could you specify what you are struggling with specifically regarding how to build the project? – Sven Hakvoort Nov 30 '18 at 13:22
  • The workflow is whenever a commit is pushed to github, i need to a build to be triggered, I'm struggling with how build the project, is there a specific build file i should get from the developers to be executed by jenkins? It's my first time to deal with jenkins and the whole CI and CD process – Ali Aljarah Nov 30 '18 at 13:30
  • This highly depends on what you want to do in your build. But yes, it can be done with a build file you get from the developers. Another case (which I encountered recently), is that my pipeline itself performs all the steps to compile and bundle the css and JS, package everything and push it to the server. Again, this highly depends on what you prefer/what the build scripts do. – Sven Hakvoort Nov 30 '18 at 13:39

1 Answers1

1

I agree that the question is a bit broad but here but generally speaking you should ave a different CI pipeline for your frontend and backend application.

The implications of this are many since this will allow you to:

  • To use different release cycles for your backend/frontend application
  • Reduced build time

You might however at some point run an integration step to make sure everything holds together. Generally speaking your pipeline should look like (this should run on every commit):

Also make sure you choose a CI/CD tool that doesn't get in your way and that's flexible enough (i.e: GitLab, Jenkins).

  • Build docker image
  • Linter (to ensure a minimum code formatting and quality)
  • Unit Testing
  • Code coverage (Code coverage perse it's a bit useless but combined with how it evolves and enforcing a minimum % might help with quality)
  • Functional testing (this makes more sense for your backend stack if it uses a database for instance ...)
  • If everything passes then push to DockerHub
  • Deploy the recently built image to the corresponding environment. Example merging to develop implies deployment to your staging environment
Yoanis Gil
  • 3,022
  • 2
  • 15
  • 22