Aaron Shen
Aaron Shen

Reputation: 8374

why do I need continuous integration if I have grunt run tests everytime I do some changes?

I'm learning front-end development. I read several times people mentioning about continuous integration tools, like jenkins server or travis CI when talking about development workflow.

What I know the purpose of using CI is to do testing every time a commit has been made to the central repository. But I have already set up grunt and test tasks whenever I make any changes to the code base.

It seems to me it's unnecessary to use CI because local grunt test tasks already taken care of everything for me. And even though I use CI, I think before each commit, we shall always use local automate tasks to run tests to make sure there's no error. Then what's the purpose of using CI?

Upvotes: 1

Views: 181

Answers (1)

Viktor Benei
Viktor Benei

Reputation: 3545

There are a few benefits of using a CI/CD server or service even if you do local unit tests:

  • validate that the repository contains all the resources and there are no ignored or left out resources in your project
  • allow access of test results and build artifacts to others
  • manage the deployment of the project (or simply archive the "green" builds)

There are other benefits of CI/CD services, most benefits are related to the pain CI/CD tries to solve: to make it easier to work with others.

You can of course use CI/CD for single person projects, in that case you can automate these things with grunt tasks (though CI/CD services are more specialized and better tuned to handle these tasks - for example the deployment of the project).

If you're working with others (or there's even a slight chance that you will in the future) you should centralize the CI/CD tasks so that it can be properly managed and maintained by the team.

Upvotes: 1

Related Questions