Passing params in Spoon (Pentaho) Transformation by command line - cmd

I'm using Pentaho Data Integration (Spoon) 8.1. I'm trying to passing parameters to a transformation using the command line. I'm using the sample writeback.ktr. This is my line:
java -jar launcher\launcher.jar -lib ..\libswt\win64 -main org.pentaho.di.pan.Pan -initialDir "C:\Users\Sistemas\Documents\Pentaho-Data-Integration"\ -file:"C:\Users\Sistemas\Documents\Pentaho-Data-Integration\samples\trans\writeback.ktr" -param="arg1=Boris" -param="arg2=Pedro" -param="arg3=Cristian" -level:Minimal
But it keeps creating the file without the values I'm passing to. I'm also try these other ways:
-param:"arg1=Boris"
-param:arg1=Boris
I'm using this configuration. Nothing seems to work. Can anyone help me please
Thanks

Below is the sample:
pan.bat /file:C:\Pentaho_samples\repository\repository_export.kjb
"/param:rep_name=PDI2000" "/param:rep_user=admin" "/param:rep_password=password"
"/param:rep_folder=/public/dev"
"/param:target_filename=C:\Pentaho_samples\repository\export\dev.xml"
Check below link for more clarification.
https://help.pentaho.com/Documentation/8.0/Products/Data_Integration/Command_Line_Tools

Well... after trying different alternatives, finally got a solution:
pan.bat -file:C:\trans\writeback.ktr "PDI2000" "admin"
This way, my transformation took the parameters.
Thanks.

Related

Jenkins: Facing issue Insert choice parameters in Goals and options

I want to run the Jenkins job which is as below, which is absolutly working fine:
clean verify -Denvironment=default -Dtags="type:NL" -Dwebdriver.driver=chrome -Dorganization=$organization -Dit.test=TC09_DBG_Debug_Features
For -Dtags="type:NL", with 'NL', i am having three different tags SE,DE and DEMO. Which is as below:
-Dtags="type:NL"
-Dtags="type:SE"
-Dtags="type:DE"
-Dtags="type:DEMO"
I decided to go with 'Choice parameters' in Jenkins having NL,SE,DE and DEMO as choices and name as 'Tenant'.
The problem i am facing is how to put choice parameters in Goals and options.
I tried
clean verify -Denvironment=default -Dtags= "-DpropertyName="$Tenant"" -Dwebdriver.driver=chrome -Dorganization=$organization -Dit.test=TC09_DBG_Debug_Features
but no help. Where am i going wrong. Thanks for help and try in advance.
Came up with a solution:
clean verify -Denvironment=default -Dtags="$Tenant" -Dwebdriver.driver=chrome -Dorganization=$organization -Dit.test=TC09_DBG_Debug_Features

How do I use my tsconfig file with ng-packagr?

I'm packaging an Angular 5 library with ng-packagr and I need to use my existing tsconfig.json. I've read the docs here https://github.com/ng-packagr/ng-packagr/blob/master/docs/override-tsconfig.md and it says I need to write a script (I was expecting an option in the config) and pass through the filepath to my tsconfig file.
I don't understand where I write this code? I guess this needs to be an NPM script? The documentation and example seems to be very minimal.
Help with this would be appreciated.
I did this by creating a build-package.ts file with the contents (but require not import) then did:
node build-package.ts.

Generate Swagger json at Build time

I'm working on a ASP.NET Core WebAPI project and I'm trying to find a way to generate swagger json at build time ?
As i'm working with 4 environments, i'd like to have 4 swagger.json with a different name of my choice, like:
swagger_{appName}dev{buildNumber}.json
swagger_{appName}demo{buildNumber}.json
swagger_{appName}int{buildNumber}.json
swagger_{appName}staging{buildNumber}.json
Is it also possible to edit the fields in the json ? I'd like to edit (depending of the environment) the following fields : host, schemes and basePath.
I'm using Swashbuckle.AspNetCore but it appears it doesn't have an option to do such task or am I wrong ?
Thanks in advance
You have the option of generating OpenApi json file(s) from the command line without deploying using the Swashbuckle.AspNetCore.Cli nuget package.
The command will look something like this and can be added as a "post build" script
dotnet <nugetpackages>\Swashbuckle.AspNetCore.Cli\bin\$(Configuration)\netcoreapp<ver>\dotnet-swagger.dll tofile --host http://localhost --output swagger.json <bin>\<AssemblyName>.dll v1
more details can be found here https://github.com/domaindrivendev/Swashbuckle.AspNetCore#swashbuckleaspnetcorecli
I'm not sure about generating separate files for each environment offhand
The simple way is using PowerShell task to update json file and save with another name.
Simple workflow:
Read the file through Get-Content script
Using ConvertFrom-Json to converts content to object
Set the property value to update object
Using ConvertTo-Json to convert an object to a JSON-formatted string
Using Set-Content to write content to a file
For detail code, you can refer to this thread: how do I update json file using powershell.
The build number value is stored in the predefined variable: Build.BuildNumber (PowerShell: $env:BUILD_BUILDNUMBER)

Code analysis VB6 Project with CodeSmart via command line

im using CodeSmart 3.4.6.297 to get code metrics from my vb6 projects.
now i want to include codesmart in my build-process using TeamCity.
i know that codesmart can be user in the command line. this works for me. i have my command line.xml file:
<sourcemonitor_commands>
<write_log>true</write_log>
<command>
<project_file>Path to xyz.smproj</project_file>
<project_language>VB</project_language>
<modified_complexity>true</modified_complexity>
<file_extensions>*.cs,*.Designer.cs,*.frm</file_extensions>
<source_directory>Path to Project</source_directory>
<include_subdirectories>true</include_subdirectories>
<checkpoint_name>Baseline</checkpoint_name>
</command>
</sourcemonitor_commands>
which generates a projectXYZ.smproj file.
My question now is...
how do i export data (code metrics like lines of code) from this smproj file using a console command?
i can get code metrics when i open my projectXYZ.smproj file in the codesmart IDE and exporting data using the menue "file...export Checkpoint details" but i need this in a console command
Any ideas?
Greetings
SLimke
Got it myself. had to add an export area to the command block
<export>
<export_file>PathToProject\Checkpoint1.xml</export_file>
<export_type>2 (checkpoint details as XML)</export_type>
<export_option>1 (do not use any of the options set in the Options dialog)</export_option>
</export>

Custom templates with phpDocumentor 2

I've been trying to get a custom template to work with PHPDocumentor (2) without much luck. The documentation on their site is incomplete and I'm kind of stumped.
What I've done is downloaded a copy of a complete template and reference it in my command, like so:
php phpdoc.php
--template=/path/to/customtemplate/
-d /path/to/php/source/files
-t /path/to/generated/content/
The command runs fine: it generates the documentation correctly but appears to be ignoring the --template option - at least, any changes I make to the template files in the /customtemplate folder are ignored.
Anyone have any idea?
(Thanks in advance!)
Ben
Instead of declaring the template command on the CLI you might try changing your phpdoc.dist.xml configuration file so that it pulls the template name or path from there directly.

Resources