3

We're going to follow for Semantic Versioning for our web applications, it looks really nice. Now, Jenkins used as CI/CD tools. We want to use Octopus Deploy as artifacts storage and CD tool, also for fast redeployment/rollbacks and other configuration features.

Octopus requires packages with concrete version (for example: 1.2.4). Therefore, we also need strong versioning for our web applications. Otherwise, how to detect what version was deployed and has bugs.

Solution described here is not transparent and doesn't fully match to semantic versioning:

[assembly: AssemblyVersion("1.0.*")]

Because, Patch version should increment one-by-one from 0, not from "random" number, and resets after Minor increment.

For my opinion - it's better to store version in the repository in the same view (1.2.4) as in package. But I found only this ways how to implement it:

  • Manual increment before commit - uncomfortably and has risks.
  • Auto increment from SVN/Git hooks before commit - requires to configure every workstation.
  • Auto increment from CI tool and commit - makes circular dependency with CI monitoring for changes in repository.

Is there any other ways to implement equal versioning as in repository, as in packages for web application? Or maybe that is unnecessary?

UPDATE 2017-02-28: We found that Jenkins can skip commits from specific users or with specific messages (in Advanced settings). It solves problem with auto increment from CI tool and commit (circular dependency between CI monitoring and changes in repository).

Raedwald
  • 46,613
  • 43
  • 151
  • 237
Nikita Danilov
  • 98
  • 1
  • 11
  • What part of your CD/CI pipeline produces the packages that Octopus will consume? – gvee Feb 27 '17 at 17:26
  • After continuous build, Jenkins packages and pushes package to the Octopus, with auto-deployment to development environment. – Nikita Danilov Feb 28 '17 at 15:18
  • What runs the build? I ask because in our shop, the build definition is where the version is set. Also; have you seen [this plugin](https://wiki.jenkins-ci.org/display/JENKINS/semantic-versioning-plugin) for Jenkins? – gvee Feb 28 '17 at 17:05
  • Jenkins automatically runs build every hour if repository contains changes. Thanks, we will try to look at this plugin. Now, we implemented custom simple exe-tool for version increment. – Nikita Danilov Feb 28 '17 at 18:14
  • 1
    @gvee , interesting, but this plugin broke our Jenkins server and we needed to reinstall them :) – Nikita Danilov Mar 01 '17 at 10:33

1 Answers1

2

Mostly developers failed to commit right assembly versions in code. Lets say if you've 40 projects and 15 developers then maintaining [assembly: AssemblyVersion("1.0.*")] version will always be an issue.

I recommend you can checkout code and do Search & Replace to inject right assembly build numbers like [Major.Minor.Build] always. [Major.Minor] to be taken as input and is globally aware to team thus reduce bad dll numbering/ Build number can positively increment and match with that of CI for tracking. SVN commit number can also be mixed with it.

SACn
  • 1,862
  • 1
  • 14
  • 29
  • Thanks a lot, I got confirmation - it's good idea to store SemVer in repository. :) We found that Jenkins can skip commits from specific user (in Advanced settings), it solves our problem with circular dependency between CI monitoring and changes in repository. – Nikita Danilov Feb 28 '17 at 18:11