2

Let's say you build a node app via your CI system. Every time you build it you have to increment the node app version to create the new app, and then commit that version back to your git repository

But in that exact moment when you were building your new app somebody (a colleague) commits new code to your node app repository. To commit back to the repo we will have to merge any new changes and then commit back. By doing it this way we will end up with a package with certain version that will not have the new code committed during that time, so my node app will not be consisten with whatever I have on git, meaning that if I want to build the node app manually I will have not the same result as my CI, I will end up with that delta from whoever committed the code during the build.

So my question is what could be a good solution to keep the node app version unique and avoid having those extra commits on that particular version.

Gerardo
  • 7,457
  • 3
  • 22
  • 17
  • IMO you should manage the version number manually, a CI system is meant to test your code, not to manage the version number. **Edit**: at least the major (more significant) version numbers should be managed by you / your team so if you reference a version (let's say 2.3.x) you actually know what 2.3 means. A new version should be released when you say it's ready (contains every feature you wanted to finish) **and** it's passing your tests, not every time when it passes the tests. – Viktor Benei Mar 12 '15 at 19:19
  • agreed but I forgot to mention that the variable version I need my CI to keep bumping is the patch, so the developer can just focus on the code commits – Gerardo Mar 13 '15 at 04:10
  • In that case you still want to identify *something*. A general solution is to use a build number generated by the CI server (usually exposed as an environment variable), don't just bump the version. This means that from the patch number you can identify exactly which CI build generated that specific version, you can simply find it in your CI system. In local you can just define the same environment variable or a special one. – Viktor Benei Mar 13 '15 at 06:58
  • the main problem is not the versión is checking back code while somebody already changed – Gerardo Mar 13 '15 at 14:03

0 Answers0