What is the best way to integrate .NET Projects with Jenkins and SVN (I don't know if there is any chance to switch to git right now) and be able to review code after build and before production.
I'd like to have something like this:
6a. Not everything is OK. 6b. Jenkins sends notification to developer that his commit broke build and we go back to step 2.
I know how to do steps 1-6. More or less. I know I can build everything with MSBuild, so this shouldn't be hard, but I don't know exactly how to configure steps 6-9,
GIT:
I think with git it would be far easier. I saw that there is Git Publisher in post-build actions and I could push changes to branch - "review-branch" or something like that and send notification to reviewers. They will pull repository and everything would be great. hmm also maybe instead of pushing to review branch, Jenkins should create pull request to that branch. But as I said it would be scenario for git. I wrote it here, because for me git is better option here, but maybe not possible. I just want to know if I'm not missing something if we are talking about git.
SVN:
Here I have no idea how to do that. Does Jenkins have something built-in to deal with 'push' to second SVN repository? How can I commit code to repository B?
Review: What is the best approach? - (GIT) Jenkins creates pull request -- if possible - (GIT) Jenkins pushes to second review-branch and sends notification on email or creates some tickets on some issue tracker (Redmine/Jira) - (SVN) Jenkins commits to review repository and sends email or creates tickets. - or maybe it's better to integrate everything with ReviewBoard/Gerrit or something similar. Right now I've never used such software and I read that Gerrit is a bit troublesome.
There's something you need to remember:
In a version control system, everything is reversible
That means you can do a code review on committed code, and fix any issues in a new commit. In fact, this is actually good to do with Subversion because Subversion gives you a nice revision number that contains all the code changes. Everyone is on the same page this way. ("We're reviewing revision 23,340"). Most code reviews are looking for things like forgetting to check for a null pointer, etc. If the code is really bad, Subversion makes it easy to completely reverse the change.
Jenkins will immediately tell you if a build is bad, and our policy is that a developer has 10 minutes to fix the problem, or back out their change. (90% of the time, they back out their change). We have our system setup, so both the developer and Jenkins use the same build mechanism. This allows a developer to test the build and run the unit tests before committing their changes.
This is why most version control systems don't have shelving, and you don't see three sets of repositories and most places. This isn't your apartment. Your mom isn't going to come by and see your code history. It doesn't have to be nice and tidy. Let it reflect what's going on.
Simplify. Remove the last three steps. Do your code reviews and fix the code in the same repository. It means 66% fewer repositories that must be maintained. 66% less hardware. And,
All you really need is a way to track your code reviews. You can use something like Crucible, but you can also use Jenkins. There are two ways of using Jenkins for tracking changes:
The Promoted Builds Simple Plugin is ...well... simple. You specify all of the various promotion levels in your Jenkins configuration page, and that's what all the builds will use. Only a single promotion level per individual build is allowed, and it's all manually done.
The standard Promoted Build Plugin is a bit more work, but it's also way more powerful. It allows each Jenkins job to have its own build promotion scheme. Promotions can be both manual and automatic. When a build gets promoted, it can spawn other actions such as sending out email, deploying to a server, etc. Plus, you can show multiple promotions. Imagine the following promotion levels:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With