Bamboo Grunt 'dustc' task failing - gruntjs

I've moved my grunt job into Bamboo and everything works great except for the dust compiler. All of my other tasks in my gruntfile can be targeted from the bamboo task and they work. The dustc task gives this error when run: Fatal error: Error: not found: dustc.
I've manually run the dustc task on the build machine's command prompt every way I know how and it works. I even copied the command from the Bamboo build log - the one it uses to execute the grunt task - and it works just fine.
I just can't get it to work when I run the build from within Bamboo.
Any ideas would be greatly appreciated.
Thanks

This turned out to be a permissions/visibility issue.
Evidently system users (or at least the one which was running my build service) don't have access to the system environment variables in Windows. Learn something new every day!
I created a user to run the service (which I probably should have done in the first place) and that non-system user was able to see the correct PATH settings.
This took care of the problem.

Related

Dotnet CLI command fails to run DLL

This is probably something stupid I'm overlooking, but suddenly the dotnet CLI command fails to run my .Net Core Project DLL (>dotnet MyFrameworkDependent.dll). It runs fine locally but just doesn't do anything on the VM which is Win7Pro. I reinstalled .Net Core and 'dotnet' utility is there as I can run it with -help and other stuff in the admin command prompt. It just wouldn't do anything when I pass my DLL. It used to run with the previous version, but now - nothing! Not even any error or feedback. Any ideas on how I can troubleshoot this? Any clues are greatly appreciated!
Windows Event viewer may contain either of these errors
1603 == ERROR_INSTALL_FAILURE
1618 == ERROR_INSTALL_ALREADY_RUNNING
Cause:
This issue may occur if another program has not completed installing and a system reboot is required.
Resolution:
To resolve this issue, delete the strings, if any, in the PendingFileRenameOperations and FileRenameOperations registry keys.
Turned out there was some kinda problem with directory contents. I was able to run the DLL within the publish directory. I don't have time at the moment to investigate further, but if I get to it, I'll post details.

Continuous build and run with SBT

I'm tyring to find a better method to run my SBT project with continuous build (compile) and run, SBT can already do continuous compile and test but not with the run command unless I'm not aware how that is possible.
I tried using the ~ command on run but it does nothing
sbt clean compile ~run
I tried using the spray sbt plugin
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
but it is so tempremental and hangs a lot while trying to kill the current process making it faster to just kill the app then run sbt clean compile run
Is there a way to achieve this?
sbt clean ~run should work fine and rerun main method every time you change the sources. But if you're running a web server which is supposed to run continuously, sbt won't interrupt it to rerun.
So you should use sbt-revolver for that and solve any problems with it by either asking another question or submitting a bug report for the plugin.

R automatic task scheduling in windows: how to use external functions

I have a scheduled task in windows to run a R program ("ftp.R")
After many attempts and reading many SO literature, I found that the only way to make it work properly was writing this piece of code into a .bat file:
#ECHO OFF
RSCRIPT ftp.R
Everything goes fine except wqith it, when I am trying to use functions that I have in other R programs.
For example, in the "ftp.R" program I have this pice of code:
source("//BCN-01/Server/R/Main/Production/Check_Integrity.R")
In the "Check_Integrity.R" program I have some functions I need to use in "ftp.R".
The thing is that if I execute the .bat file manually, there is no problem, and the "ftp.R" runs perfectly. But if I run exactly the same .bat file but from the task scheduler the "ftp.R" is unable to find the external functions.
(I am running the code in a Windows Server 2012)
One big difference between running a batch manually / with the scheduler is that the scheduler starts the script with system32 folder as work directory. So it might be enough to add the following line to your batch file: CD %~dp0.
Another point is that the scheduler runs your batch as a different user. So it is possible that you (your user account) has access to //BCN-01/Server/R/Main/Production/ while the system user the scheduler is running your script with does not. You could also try to tell the scheduler to run the script with the same user which you are logged in when running it successfully by hand.
Finally I figured out what was wrong:
All the paths have to be defined as absolute paths: mapped units are not valid.
Althought I already I knew that (thanks to some posts I read here in SO), I missed one path mapped into one of the functions in 'Check_Integrity.R' .

Error MSB3025: using CruiseControl.net - Builds fine from command prompt

I'm hoping someone has seen this error before. I'm using MSBuild with CruiseControl.Net to run the build for this project. When i run the build from the command prompt it actually builds without errors, but when i run it with CruiseControl.net i get the following error:
error MSB3025: The source file "C:\PE\PE-DEV\UIProjects\FolderName\" is actually a directory. The "Copy" task does not support copying directories.
6 Warning(s)
1 Error(s)
Time Elapsed 00:01:50.07
I have been doing a search and nothing with that error number shows up in google. Any help will be greatly appreciated.
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>C:\PE\PE-DEV</workingDirectory>
<projectFile>Solution.sln</projectFile>
<buildArgs>/p:Configuration=DeployDev;BuildMode=DRYRUN;CreatePackage=true /fileLogger /verbosity:normal</buildArgs>
<targets>Build</targets>
<timeout>900</timeout>
<logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
This task works fine in other projects... If i use command prompt and run msbuild it works fine as well.
If it works when you run it from the command prompt (runs using your user account and permissions) and fails when running under CC (runs under whatever service account cc is running) it might be a permission issue. Try changing the account that cc.net runs under to your own account and see what happens.
This one was a tricky one, i was able to make the project work. The issue was the deploy build xml file had a typo somewhere and i was able to find the bug and fix it and now the project is building as it should.

Regression Testing with Rational Robot

My initial tests have shown that Robot won't work without an active, visible desktop. For example, while a scheduled task (or executed command from the continuous integration server) may be able to start robot as a command-line process, Robot will actually fail to execute the recorded script.
Logging into the build machine to allow it an "active desktop" is not an acceptable solution.
Am I missing something? Is it possible to run a pre-recorded Rational Robot script on a continuous integration server in a manner that doesn't require the machine to be physically logged into?
Unfortunately, Robot does require that you are logged on to the machine and that the desktop is not locked.
So, no, you are not missing something.
Depending on your situation, though, you may be able to work around the issue. Can you clarify what type of application you are trying to test? If it is a web app, or a client app that is easily installed/copied, you might be able to have Robot run on a vmware image, rather than directly on the build server itself.
You can run Rational Robot from the command line, so you should be able to set up a scheduled task to run a .BAT file to do this for you. The command is something like:
[path to Rational Robot]\rtrobo [script file] /user "user name" /project [project file] /play /build "build name" /nolog /close
The Robot documentation will have other arguments you can pass in, depending on your situation.
If a simple scheduled task doesn't work, then you can try setting up a STAF (http://staf.sourceforge.net/index.php) environment and create a job to run this.
Good luck :)

Resources