How to lock "Run" button in TeamCity - teamcity

I made a build in TeamCity which deploys code to live server. As a precaution I want to disable that button "run" can be clicked by mistake.So I want to have an additional level of checking "whether I'm sure" I want to click "run" button. Is it possible to accomplish?
Thanks in advance!

I don't think there is a way to disable the run button.
An approach I've used is to have a Property which gets passed to the build script which needs to be true for the script to run, it's false or not set then the build script throws an error. Then in the build configuration on the Properties & Environment Variables page I set the property to false. Now whenever I need to run the script I have to use the "Run custom build" button (the "| ..." bit beside the run button), then I set the value to true before hitting the build button.

Another, easier option, is to add a agent requirement to your build such that only the production server's agent can meet it (e.g. env.COMPUTERNAME equals MyProductionServer01), and then disable the agent with a note about "locking" the production build. This will prevent the build from actually running if you accidentally click the Run button.

You cannot disable the run button but you can set permissions so that people are still able to view the project without the ability to run it (specifically the Run Build role).
As far as the confirmation goes there is nothing built into TeamCity to accomplish this but I do believe it would be possible to write a small plugin to gain this type of functionality.
Plugin Information:
http://confluence.jetbrains.net/display/TCD6/Developing+TeamCity+Plugins

Indeed, there is no ability to hide Run button unless the build configuration is placed in a different project, which user has no permission to run builds in.
There is a related feature request in TeamCity issue tracker.
As to requesting confirmation, there is still no direct support, but since TeamCity 7.0 one may add a parameter with mode "prompt" and this will result in the run custom build dialog popping out on Run button click.

We have solved this by providing double log-ins for our users. The normal user is not having permisson to run dangerous projects, but if the log in as elevated.user they have access to the run button for these projects as well.
So in normal situations there is no risk of running by accident.

I don't think there is disable button for run. You can pause the build and run it when you want to deploy to live sever.

Not that I'm aware of. If you have enterprise you could set it up so that there is a special account which has permissions to execute that build. Another workaround would be to make the build look at a specific branch in your SCM repo with restricted permissions, etc. Typically merging to a branch requires a bit of effort so its not as easy as hitting run by accident. Also ensures that someone hitting run won't necessarily grab the latest unstable copy from the trunk or somesuch.

You can now remove the Run button by adding teamcity.ui.runButton.caption parameter with an empty value.
See this comment on YouTrack.

Related

Wix : Disable control in built-in dialog

