I'm using Jenkins for CI and I'm debating where to place various logic (as scripts, etc.) for building, packaging, versioning and publishing.
For example, in a Java/Scala maven/sbt world, you can perform all of these tasks with maven/sbt itself using the project descriptors (.pom, build.sbt, etc.) and various plugins (assembly to make a "fat" jar, etc.). An important feature of this style is that the entire pipeline of build/package/version/publish is self-contained in the source repo itself, and Jenkins really only needs to run a single command to perform all these steps.
For other kinds of projects there aren't necessarily "one-stop-shop" solutions for this pipeline. One constant debate I have with folks is that "source code shouldn't know where the artifact repository is", or "a project shouldn't manage its versioning mechanism", etc.
One could imagine giving Jenkins the responsibility for any of these steps. For example, the project itself is responsible for supplying the build and test machinery, but Jenkins builds the artifact and uploads it to some artifact repository. The downside to this approach is that now there are a bunch of dependencies between the project and Jenkins in order to complete the whole pipeline, and the extra dependencies magnify the downside when there are problems, i.e., somebody breaks the script that figures out the new version number of a project and all projects can't get a new version.
Can you all help me find good principles and structures for assigning the responsibilities of build/package/version/publish?
Thanks,
.. Adam