Testing Package Creation
Testing Scenario
In this example, you will set up files that allow a packaging admin to save their credentials and only need to provide the CryptoKey on the CLI when creating packages. This makes it more convenient to share PackagesFiles with other admins since it would not need to contain login credentials and you also would not need to specify them on the command line each time you run the Create Packages command.
Creating a Test PackagesFile and DefaultsJSON
To create a test PackagesFile and DefaultsJSON, complete the following steps:
- From your Primary Packaging Manager or the Remote Packaging CLI, create your
PackagesFilefrom one of the following: -
Copy
primary-client.exe Add PackagesFile /PackagesFile "%USERPROFILE%\Desktop\PackagesFile.json" /Name "Notepad++ v8.1.1" /Path "\\fileserver\FlexApp\Packages" /Installer "\\fileserver\FlexApp\Installers\npp.8.1.1.Installer.exe" /InstallerArgs "/S" -
Copy
primary-client.exe Add PackagesFile /PackagesFile "%USERPROFILE%\Desktop\PackagesFile.json" /Name "PuTTY Utils v0.76" /Path "\\fileserver\FlexApp\Packages" /Installer "\\fileserver\FlexApp\Installers\putty-0.76-installer.msi" - Next, create the
DefaultsJSON: -
Copy
primary-client.exe Create DefaultsJSON /DefaultsJSON "%USERPROFILE%\Desktop\defaults.json" /PrimaryUsername "fpa_services" /PrimaryPassword "<pass>" /PathUsername "<domain\user>" /PathPassword "<pass>" /PuAddress <https://ProuServerAddress:8000> /PuUsername "<domain\user>" /PuPassword "<pass>"
Testing Your Packaging Job
Test your packaging job by creating the specified packages. First check your Capture Agents are available:
Primary-Client.exe list agent /PrimaryUsername "fpa_services" /PrimaryPassword "<pass>"
Method 1
Create Packages using PackagesFile and DefaultsJSON, wait for the job to finish:
primary-client.exe Create Packages /PackagesFile "%USERPROFILE%\Desktop\PackagesFile.json" /DefaultsJSON "%USERPROFILE%\Desktop\defaults.json" /WaitForDone
*Example console status when complete:
--------------------------------------------------------------
Batch Job Report
Total:1 Pending:0 Running:0 Successful:1 Failed:0 Cancelled:0
Batch Job Id:'9871' Status:'Successful'
Start:'11/8/2024 10:04:11 AM' End:'11/8/2024 10:06:04 AM'
Primary Job Name:'Notepad++' Id:'9f1b' Status:'Successful'
Start:'11/8/2024 10:04:12 AM' End:'11/8/2024 10:05:44 AM'
ExitCode:'0'
Agent Job Name:'Notepad++' Id:'a9f5' Status:'Successful'
Start:'11/8/2024 10:04:13 AM' End:'11/8/2024 10:05:43 AM'
ExitCode:'0' RunLocation:'10.30.61.243'
--------------------------------------------------------------
Method 2
Create Packages using PackagesFile and DefaultsJSON in background, email results:
primary-client.exe create Packages /PackagesFile "%USERPROFILE%\Desktop\PackagesFile.json" /DefaultsJSON "%USERPROFILE%\Desktop\defaults.json" /MailServer <smtp.something.com> /MailFrom <x@y.com> /MailTo <a@b.com>
*Example email status when complete: (condensed)
| Job Name | Status | Agent | MM:SS | Installer | Installer Args | Type | VHD MBs |
|---|---|---|---|---|---|---|---|
| Notepad++ v8.1.1 | Successful | Agent1 | 0:30 | npp.8.1.1.Installer.exe
|
/S
|
Cloud
|
196.00
|
| PuTTY Utils v0.76 | Successful | Agent2 | 0:31 | putty-0.76-installer.msi
|
|
Cloud
|
164.00
|
PackagesFile and DefaultsJSON File Contents
- The example file contents will look like this (excluding the unspecified parameters).
packagesfile.json
"Name": "Notepad\u002B\u002B v8.1.1"
"Path": "\\\\fileserver\\FlexApp\\Packages"
"Installer": "\\\\fileserver\\FlexApp\\Installers\\npp.8.1.1.Installer.exe"
"InstallerArgs": "/S"
"Name": "PuTTY Utils v0.76"
"Path": "\\\\fileserver\\FlexApp\\Packages"
"Installer": "\\\\fileserver\\FlexApp\\Installers\\putty-0.76-installer.msi"defaults.json
"PrimaryUsername": "537F6AA867FB405lookatmeimencrypted3u9Mt3sXxGcaigPxIngPqyw=="
"PrimaryPassword": "537F6AA867FBlookatmeimencryptedz1MjK/h/ZdYpPBuMyg\u002BQ=="
"PathUsername": "537F6AA867FB4lookatmeimencryptedA8\u002BycoKQXBOgZ5g=="
"PathPassword": "537F6AA867FB40598lookatmeimencryptedVysei\u002BXyj1EJakAQ=="
"PuAddress": "https://MyProuServerAddress:8000"
"PuUsername": "537F6AA867FB405989836E5EDlookatmeimencrypted02BycoKQXBOgZ5g=="
"PuPassword": "537F6AA867FB4059898lookatmeimencryptedj1EJakAQ=="
- Editing your
PackagesFilecan be done with a text editor or by usingprimary-client.exe(Add PackagesFile, Remove PackagesFile, List PackagesFile, Clear PackagesFile). - The
DefaultsJSONworks a bit differently than thePackagesFilein that theprimary-client.exe Create DefaultsJSONcommand is used to completely overwrite the file with a new file containing only the newly specified parameters. Therefore, a text editor is likely the easiest method to adjust any non-encrypted values. - When adding information into a
PackagesFileorDefaultsJSON, you have two encryption options for user/pass fields. Users can never see the credentials stored in these files. Refer to the Notes About Encryption and Log Paths section of this guide for more information.