I am using WiX and want to know if we can disable a control in a built-in dialog. My requirement is to disable the "Browse" button in the "CustomizeDlg".
This became too long for a comment. I might "evolve" it as an answer if we get more information about your scenario. Just a couple of heads-ups for you.
If you are trying to prevent the setup from being installed to a non-standard path, then you should account for the fact that the installation directory can be set at the msiexec.exe command line when the setup is installed in silent mode. Sample (untested by me - first thing I found :-) ).
I suppose a custom action could be used to abort the setup if it is installed in silent mode to a non-standard path? An immediate mode custom action before InstallInitialize somewhere I guess, but after costing actions (CostInitialize, CostFinalize, FileCost, InstallValidate, etc...) - but frankly, why do this? Perhaps you could illuminate your use-case?
Oh, and please don't leave the standard action RemoveExistingProducts to run before your custom action (in the InstallExecuteSequence). This would remove the existing, related installation on the box (if any) and then abort the major upgrade operation leaving no install left on the box.
And don't add your custom action to the user interface sequence - there is no need. This sequence is entirely skipped in silent installation mode, and if there is no way to set a custom path in the GUI, it can't be changed there anyway (and the InstallExecuteSequence's custom action would catch any changes should they be set anyway - it will do).
Per this thread which discusses how to enable the button, what you need to do is the reverse: ensure your Feature elements do not specify a ConfigurableDirectory, or that it is not public by using some lowercase letters in the identifier.

Test in cloud button has gone

I made a 'Xamarin UI Test' Project to test my app.
I was able to click in the button like this: Run in Test Cloud button.
But now i made my test using the Repl() and want to run it in the cloud the button has gone away.
What i have to do to fix it?
Cause of the Issue
It looks like you are hitting this bug: Bug 52372 - "Run in Test Cloud" option no longer appears in menu on C9
That issue is reported on this version for Xamarin 4.3.0.636. Note that it may happen in other versions but this is the initial version the bug was reported against. You can track the status of that issue either directly in the report on Xamarin's bugzilla, and/or you can watch for a release announcement on the Xamarin Releases Blog.
Workarounds
Downgrading Xamarin
While waiting for a fix to become available, you can downgrade to the previous Cycle 8 version of Xamarin by going to “Get the latest stable version of Cycle 8” section on your account page: https://store.xamarin.com/account/my/subscription/downloads#cycle8.
Uploading to Test Cloud via the Command Line
Alternatively, you can upload tests to the Test Cloud through the command line. To do this log into https://testcloud.xamarin.com & click "New Test Run" at the top. (Note this option is only visible if you have a currently valid Test Cloud account or trial.)
This launches a wizard which will have you pick some options (like whether you want to use Android or iOS; etc.), and at the end will generate a prototype command line. Below is an example for Android:
packages\Xamarin.UITest.[version]\tools\test-cloud.exe submit yourAppFile.apk [API_KEY] --devices [DEVICE_HASH] --series "master" --locale "en_US" --user [EMAIL] --assembly-dir pathToTestDllFolder
Note: I have removed the [API_KEY], [DEVICE_HASH] & [EMAIL] values for privacy reasons, however these will automatically be included when you generate the prototype from the wizard in Test Cloud.
You will still have to manually update the Xamarin.UITest.[version] as well as the actual names and relative paths of yourAppFile.apk & pathToTestDllFolder for this approach to work.

How to run rollback custom action in Wise Installer Editor?

I'm making an installer that uses certain custom actions. I want to create a rollback action that undoes this changes when the installation is cancelled or unsuccessful.
What I've tried so far is what the documentation tells you to do, which is call the CA in deferred-mode and set "rollback only" in the In-Script Options. if you cancel the installation, the moment the installer tries to call the CA, the installation fails, it doesn't matter what the content of the CA is, it always fails the moment the installer tries to call it.
It says the installer couldn't execute a find a program necessary for the installation (the CA), even though the CA is called with "Run WiseScript From Installation", so the CA SHOULD be there.
It sounds like the setup is hitting an error inside your rollback custom action. The first thing I would do to prevent the setup from bombing out would be to mark the rollback custom action with "don't check exit code".
I haven't used Wise in a while and don't know exactly where you find this in the GUI, but it shouldn't be that difficult. It is probably a flag you can set when you insert the custom action into the InstallExecuteSequence.
Secondly you would need to start debugging the actual content inside the custom action to determine where it crashes and obviously resolve the root of the problem before the rollback action will work properly. Sometimes it is sufficient to just use numbered message boxes to track the progress of the code in the custom action at runtime, but at other times you need to use the debugger feature to step through each line in the custom action code.

VS2005 Setup project - program asks for installation media when started for the first time by another user

I have a very simple VS2005 deployment project that aims to install for all users on a PC.
All the application files are written to %Program Files%\MyProg. A shortcut is created in the start menu and the startup folder. No registry settings or anything else are created. I have set
'InstallAllUsers' to true.
The created MSI runs fine and installs the software. It works without any problems when running under the user account from which it was installed.
When logging in as another user, the start menu and startup icons are present. It attempts to launch the application however an installation window pops up and states that 'the feature you are trying to use is on a network resource that is unavailable.' The installer will only proceed if pointed to the original MSI file.
Why does this happen? I want my application to be installed completely for all users when it is installed by a single user.
edit: Solution
I was getting similar event log messages as shown on this page. In my case it turned out to be as simple as ensuring that the User's Program Menu had its 'AlwaysCreate' attribute turned to false. If it was true, windows would try and recreate the folder when a new user logged in. This somehow required the invocation of the installer and thus resulted in the 'please insert the installation media' prompts.
It is actually kind of hard to say without some more information. I would recommend checking on the rights in the installed folder (seeing if only the one who installed it has rights) and also checking the file list for the directory (to make sure VS didn't automatically place some files in the user profile). Let me know what comes out from those two steps and we can try to keep digging if that didn't shed any light on it.
Keep in mind chances are this is most def not specific to Visual Studio, look at this MS support article here where the same message is coming back for office.
I know this is an old post but I thought I'd add another cause and solution in case the above didn't work for you.
There is a bug in VS Setup and Deployment Projects which results in registry values being entered into HKCU instead of HKLM irrespective of the InstallAllUsers property being set to true.
You must use Orca msi editor to change the registry root for "DesktopFolder" and "ProgramMenuFolder" from either 1 or 2 to -1. The issue cannot be resolved via VS.
http://www.qa.downappz.com/questions/vs-2010-deploys-per-user-features-during-install-which-require-access-to-install-media.html

What's the easiest way to make a CC.NET local trigger to execute a program?

When the build fails, I'd like to execute a program that shoots me in the head with this. I've written the program already - I just need it to run when I break the build.
CCTray has the option to make a sound or icon - but not to run a file. Any simple ideas? I'd rather this not be an all day project. :)
CCTray allows you to run commands. In CCTry, go to File | Settings and then click on the Exec tab.
If you run Outlook, you can set up a rule that runs an application whenever you receive an email saying the build is broken. Just follow the rules wizard and you will find it (in Ootlook 2007 it's on the 3rd page of the wizard, in the select action part).
Cradiator has functionality to monitor build servers and do stuff when a build breaks. It doesn't have code to run an executable but it would be a cinch to download the code, change it and get what you want. Here's what I think is the quickest path to getting this done:
Download the source for Cradiator
Edit the DiscJockey.cs class
Add 1 line of code that starts your program (line 34) eg:
Configure Cradiator to monitor your build server (ie edit app.config and add your url) and run
if (newlyBrokenBuilds.Any())
{ // Add a line of code to start your program here eg
Process.Start("C:\\myprogram.exe");
}

Resources