Bluemix IDS Pipeline build hangs on bower install - ibm-cloud

I created a shell script build with the IDS Pipeline.
The last line doesn't seem to return for a long time (34 minutes once, 51 minutes before that).
The command is: bower install
It runs in < 1 minute locally. And I can see it run fast in the IDS pipeline build output too (command output is printed). It just doesn't exit for a long time.
Any clues how to debug what's going on?
Thank you, Dan

Related

controlling teamcity steps using powershell

I have the following scenario.
I have 5 build steps in teamcity for a project . I want 5th step to be executed only if the branch is master. The team city process should exit without executing 5th step if the branch is not master. Is it something I can achieve through powershell?
I think the only way to do this is to have a powershell step as step 5 which simply checks the current branch (%teamcity.build.branch%) and errors if its not master, then have the step that you want to run which is currently step 5 as step 6.
Team city doesn't always like to fail if the powershell steps fail, especially in versions before the current one.
To get around this we use the as the source script, but it assumes the script you want to run is in source control:
& "%teamcity.build.checkoutDir%\Path\To\PowershellScript.ps1" "%teamcity.build.checkoutDir%"
Write-Host "The result was of the previous script was " $LASTEXITCODE
Exit $LASTEXITCODE
The linked answer contains more options depending on which version you are using, so I'll assume you can find exactly how to get a failure to stop the build there.

Use cygwin to run a batch file and email results

I am new to using cygwin and don't really understand how the scripting of it works. Currently I am running it on Windows 7 and using task scheduler to do this inefficiently.
What I want to do is to run a .bat file already made that runs tests in the cmd line and than take the results of that test and email that people.
Some side notes:
1. It doesn't HAVE to be a batch file, from my reading I think maybe a .sh would be easier to run with bash. Being able to run it on CentOS would be even better, that way others can run if I leave.
2. This needs to run daily. I would like to run the batch file at around 10 am and give it an hour till the emailed results are sent, unless you can trigger the email when the .bat is done.
3. Every time I run this .bat file it saves the results to a .htm file and overwrites it every time the .bat is run.
Thank you
That could be in the crontab for a a centOS server (/etc/crontab)
0 10 * * * user cd /path/ && /bin/bash file.sh >> result_file
Is that what you needed ? Also, you can install Cron as a windows service with cygrunsrv

perl based cron job won't write to mounted cifs/windows share ONLY after long inactivity

I'm not sure how to title that more succinctly and still have it be meaningful.
(Note that this works fine when run mid-day, via cron or manually, so I "know" the script itself is sound.)
I have a cron job (ubuntu 13.04.)
It runs as my user (not root.)
The job itself runs at 6:00 in the morning. It's the first 'business level' job that runs all day.
1 6 * * 1-5 /home/me/bin/run_perl_job
run_perl_job is just:
#!/bin/bash
cd /home/me/bin
./script.pl
The script copies a file to "/mnt/shared_drive/outputfile.xls"
The mount point is defined in fstab as:
//fileserver/share /mnt/shared_drive cifs user=domain/me%password,iocharset=utf8,gid=1000,uid=1000,sec=ntlm,file_mode=0777,dir_mode=0777 0 0
Now. Given that:
When I run the script in a normal shell, it works fine.
When I look at the mount point first thing in the morning (via a normal terminal) it shows up (and is writeable) without event.
When I copy the crontab line and set it to run in a couple minutes, to see the symptom, it works fine (creates the file quite happily.)
The ONLY time this fails is if it's running in its normal time slot (6:01). The rest of the script functions ( the file itself has to be pulled down via sftp, etc.) So I know it's not dying.
It's driving me batty because the test cycle is 24 hours.
I just added the following couple lines to the beginning of the 'run_perl_job' script, hoping it exposes something tomorrow:
cd /mnt/shared_drive
ls -lrt >>home/me/bin/process.log
But I'm stumped. "It's almost as though" the mount point had gotten stale overnight and is waiting for some kind of access attempt before remounting. I'd run "mount -a" at the top of the 'run_perl_job' script if I could reasonably do it. But given that it's got to be sudo'ed, that doesn't seem reasonable to me.
Thoughts? I'm running out of ideas and this test cycle is awful.
how about putting a
umount -f -v /mnt/shared_drive
mount -v -a
into a root cron job just before your script runs. That way you don't need to sudo in your script and have the password in plain sight. -v might give you a hint on what is happening to make it stale

calling winrs multiple times from TeamCity

if I run 2 winrs commands in the same Team City Command Line like this:
The build will hang.
if I manually kill the winrs process on the build agent, the build will finish but will exit with code 1.
if I run just one winrs command the build will pass.
If I split the winrs command into 2 different build steps the build will also pass.
If i put the two lines in a batch file and run that on the build agent it works also.
If i Put the two lines in a cmd file and run that on the build agent as the build agent user it works also.
Does anyone have any idea what's going on here/how to fix this?
I'm hoping either a Team City or winrs guru can help me.
Prefix your commands with START /WAIT
yes, START /WAIT works, even with winrs requests to multiple servers in the same build step
it won't return the output though

simple command prompt one line into exe

I have a perl script that I run from the command prompt: 3 times a day, the problem is now I need to run it every two hours. Im not going to be on an episode of lost so I need some help. Here is the command:
Perl C:/test/scripts/edi.pl
Does anyone know how this above one line command can be made into an executable (.exe) file so I can use the task scheduler to run?
If there is another way to do this with the task scheduler to run once every two hours every day then I could do that as well.
Thanks for your time.
Can you not simply create a batch file that runs the script, and set that batch file to run every two hours? I know from a quick test there that I can schedule a batch file to run from Task Scheduler on Windows XP at least.
You can actually use the task scheduler to run that exact command without a batch.
The task scheduler should allow you to pass some arguments to the script without a problem (I have done this on a few Windows servers in order to have them run PHP scripts)