TeamCity - How do you give feedback to clients for a deployment to their machine? - api

Currently when our software is out of date, the following call is made to queue a deploy in TeamCity.
/httpAuth/action.html?add2Queue={0}&system.name=TargetMachine&system.value={1}
Argument 0 being the buildTypeId and argument 1 being the hostname of the targetMachine.
We are trying to setup a way to give the client feedback on the status of their build in TeamCity. Our idea was to create a website that would popup on a clients computer to show the status of their deployment in TeamCity, but can't figure out any quick way of doing this. Keep in mind we dont want the client to see the whole queue, only their build.
The problem I am arising at is when calling TeamCity with the command above, there is no way that I know of to retrieve the created buildId. If I could get the buildId, then the rest should be pretty easy.

You can use TeamCity Windows Tray Notifier tool. You can configure notificationf for different events like build started/finished/etc. Obviously if this is a case installing such a tool on the client's PC.
For instance, an user would see such popup window in case of build crash:
Also TeamCity allows configure email notification on the broad set of events related to a particular build or project.

Related

Trigger more than one URL after IntelliJ Run configuration is run

I have a Run configuration which builds an exploded web app, deploys it to tomcat, and opens the home page after that. However, I want to hit a few URLs to set some state in the app before opening the home page (Or after opening the homepage; it does not matter). Is there a way to trigger a few URL hits after the run configuration? This feature would be similar to "before launch." Instead, it would be "after launch".
There is no such feature at the moment, you can vote for the related feature request.
It's not as simple as it looks since it's not clear what would trigger the after event. The app server doesn't exit/terminate, but is still running, therefore it's not possible to use another run configuration with your app server added in its Before launch steps, otherwise you could create a Shell script configuration that would call curl/wget.
For the app server the proper after event would be the moment when the artifact deployment is complete which requires the tight integration with this specific app server so that IDE knows the exact moment when it happens and allows to call some custom action.
This might be possible with the custom plug-in as IDE already knows when the artifact deployment is complete.
A really hacky workaround would be to run some tiny HTTP server and open its URL from the IDE instead of your real app server. This custom server would call the URLs/APIs you need and then open a browser for your real app URL.

Sending notifications on build start in Bamboo server

I'm looking to be able to send notification whenever a build is started and not only when they are completed.
Is there a way to get custom Notification Events?
There is not a native way to do this. However, there are some creative ways to get around this:
Use a task in a build job to send out the notification via a script or executable (my recommendation).
Use webhooks and 3rd party applications (e.g., Slack, Microsoft Teams)
Use the Bamboo API + a custom script to watch for the build to start.

TFS Build giving different results according to build requestor

We have a TFS (2013) build defined which runs a project of Selenium tests against the web site in the solution (chromedriver). If run locally, by any developer, three of the tests currently fail. The build agent is on a separate box from the tfs build controller and running under a local admin account.
With the code all checked in, if the build is manually triggered by three of the developers, it works as expected - three tests fail. However, if the build is launched by either of the other two developers, almost all of the tests fail, either with a...
System.InvalidOperationException: unknown error: cannot focus element
or
OpenQA.Selenium.NoSuchElementException: no such element
...type of error.
All developers have the same rights in TFS. Can anyone suggest how the id of the requesting user should be able to influence the results of a build being run remotely and under different credentials? (Any solutions would also be appreciated!)
It would appear that this is as a result of screwed up AD Groups on the network.
Since the originating user's credentials are actually carried over to the build process, rather that the local admin credentials being used, we (eventually) discovered some different AD memberships of groups between the developers which impacted the permissions on some folders on the build box, stopping certain resources from being accessed.
Unfortunately the errors raised by Selenium were complete red herrings and hiding the actual cause - difficult to diagnose until we actually ran the builds locally on the build server under the various developers' credentials.

Sending notifications on build failure in Bamboo server

I want to configure the Bamboo notification in a way that
When a build fails on the bamboo server a notification mail should go the developer responsible for the build failure. This is achieved and works fine.
Also the notification about the build failure should go to the developer's respective supervisor (say his/her scrum master and product owner). How to achieve this?
Thanks for your time and help
It is possible. In Bamboo 4.x (and i think also in Bamboo 5.x) you can set this kind of notification here: Configure Plan->Notifications
On this site, you have a few options. You can select in the Event dropdown menu for example "Failed Builds And First Successful" and in Recipient Type "Committers".
You can add multiple notification rules.

How do I publish php source code to a local web server in rational team concert?

I'll be using RTC in the near future here at work. My question is: where does it put the files the team members will be working on? I understand that each programmer will work on the projects files and they will push the changes to the main repository. We have a local web server where we test our work (php). So, do we have to configure RTC to publish the files to the web server? or the RTC server must be installed in the webserver so it can save the files?
We use Rational Team Concert almost exactly as you describe, and it works brilliantly. My small team of web developers collaborates on website source code and delivers it to two different streams depending on its readiness: production-stream and staging-stream. Then we have defined two builds that check out the source code, move some things around, and push the files to the web servers via SCP. So, with a few clicks we kick off a staging build, watch it finish in about two minutes and everyone can see the changes on the staging server. When the code is ready for prime-time, the change sets are delivered to production-stream and the production build is kicked off, which is configured to copy the files to the production web server.
But even before a staging or production build is run, any of us can simply configure a local web server in RTC using the Eclipse PDE and Web Tools add-ons and see the site running in localhost as we develop.
All our work is done within Rational Team Concert, from planning, to bug tracking, to source control, to builds. It's very well-suited for website management.
Your understanding is correct - you work on files locally, and they get uploaded on to the server when you checkin. Bear in mind that checkin in RTC terms really means back-up your files to the server, it is a Deliver command that shares the files with others (it is worth a quick look at the articles on jazz.net that explains how SCM works).
One way to pubish to your php server is to make that part of a build, or a build in its own right (which RTC also handles - in conjunction with your favourite build tool). The build would copy the files to the php server. The advantage of doing this as a build is you will know exactly what versions of your files are being copied, and you will be able to reproduce this copy at any point in the future.
You do not need to install the RTC server on the php server.
You can also try posting on the forums on http://jazz.net/ if you have questions on RTC.
Hope that helps.
Another alternative would be to use the command line interface to accept all changes into a workspace and run that with a cron job.
To handle discarded change sets, you'd probably want to use something like:
scm workspace replace-components <workspace-name> stream <uuid-of-stream> --all
after you had initially loaded the workspace on your web server.