Time for action—executing the hello world job from a terminal window

In order to run the job from a terminal window, follow these instructions:

  1. Open a terminal window.
  2. Go to the directory where Kettle is installed.
    • On Windows systems type:
      C:pdi-ce>kitchen /file:c:/pdi_labs/hello_world_param.kjb Maria -param:"HELLOFOLDER=my_work" /norep
      
    • On Unix, Linux, and other Unix-like systems type:
      /home/yourself/pdi-ce/kitchen.sh /file:/home/yourself/ pdi_labs/hello_world_param.kjb Maria -param:"HELLOFOLDER= my_work" /norep
      
  3. If your job is in another folder, modify the command accordingly. You may also replace the name Maria with your name, of course. If your name has spaces, enclose the whole argument within"".
  4. You will see how the job runs, following the log in the terminal:
    Time for action—executing the hello world job from a terminal window
  5. Go to the output folder—the folder pointed by your LABS_OUTPUT variable.
  6. A folder named my_work should have been created.
  7. Check the content of the folder. A file named hello.txt should be there. Edit the file. You should see the following:
    Hello,Maria!
    

What just happened?

You ran the job with Kitchen, the program that executes jobs from the terminal window.

After the name of the command, kitchen.bat or kitchen.sh, depending on the platform, you provided the following:

  • The full path to the job file: /file:c:/pdi_labs/hello_world_param.kjb
  • A command-line argument: Maria.
  • A named parameter, and a -param:"HELLOFOLDER=my_work"
  • The switch /norep to tell Kettle not to connect to a repository

After running the job, you could see that the folder had been created and a file with a custom "Hello" message had been generated.

Here you used some of the options available when you run Kitchen. Appendix B tells you all the details about using Kitchen for running jobs.

Have a go hero—experiencing Kitchen

Run the hello_world_param.kjb job from Kitchen, with and without providing arguments and parameters. See what happens in each case.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.167.170