How to revert the build in Teamcity after the CI tests failed - continuous-integration

I am using TeamCity for my CI integration and TFS as my code repo. We trigger a build to deploy the code changes on every check-in by devs. Once this build is successful, then we trigger another build configuration which runs some sanity tests which are managed by automation team and not the unit tests. Now when any test in this build fails, I want to revert the check-in made by the dev's implying there was a problem in the application with the latest code and previously successful build to be redeployed.

It sounds like you want to use TC Delayed Commit Feature.
Delayed Commit Overview Page
Delayed Commit Documentation

Related

Teamcity & Udeploy continuous integration and deployment

I recently set up a continuous integration server in TeamCity and now want to take it to the next step, continuous deployment.
I have added VCS trigger in TeamCity which triggering the build once new code is committed in our deployment branch and it is working fine.
I have also written some script to push the latest build in udeploy component.
What I want to do here is once the new version created and pushed to udeploy, the deployment will start automatically.

Release Management and Distributing regular updates

I have a .NET application that I am distributing regularly through an .exe and .exe.config. Rather than sending around the executable to team members every time there is an update (which is often), is there any way to check for updates when they launch the app? I see this in most Desktop applications but not sure how it's done. Can I integrate with our VS Team Services repository?
VSTS can’t check updates when the app is launching. But you can use VSTS CI ( continuous integration) build and CD (continuous deployment) release to update the app before it launching.
Detail steps as below:
Push your code in VSTS repo (Git or TFVC).
Such as you can create a git repo on VSTS, and then clone/commit/push changes to the remote repo.
Add a CI build for your project.
You can use ASP.NET template or add tasks manually to define what you want to build. For Triggers, you can trigger the CI build when changes are pushed in your repo, or you can use schedule trigger to build your code for certain time specified.
Trigger release by CD so that the latest app is deployed to the machine(s) you use.
Add a release with your build definition and CD selected. Then add the tasks you need to deploy.

TFS and golang continuous Integration

I'm tracking the files of my golang app in a local TFS server integrated with git. I want to define build, test, and deploy steps but I can't find any tool for that.
How can I define a build and test step for the project that shows the test results in the Team's web site? thank you.
You can use the vNext build system in TFS2017 and add Command Line task in the build definition to run the build and test just like what you do on local machine:
And then add a "Publish Test Result" task to publish the test result to TFS so that you can check the test result from the TFS Website. A limitation is that "Publish Test Result" task only support four Test Result Format for now: JUnit, NUnit, VSTest and XUnit.

Post-Build event not triggered by Octopus & Team City for C# Project

I added a Post-Build scropt to my .csproj. Checked it into TFS. I see Team City builds fine.
But when OctoDeploy pushes that nuget package for that build, I do not see that post-build script copying a folder to the bin of that project which is what the script does. It works fine locally on my PC but just is never triggered if OctoDeploy pushes my build to our dev or stage servers.
Not sure where to start. If you need more info let me know.
If it is a post build script, then you're talking about a script that is run at build time. Octopus doesn't run any part of the build, it deploys the artifacts of the build.
If you are trying to run a post deploy script, check out the docs at http://docs.octopusdeploy.com/display/OD/PowerShell+scripts.

How to run Jasmine tests in TeamCity

We have been writing specifications for our JavaScript business logic using Jasmine. We're able to run our test suite within a browser, but how would we integrate this within TeamCity? Preferrably we do not want to use NodeJS, rather something as simple as possible.
I have created a modified version of run-jasmine.js that is found in the PhantomJS sources (original version is here. This version can be used within TeamCity (it will automatically detect that it is running in TeamCity). This updated version is using TeamCity service messages which allows for a nice integration.
You will need PhantomJS. You'll also need one of the following:
run-jasmine.js (for Jasmine 1.x).
run-jasmine.js (for Jasmine 2.x).
Add a build step in your TeamCity build configuration that can run this step:
phantomjs.exe run-jasmine.js index.html
index.html is your Jasmine runner page. If the build agents do not include PhantomJS, you can commit it to your repository along with your sources (this is what we do).
The result will look like this:
Test details:
The above is from a Tasks sample ASP.NET MVC project with this setup. It can be run in TeamCity using a Visual Studio (sln) build step. It will also run the tests within Visual Studio, as a pre-build step.

Resources