Sails Js - how i can make an automated task - node.js

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).

Related

How to get current workflow properties from node.js?

I have several GitHub actions created with workflow *.yml files. They run automated tests.
On each scheduled run of these workflows, I need to get some properties from the current workflow from my node.js code that is running. For example name.
How do I do that?

How to trigger a script in Netsuite using API

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.

Jenkins - mass change method/tool to change builds

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

Using jenkins to modify files

I've just started to get to grips with Jenkins. It currently performs the following tasks:
Pulls the latest codebase from git
Uploads the codebase via sftp to my environment
Sends a notification email to the testers and the PM to inform them of a completed deployment.
However for it to be truly useful I need it to perform two more tasks:
Delete the robots.txt and .htaccess file which exists in the git repo and replace it with a predefined version which is specific for the server
Go through all the code and remove specific code-blocks (perhaps something in between comments: eg. /** Dev only **/ Code to be removed goes here /** Dev only **/ or something like that).
Are there any plugins which can accomplish these things or would I have to read up on writing groovy scripts for this sort of thing (I don't know anything about those yet).
On a related note: I'd also love it if it could combine kit and SASS files, however I can't see a plugin for these things, however I assume I can just install compass on my build server and then run it via command line in the build process. Is that correct?
Instead of putting your build tasks directly into the Jenkins job, I recommend writing a build script to accomplish your publishing/deployment tasks.
Jenkins is great for having a single point of automation that is easy to run, can publish build results, and can track successes and failures. In my experience though, you're better off not putting your individual tasks and configuration steps into the Jenkins job configuration. At some point, you'll want to be able to run this job without Jenkins, either because you want to test local changes, or you want to handle multiple jobs and trying to keep job configurations in sync is not fun, or because you're moving to another build/deployment system. Also, putting the build script into a file allows you to put it into your source control system and track changes.
My advice: choose a scripting language (Python, Ruby, Perl, whatever you're comfortable with) or build system (SCons and Rake are options) and write a build script. In Python Ruby, and Perl, it's easy to manipulate files (#1) and all have a wide choice of templating systems that will accomplish #2. Then the Jenkins job becomes running your build script on the command line (or executing through a language-specific builder). And the build script can include running any of the tasks that you decide to put in your build (compass, etc).

Call Poll SVN build trigger using Groovy Script in Jenkins

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!

Resources