I have a job named X, and I have a condition on X as below:
But interestingly, when the condition is not met and the job is aborted, trouble script is not run. Instead I get Executing SUCCESS.
Any idea?
Thank you!
Related
I'm trying to run a test script in an azure devops pipeline. I have a test that runs on my own environment but fails in the pipeline.
when I run the following code:
command = '['latexmk', '-pdf', '--interaction=nonstopmode', '/tmp/my_tex.tex']'
output = subprocess.check_output(command,
stderr=subprocess.STDOUT,
**check_output_kwargs)
Locally it finishes without errors. When I run it in the DevOps pipeline I get:
subprocess.CalledProcessError:
Command '['latexmk', '-pdf', '--interaction=nonstopmode', '/tmp/tmp78wpkv3l/Unknown.tex']'
returned non-zero exit status 12.
Which isn't very descriptive. Does anybody know how to solve this or get more descriptive error messages?
The problem was that latexmk was being run in the wrong folder, fixed with a simple os.chdir(<correct folder>)
I tried to execute two Power-shell script. 1st one is incorrect and 2nd one is correct but bamboo shows Successful build.
It really depends why the first script is "incorrect". If it is throwing an error code, by default it will still return a success, as the script successfully ran, even if the results were an error. You might want to look into using $LastExitCode after you call the Powershell script to get the status of the script itself.
I have a situation where I want to make the execution of my scripts smarter. I have a set of scripts that execute at a given time, but because sometimes the input files are not posted at the correct times the scripts run into errors and get unexpected results. so one of the solutions I was thinking of is to make the execution of the scripts dependent of each other. Here is what I mean:
script 1 runs at 6 pm
validates that the file is there
if it's there, set a flag
the flag is active so execute script 2 at 9 pm
if it's NOT there, the flag is not set
the flag is not set so script 2 is not executed
Right now script 1 and script 2 are set with the Task Scheduler at those times, I checked the Scheduler for those type of conditions, but didn't find anything.
You can set triggers in Task Scheduler, like when an event happens for basically everything you can see in eventviewer.
I would suggest Write-Eventlog from the script which works on the file, and depending on the result the sched task would get triggerd.
I suggest you to have single script running every N-minutes on single scheduled task via Task Scheduler.
The master script will analyze activities and have all logical conditions those determine when and which external script to run. You can also have flag files.
Consider an command which has to be executed more than once at the same time, I have created a bat file in which Start command is used to execute the command multiple times at once. But there are couple of problem I am facing,
After starting all the commands the main batch file is closed. It is not waiting until the new command window has done its job.
We are not able to keep track of the progress in new windows, for example consider the commands are executed from team city(CI) then the progress is not tracked.
Please help me on this, Thanks in Advance!
1) - Use START "" /WAIT, than start command wait till started process terminate, than continue running batch file.
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)