Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Ci servers

  • 28-08-2014 9:51pm
    #1
    Registered Users Posts: 1,466 ✭✭✭


    I'm looking to setup a CI server in work.

    I have team city setup running a MSBuild script that is giving me :

    Resharper analysis
    Style cop
    Duplicates
    MS Test
    Build
    Code coverage
    Etc.

    What team city gives me that I like is

    3 build agents
    XML output to HTML report
    A pretty dashboard to see all my results
    Pre commit analysis that prevents the checkin on test failure

    Now the question has come, we run TFs in work, can't I achieve the above from TFs ? Or Jenkins that has no cost.

    Anyone have any experience of CI servers?


Comments

  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Jenkins gives you all of that for free, and more - so many plugins available. TeamCity is good, but you will quickly realise they make their money via build agent licence. With Jenkins you can have as many build agents as you want, and the dashboard is even more customisable. Also you will quickly realise how easy it is to max out your build agent capacity :pac:

    TeamCity charged $100 per extra build agent when I last checked.

    If you are using microsoft-only technologies then TFS is good, but is not suitable if you have any kind of cross-platform stuff going on.


  • Registered Users Posts: 2,021 ✭✭✭ChRoMe


    Jenkins, job done.


  • Registered Users Posts: 159 ✭✭magooly


    hudson / jenkins


  • Registered Users Posts: 1,466 ✭✭✭Smoggy


    It seems like there is a strong message of Jenkins coming through. Thanks for the input, I will download and install it over the next few days.

    My primary worry is we are using a mix of sonarqube / resharper / style cop to cover our code standards.

    The resharper output for a newly introduced error looks like :

    <Issue TypeId="EqualExpressionComparison" File="Company.Console\Program.cs" Offset="2733-2745" Line="75" Message="Similar expressions comparison" />

    There is no attribute to tell me that it is a new error. Where as the report that teamcity generates off this data has a new checkbox allowing me to see the error introduced in my check-ins. I assume it compares itself with the last output.

    In a greenfields codebase this won't be an issue, but the codebase we have is quite old and this is the first time code analysis will have been run over it, so it's imperative we can tell the difference between existing and newly introduced. Otherwise we won't be able to tell the wood from the trees.

    I guess the only way to find out is to D/L Jenkins and see what it can do !


  • Registered Users Posts: 1,466 ✭✭✭Smoggy


    A related question.... so not worth starting a new thread :

    What happens in this situation with CI Servers.

    Developer A : Gets the latest code
    Developer B : Gets the latest code pretty much straight after Dev A.
    Both developers are working on the same class and their work overlaps.
    Developer A : Checkins in via Teamcity - everything is fine.
    Developer B : Checkins after Dev A and overwrites some of their code.

    What happens with the Visual Studio / TFS is that it will prompt you to auto / manual merge the changes, to rectify the problem.

    Now manual merging of the changes isn't possible as Teamcity is doing the checkin for you and the automatic merge can't always be done and when it is done is sometimes inaccurate.

    So what happens in this situation ?


  • Advertisement
  • Registered Users Posts: 7,157 ✭✭✭srsly78


    That's not a CI problem, that's a version control issue. The second dev to commit will get an error telling them to update first. Well that's what will happen with SVN, not sure about other systems.

    TeamCity does not do version control... it does not check stuff in. It does have a handy plugin for various IDEs (like Visual Studio) that will run your local copy through CI but this is not the same thing, and is specific to your local changeset.


  • Registered Users Posts: 2,012 ✭✭✭Colonel Panic


    Git and Mercurial won't push a changeset if there's a conflict and you'd need to pull and merge/rebase (depending on branching model) your work locally before trying again.


  • Registered Users Posts: 1,466 ✭✭✭Smoggy


    This is not what I get when I read the Teamcity plugin literature, it's suggesting that Teamcity will be the one that is commiting :

    "One interesting option is the Pre-tested Commit checkbox and its related commit if setting. Using this, submitted code changes first go through testing. If all tests pass, TeamCity will automatically commit the changes to version control and integrate it in the next build. When tests fail, the code is not committed and the developer who made the change is notified about this."

    Extract from :
    http://blog.jetbrains.com/dotnet/2013/03/12/teamcity-plugin-for-visual-studio/

    Maybe this isn't a generic CI server question ? more of a question of CI servers that allow this auto commit on successful (build/test) question ?


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    OP is confusing the local build feature of TeamCity with a commit.

    TeamCity integrates with various version control systems to do a commit. Thus while it may be seamless, it is not correct to say that TC does the commit. Things still happen via SVN or git or whatever - and this is when an error will occur.


  • Registered Users Posts: 1,466 ✭✭✭Smoggy


    So we are saying the mechanics of the version control software will always prevent this from happening ? It's not a feature of Teamcity as such, but the underlying mechanics of the version control and Teamcity would have to register this as an error in it's build log.


  • Advertisement
  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Correct, the TeamCity documentation means it will TRY to do a commit - which will fail in the situation you have described.


  • Registered Users Posts: 1,466 ✭✭✭Smoggy


    Great - thanks.


  • Registered Users Posts: 1,466 ✭✭✭Smoggy


    I have finally gotten around to installing a CI Server, as recommended by the masses I took a first plunge with Jenkins. So far it's been easy to setup and I'm getting it running SonarQube for the static code analysis.

    The next question is, I have it hooked up to TFS via a plugin, but now I want to do gated check-ins, but don't see how to do this easily the main option seems to be polling. But obviously if you're polling the repository your looking for new code, so it's post commit.

    Has anyone used Jenkins and TFS for gated check-ins ?

    Options in Jenkins :


    Build Triggers :

    Build after other projects are built
    Build periodically
    Poll SCM


  • Registered Users Posts: 24 SonicWind


    Not Regarding TFS:

    I work alot managing a cluster of vm slaves for Jenkins with my job,
    I would recommend adding the Purge Build plugin, it really saved me a few times when things went wrong (mainly a few config issues).

    I'd also up the RAM allowance given to Jenkins, I have mine set at 2.5GB currently and its eating just under 1.6GB of it. Note: Jenkins ships with its own 32-bit jre, you'd need to point it to a 64-bit. (Done in jenkins.xml).

    The "join" plugin is also seriously handy, it allows me to do a cleanup (or pretty much anything) after the entire build is finished. Our builds cost us about 1GB of space on every VM, every run.

    Finally, "View Job Filters" and "Nested View Plugin" are amazing for sorting out your tests instead of having them in the one list. (Which gets very long).


Advertisement