I have a ScriptTrigger scheduled for a job to run every 2 hours, now including some of the action from the scripts, i also want to look for any changes in SVN.
The easiest way using POLL SCM build trigger together with script trigger this works fine , but in each schedule if at all my script trigger wants to schedule a build and if my poll SCM also detect change there will be two builds done which is redundant.
To avoid this I need to write a groovy scrip to do the function poll SCM does on its schedule, Can anybody help with groovy script to see if the are any changes in SCM (SVN)?
Or is there any way to combine this triggers for single schedule and trigger, I already have this question asked here .
Thanks in advance!
Related
Is any possibility to test created Azure Pipelines? From UI or your yaml definition of pipelines?
Mean that I have some yamls pipelines or pipelines defined from UI and I want to ensure by some tests(Unit Tests e.x.) that all have defined variables, build, test, and package parts or something else in each pipeline.
And verify pipelines configurations after some changes of them or after adding some new repos/branches if it's required.
Thanks...
Is any possibility to test created Azure Pipelines? From UI or your
yaml definition of pipelines?
If you want a out of box feature to achieve this, sorry to say, No, there hasn't.
BUT, the work around is using API to check them.
Client API.
You could write a simple script to get Builds definition with Client API.
In this simple script, you first get the whole definition:
List<BuildDefinitionReference> buildDefinitions = new List<BuildDefinitionReference>();
Then you could apply your customized check/test into this definition with scripts. In one word, write some test classes/methods. After the script complete, you can import it into VSTS, and then use task to run those tests part. Only this test succeed, then your builds could be executed.
So, at this time, it need you add 2 agent jobs into your pipeline, the first one is used to run your script test(names test agent job). And the second agent job is the one you want to check. In the second agent job, set its condition as:
At this time, only the test succeed, this current job can be ran.
Or, if you don't want the builds you want to check would be broken because of the test, please consider about using Build completion trigger. Set a separate pipeline to run the test. In the pipeline you want to check, set it can be run only when the test pipeline finished.
Rest API
You could use rest api with powershell which very similar with the above description. Use api to get builds definition, and then write some check powershell script.
I more recommend you to put the test at a separate pipeline. Then the API could only get the part you want check, not including the test part.
I am new to Netsuite. My company has a Netsuite instance with many customization scripts. Currently we are doing some automated testing, so we need that script to be executed for loading data from external system.
Most of those scripts are scheduled for 1 hr. In order to avoid the wait for scheduled run I am wondering if there is any way to trigger those scripts using APIs ondemand ?
As far as I am aware the only way you could do that, would be to write a RESTlet that you could call externally. Are these all scheduled scripts, or also Map/Reduce? Are you specifically needing to run the scripts externally, via an external call?
If you do not need to run them externally, the best way would be to simply unschedule the deployment (or just make a duplicate deployment - depending on whether the deployment ID is hardcoded in a call in the script), and save and execute that deployment. That will trigger the script to act as though it was time for it to run.
If you need to call it externally, I'd just write a simple GET RESTlet that calls the scheduled script. You can find information about that here at these two links.
*Make sure you are logged into NetSuite before trying to click the links
SuiteScript 2.0 RESTlet Script Type
task.ScheduledScriptTask
Hope that helps out.
I have an API that checks for holiday and runs/not runs a build based on the result. The problem now is that I have to manually change Jenkins jobs to include that logic which is obviously very inefficient. Is there a way/tool to quickly add/remove that check or any other checks in the future to specific jobs quickly without going through them one-by-one? I could see maybe using Jenkins API as one option, is there anything else?
Thanks.
User JobDSL you can programmatically solve your problems in one place with a Groovy DSL.
https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
I have a quite simple question. We have setup Gitlab CI and want to allow auto merge as soon as the build succeeds for some of our branches.
Thing is, we see that the build passes, but the merge does not actually happen and the status stays at "to be merged automatically once the build succeeds".
Do you have any idea why?
I attached a screenshot of the bogus behaviour.
EDIT: Some additional information that was requested:
It looks like no background job is put in the queue where I activate a "automatic merge when build succeeds
When a build finishes running, no background jobs is triggered as far as I can see. Nothing new being scheduled, dead or in progress.
I also don't see anything crazy or ERROR like in the logs.
Two screenshots of my dashboard as a MR with an automated build runs :
Thanks,
Julien
Maybe your merge job is scheduled or dead.
Use your admin account and click the Admin Area button.
Click Monitoring -> Background Jobs
Then,click the dashboard and check the if your merge job is in the Scheduled queue or Dead queue.
I want make an automated task inside sails, this task should check some variables in db and do something but.. idk how to make it, i search about grunt task, but nothing usefull. Anyone now how i can make an automated task without interaction with client?
If it isn't trigger by your client why don't you use another script run by cron(or any other task schedular program).