Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Continous Integration of (JS) projects & check-build philosophy

2,683 views

Published on

What's check-build, why I built it at Bringr/Redsmin and how we use it everyday inside our continuous integration workflow.

Check-build: https://github.com/FGRibreau/check-build

Published in: Technology
  • Login to see the comments

Continous Integration of (JS) projects & check-build philosophy

  1. 1. Continous Integration of (JavaScript) projects & check-build philosophy
  2. 2. The story “Let’s start with a little story...”
  3. 3. “My name is François-Guillaume Ribreau”
  4. 4. BringrCo-founder Founder “I’m the co-founder (CTO) of Bringr and the founder (C[E|T]O) of Redsmin. Some month back, our team grew in size.”
  5. 5. Bringr A B FC D E G “At Bringr & Redsmin we work a lot at creating micro-services (SOA), so each of the new time member was given micro-services to build.”
  6. 6. D.R.Y YAGNI KISS C.Q.R.S SRP OCP LSP ISP DIP 2 spaces no tabs syntax documentation “Since they were junior developers (sometimes interns), at each code-review I had to explain software principles and our conventions”
  7. 7. conventions & principles “... and I had to do it at every code-review, each-time. Sometimes — it happened — I would not even respect my own conventions...”
  8. 8. When you ask developers to follow coding conventions
  9. 9. Try to make the human out of the loop “... so I came across this principle...”
  10. 10. Don't rely on principle, rely on automation. “... that I rewrote”
  11. 11. “People are fallible, automated workflows are* not.“ — FG “... that I rewrote (again)”
  12. 12. Solutions? “Now let’s see what our current options are...”
  13. 13. Code-style checking “We could use JSCS...”
  14. 14. Syntax checking “... along with JSHint and so on...”
  15. 15. Bringr A B FC D E G “... but installing JSHINT/JSCS on each project is not DRY at all”
  16. 16. Documentation checking ? D.R.Y checking ? Security* checking ? “But then what about other code dimension?”
  17. 17. Jenkins A B F C D E G ... ... ... ... ... ... ... Tests Tests Tests Tests Tests Tests Tests “... another way was to install JSHint/JSCS plugins on the CI, but that’s like creating high coupling... Not a good idea either.” “moreover, these plugin configurations can’t be versioned inside the project git repository...”
  18. 18. Solution. “... here is what I came up with.”
  19. 19. Check-build Verifies that your NodeJS project follows team conventions, is well written, up to date and secure*...
  20. 20. 5 Security Freshness Code styleD.R.Y.ness Syntax/Complexity JSInspect David Nsp retire.js issues/10 plato issues/19 “Check-build ensure 5 points of control”
  21. 21. Security Freshness Code styleD.R.Y.ness Syntax/Complexity Documentation Inch.js issues/8 6 “Documentation is a work in progress, don’t hesitate to send a PR”
  22. 22. { "checkbuild": { "enable": ["jshint", "jscs", "jsinspect", "nsp", "david"], // don't exit immediately if one of the tools reports an error (default true) "continueOnError": true, // don't exit(1) even if we had some failures (default false) "allowFailures": false }, "jshint": { "args": ["src/**/*.js"] }, "jscs": { ... } .checkbuild .jshintrc “Check-build does not reinvent the wheel, it leverages existing stuff in a declarative way”
  23. 23. Jenkins A B F C D E G ... ... ... ... ... ... ... Tests Tests Tests Tests Tests Tests Tests
  24. 24. Jenkins A B F C D E G Tests Tests Tests Tests Tests Tests Tests npm i check-build -g && check-build npm i check-build -g && check-build npm i check-build -g && check-build npm i check-build -g && check-build npm i check-build -g && check-build npm i check-build -g && check-build npm i check-build -g && check-build “Check-build removes high coupling between the CI & projects and between projects and quality tools. Always install the latest version, we make sure check-build will always be backward compatible”
  25. 25. ./scripts/ci-start @weekly hook Run tests (unit & integration) ./scripts/ci-publish Zero downtime deploy Jenkins & git push “By building automatically daily/weekly, check-build can ensure that our projects are secure* and up-to-date, even if we don’t push new code”
  26. 26. @FGRibreau bringr.net redsmin.com redisweekly.com Thank you.
  27. 27. “ Administrate everything, monitor in real-time. Visualizing and editing Redis data-structures has never been so simple. ” Founder of Redsmin redsmin.com
  28. 28. BringrCofounder & CTO of “ Create value for your business on Social Media, from discussion to conversion ” Professor @EPSI_Nantes & @UnivNantes on JavaScript (RIA/NodeJS), Design Patterns and NoSQL databases bringr.net

×