I want to run 2 post build events. I have separated the 2 commands by a full line break
Build Command
copy "$(TargetDir)$(ProjectName).xap" "C:\www\Proj\ClientBin\MyXap.xap"
iexplore "http://localhost/MyProj"
But when I add this and press build I get Exit code 9009.
It looks like its trying to execute a full single sommand but they are 2 seperate commands
The error from VS
Error 1 The command "copy "C:\Users\admin\Documents\Projects\MyXap\Bin\Debug\MyXap.xap" "C:\www\Proj\ClientBin\MyXap.xap"
iexplore "http://localhost/MyProj"" exited with code 9009. MyXap
Starting Internet Explorer appears to be the problem. At least two problems I saw, I needed to specify the full path and force the exit code to 0. No real idea why any of this is necessary. This test post-build event worked:
copy "$(TargetDir)$(ProjectName).exe" "c:\temp\test.exe"
"c:\program files (x86)\internet explorer\iexplore" "http://stackoverflow.com"
exit /b 0
Do note that it is very unusual to write a post-build event like this. It will only run if another file in the project requires recompilation. So you won't get the browser running when you press F5 twice in a row. This is very rarely desirable, favor using the Project + Properties, Debug tab, "Start external program" option instead.
Related
I'm trying to copy a file from one folder to another folder using node-red but flow execute fine and throwing an error and also showing syntax error in the console
My flow:
Node Configuration:
exec command used
copy C:\Users\Karthikeyan.Anbalaga\Downloads\ID_NewOnePulse_results.csv C:\Users\Karthikeyan.Anbalaga\Downloads\Documents\
At the same time if I execute the file copy command in the terminal working well
>copy C:\Users\Karthikeyan.Anbalaga\Downloads\ID_NewOnePulse_results.csv C:\Users\Karthikeyan.Anbalaga\Downloads\Documents\
1 file(s) copied.
I did a mistake on the configuration, after removing the msg.payload works fine and also files I can see in the destination folder.
I have an editor in my program and dynamically write commands and execute them. I want to move all files and folders inside myPublish directory to current directory by child_process exec. I use robocopy command in windows. when I test robocopy in cmd, it works correctly:
robocopy /s .\myPublish .\ /move
but in program, nodejs gives an unclear error message that just says:
"Command failed: robocopy /s .\myPublish .\ /move\n"
I've just hit this issue also. While most console applications should return an exit code of zero when there's no errors, robocopy has a series of custom exit codes. This makes Node think that there's been an error during execution, when there may not have been.
As per here, Robocopy has the following exit code bits that make up the exit code:
0×10 Serious error. Robocopy did not copy any files. This is either a usage error or an error due to insufficient access privileges on the source or destination directories.
0×08 Some files or directories could not be copied (copy errors occurred and the retry limit was exceeded). Check these errors further.
0×04 Some Mismatched files or directories were detected. Examine the output log. Housekeeping is probably necessary.
0×02 Some Extra files or directories were detected. Examine the output log. Some housekeeping may be needed.
0×01 One or more files were copied successfully (that is, new files have arrived).
0×00 No errors occurred, and no copying was done. The source and destination directory trees are completely synchronized.
To fix this, you need to catch the error and inspect the error code:
const cp = require('child_process');
try {
cp.execSync('robocopy ...');
} catch (err) {
console.log(err.status); // get the return code
console.log(err.output.toString()); // get robocopy's full output
}
I think you would generally consider a code greater than 8 to be a more serious error.
I am building an application in node.js with VS Code...
the application have multiple .js files:
buyBOT.js
getDeposit.js
getTransaction.js
when I run the debug I would expect to run within the selected .js file, but instead it always stars to run in the first .js file (buyBOT.js)...
For example:
Scenario 1) I am in the buyBOT.js I "press F5" to start debug and everything is fine... (buyBOT.js debugging)
Scenario 2) I am in the getDeposit.js I "press F5" to start debug and instead of running the code in getDeposit.js, the debugger bring up buyBOT.js and start the debug there.
What am I doing wrong? is there a parameter to change/set?
We have started migrating our one of several projects to team city as part of CI. Below is how we have setup teamcity build. We are trying to deploy WebSite.
1) Build Step 1 (Package installation)
Using "command line " runner type install required package.
2) Build Step 2 (Build)
Using Runner type "Visual Studio (sln)" (Visual Studio 2010) build website.
3) Build Step 3 (Deploy Web Site)
Using ".Net Process Runner", deployer.exe (x86 built with .Net Framework 4) deploy site.
Deployer.exe reads config file. Config file contains "BuildId", "Environment" and "Servers" where we want build to be pushed.
<buildType id="bt52">
<env name="Debug">
<server path="SERVER1" />
</env>
<env name="QA">
<server path="SERVER2" />
<server path="SERVER3" />
</env>
<env name="UAT">
<server path="SERVER4" />
<server path="SERVER5" />
</env>
</buildType>
Deployer.exe is called with required parameters as below. Which reads config and deploys site to Server2 and Server3.
Deployer.exe "bt52" "QA" "siteQA" "E:\BuildAgent\work\2483052e33e5e1e8\src\diy\" msdeploy.exe
Problem area is step #3.
When we run deployer.exe using .Net process runner as part of team city we see its hanging and not responsind sometime even for 45 minutes. When we try to execute same deployer.exe from build server using command line script executes within couple of seconds.
E:\TeamCity_custom_applications\deployer>Deployer.exe farm1-1 QA siteQA E:\BuildAgent\work\2483052e33e5e1e8\src\diy\ msdeploy.exe
Info
: Processing batch run ... Info : Processing command ...msdeploy.exe
-verb:sync -source:contentPath="E:\BuildAgent\work\2483052e33e5e1e8\src\diy\" -dest:contentPath="siteQA",wmsvc="SERVER2",userName="*****",password="******",authType="Basic"-skip:objectName=filePath,absolutePath=web.config -skip:objectName=dirPath,absolutePath="bin" -enableRule:DoNotDeleteRule -allowUntrusted Info : output >>Total changes: 0 (0 added, 0 deleted, 0 updated, 0 parameters changed, 0
bytes copied) Info : error >>(none) Info : ExitCode >> 0 Info :
Processing command ...msdeploy.exe -verb:sync
-source:contentPath="E:\BuildAgent\work\2483052e33e5e1e8\src\diy\" -dest:contentPath="siteQA",wmsvc="SERVER3",userName="******",password="******",authType="Basic"
-skip:objectName=filePath,absolutePath=web.config -skip:objectName=dirPath,absolutePath="bin" -enableRule:DoNotDeleteRule -allowUntrusted Info : output >>Total changes: 0 (0 added, 0 deleted, 0 updated, 0 parameters ch anged, 0
bytes copied) Info : error >>(none) Info : ExitCode >> 0
Info: Deploy Script Complete.
One more thing we observed is running deployer.exe through teamcity I see that site content gets copied but only for 1 server and teamcity build status stays in "Running" mode. I am wondering if someone can please put little bit of insight on how can I look into this issue.
Update 1:
Thanks for your time looking into it !! What we ended up doing is, Instead of running command "msdeploy.exe" from "cmd.exe" we added "msdeploy.exe" location as Environment variable and executed "msdeploy.exe" in loop for # of servers. This has resolved issue of hanging. Now I am just curious to know why would it behave in such manner where if you execute "msdeploy.exe" from "cmd.exe" it would hang while running directly "msdeploy.exe" it would execute successfully. Any insight into same would be greatly appreciated.
Update 2:
I have added image which explains behavior using process explorer. If we kill msdeploy.exe from process explorer than for next all deployments to that server will not have the issue of build hanging. Please see below image
To be honest, it sounds like you're running into issues with redirecting input/output streams. TeamCity is running your application in a totally headless environment and then you, in turn, are attempting to redirect and parse the output of msdeploy.exe
If that's the case, I'd recommend looking into using the MSDeploy API instead of msdeploy.exe. The latter is just a command line wrapper for the former, so all the functionality is available to you. There's a sample deployment application available on the IIS blog if you need help getting started.
It seems you have NUnit build step configured in TeamCity and invoke cmd.exe from your test. This looks like an issue with the test code then. Most probably it will reproduce without TeamCity if you run the test in question with NUnit directly.
As Richard noted, most probably the issue root cause is related to stdin/stdout processing.
If you want to fix it in your code, you can try to experiment by explicitly closing stdin or the other way around, try writing something into it, etc.
Work around we did is, we observed msdeploy doesn't take more than 3-5 seconds to execute and deploy (Even for our biggest project which is almost 300mb website). So we set timeout of 20 seconds. So far since last 1 weeks we have not seen any issue with it and hopefully it will not cause more trouble but still we are not sure why such behavior.
So, I'm having this odd issue with my CruiseControl.net project. I have a ccnet.config file that goes and pulls from my bitbucket repo, runs a basic build, then runs some unit tests, and then finally copies the tested files out to the webroot. Seems pretty basic, even for being my first time using CC.Net.
I, of course, would like this to run when I do commits. Failing writing some sort of web page that bitbucket can invoke through it's services framework, I settled for having CC run a scheduled build, and only run the full build if there's source control changes.
After some googling, I found out that in 1.6, it has a cronTrigger. Excactly what I need. So, I add the following chunk to my config:
<cronTrigger>
<cronExpression>*/5 * * * *</cronExpression>
</cronTrigger>
Then it triggers fine, but then I get a loop of this in the console:
[HMS:INFO] Calling hg log -r tip --template {rev} --noninteractive
[HMS:DEBUG] Starting process [C:\Program Files (x86)\TortoiseHg\hg.exe] in working directory [C:\build\hms\src] with arguments [log -r tip --template {rev} --noninteractive]
[HMS:DEBUG] Not setting PriorityClass on [C:\Program Files (x86)\TortoiseHg\hg.exe] to default Normal
[8:DEBUG] [HMS C:\Program Files (x86)\TortoiseHg\hg.exe] standard-error stream closed -- null received in event
[7:DEBUG] [HMS C:\Program Files (x86)\TortoiseHg\hg.exe] 60
[7:DEBUG] [HMS C:\Program Files (x86)\TortoiseHg\hg.exe] standard-output streamclosed -- null received in event
[3:DEBUG] [HMS C:\Program Files (x86)\TortoiseHg\hg.exe] process exited event received
[HMS:INFO] No modifications detected.
This loop continues until I go in and remove the cronTrigger block. I don't really want this thing busy-waiting on my server for a change, and I'm sure BitBucket doesn't smile upon several requests per second.
So, in short, how do I stop this thing from molesting bitbucket? Stop using CC.Net? Resign myself to hitting the "Build" button?
Also: my ccnet.config file for reference: http://pastebin.com/6jSPxVTk
I said screw it, I moved to Hudson instead. A bit heavier on my server, but it supports a URL to post to, so I can drop that into BitBucket's "Services" option, so no polling.
I also get a free Jabber bot, and Chuck Norris.