How to get current workflow properties from node.js? - 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?

Related

Azure Pipeline Check is any builds are running in different azure pipeline task

So to give you a bit of context we have a service which has been split into two different services ie one for the read and one for the write side operations. The read side is called ProductStore and the write side is called ProductCatalog. The issue were facing was down the write side as the load tests create 100 products in the write side resource web app and then they are transferred to the read side for the load test to then read x number of times. If a build is launched in the product catalog because something new was merged to master then this will cause issues in the product store pipeline if it gets run concurrently.
The question I want to ask is there a way in the ProductStore yaml file to directly query via a specified azure task or via an AzurePowershell script to check if a build is currently running in the ProductCatalog pipeline.
The second part of this would be to loop/wait until that pipeline has successfully finished before resuming the product store pipeline.
Hope this is clear as I'm not sure how to best ask this question as I'm very new to the DevOps pipelines flow but this would massively help if there was a good way of checking this sort of thing.
As a workaround , you can set Pipeline completion trigger in ProductStore pipeline.
To trigger a pipeline upon the completion of another, specify the triggering pipeline as a pipeline resource.
Or configure build completion triggers in the UI, choose Triggers from the settings menu, and navigate to the YAML pane.

How to test Azure Pipelines

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.

Bundle synchronization in B2C project

I am working on a B2C project.
We are using customized bundle implementation in our project.
However we were struggling with making bundle synchronization work.
With some effort, we managed to find the ImpEx to synchronize the Bundle:
UPDATE CatalogVersionSyncJob;code[unique=true];roottypes(code)[mode=append];
;$syncJobCode;BundleTemplate,BundleTemplateStatus;
However, I am worried whether this will also synchronize the ChangeProductPriceBundleRule available out of the box.
Also how do I synchronize this from backoffice?Is running this cronjob from the Backoffice the only solution?How do Backoffice users see a Synchronize button?Is creating a separate node necessary?
How to synchronize from backoffice?
Go to Backoffice
System -> Background Processes -> Jobs
Search for your sync job and use Sync button for panel
Is running this cronjob from the Backoffice the only solution?
You can schedule this job to run on specific interval (Cron Job)
Is creating a separate node necessary?
Not necessarily but you can customize if you want.
Hope it helps!

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.

Script Deployment Management Tool for NetSuite

We are looking at removing developers from production and want a simple kind of deployment management tool. One suggestion that some members are using with SalesForce is Jenkins. I have never used Jenkins or any kind of deployment tool before. I normally just copied my code from IDE and updated the file in the SuiteScript file cabinet.
Does Jenkins work for NetSuite? Or what do you recommend for this purpose?
We are planning to use Bit Bucket (which runs Git in the background) as our version control in case that matters.
Thank you for any help
IMO the greatest challenge in integrating with any CI environment(be it Jenkins or any other) is the fact that you can move code files from one system to another using code/APIs but, NOT things like scripts, custom records, fields its deployments , etc. for which you need a bundling process and hence, manual intervention.
NetSuite in recent Suiteworld 2015 said that its coming up "Change Management" which would allow you to put everything that is part of your app to version control system such as git. Please see SuiteAnswer Id 42387, when this feature is rolled out, you can integrate with your CI tool to automatically copy/deploy your app details to an another NetSuite account and run your tests there and accordingly pass/fail your build.
Why do you want to remove developers from Production? This will severely hamper their ability to create solutions for your NetSuite account and will create a ton of overhead for them.
If you must have them out of Production, then probably your "best" option would be to have them build their solutions in Sandbox and then use SuiteBundles for deployment to Production. A Production Admin would need to update the appropriate Bundle(s) for all Production migrations.
NetSuite has also built a SuiteCloud IDE plugin for Eclipse which allows uploading and downloading files (no copy-paste necessary), so if you're not using that I would recommend it.
We are using Jenkins for our own internal automated testing, but not for deployment into NetSuite. I do not know if someone has already built a NetSuite plugin for Jenkins; it is likely you would have to build your own file upload mechanism using the NetSuite Web Services SOAP API, but that would still only allow deployment of source files. Developers will most likely also need to be creating and updating custom records, fields, lists as well as Script records and Script Deployment records, which you will not be able to do through Jenkins or any other tool that I know of.

Resources