Skip to content

Commit

Permalink
Merge pull request #1 from UiPath-Services/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
SE-Abdullah authored Oct 4, 2022
2 parents 003c2b4 + 24151dc commit 4f3031a
Show file tree
Hide file tree
Showing 17 changed files with 1,164 additions and 333 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scripts/test.ps1
scripts/uipathcli/*
test_scripts/*
*.csv
*.log

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ Until a generic solution is officially released, this unofficial library of DevO
- The provisioned vm or agent should be a window machine
- Add a step in your CI/CD pipepline to download the descired scripts. (Downlod only the scripts you need, for example if you want to Pack an RPA project then download UiPathPack script)
Use the scripts below as one step in your pipeline and give at any name (e.g. "Preparing Environment")
```PowerShell

It is recommended to download copy of the scripts from the [scripts folder](scripts) into your own repository
```PowerShell
#Create scripts folder under C drive. (you can change the directory path )
New-Item -Path "C:\\" -ItemType "directory" -Name "scripts";
Invoke-WebRequest "https://github.com/UiPath-Services/UiPath-DevOps-Scripts/raw/main/scripts/UiPathPack.ps1" -OutFile "C:\\scripts\\UiPathPack.ps1";
Invoke-WebRequest "https://github.com/UiPath-Services/UiPath-DevOps-Scripts/raw/main/scripts/UiPathDeploy.ps1" -OutFile "C:\\scripts\\UiPathDeploy.ps1";
Invoke-WebRequest "https://github.com/UiPath-Services/UiPath-DevOps-Scripts/raw/main/scripts/UiPathJobRun.ps1" -OutFile "C:\\scripts\\UiPathJobRun.ps1";
Invoke-WebRequest "https://github.com/UiPath-Services/UiPath-DevOps-Scripts/raw/main/scripts/UiPathRunTest.ps1" -OutFile "C:\\scripts\\UiPathRunTest.ps1";
Invoke-WebRequest "https://github.com/UiPath-Services/UiPath-DevOps-Scripts/raw/main/scripts/UiPathManageAssets.ps1" -OutFile "C:\\scripts\\UiPathManageAssets.ps1";
Invoke-WebRequest "https://github.com/UiPath-Services/UiPath-DevOps-Scripts/raw/main/scripts/UiPathAnalyzeProject.ps1" -OutFile "C:\\scripts\\UiPathAnalyzeProject.ps1";
Invoke-WebRequest "https://github.com/UiPath-Services/UiPath-DevOps-Scripts/raw/main/scripts/UiPathCLIGeneric.ps1" -OutFile "C:\\scripts\\UiPathCLIGeneric.ps1";
```


Expand Down Expand Up @@ -54,6 +57,8 @@ Five available scripts can be utilized
| [UiPathJobRun](docs/UiPathJobRun.md) | Trigger a job on Orchestrator. Click on the name for detailed documentation |
| [UiPathRunTest](docs/UiPathRunTest.md) | Tests a given package or runs a test set. Click on the name for detailed documentation |
| [UiPathManageAssets](docs/UiPathManageAssets.md) | Manage uipath orchestrator assets. |
| [UiPathAnalyzeProject](docs/UiPathAnalyzeProject.md) | Check project(s) for workflow analyzer violations |
| [UiPathCLIGeneric](docs/UiPathCLIGeneric.md) | This script is designed for those who know how to work with uipcli.exe and would like to call the cli directly. This script will pass the provided parameters as is directly to uipcli.exe. |

---

Expand All @@ -76,4 +81,4 @@ Each script will log all output to its own `*.log` file and sometimes to the con
* Test Run
* asset delete
* asset deploy

* package analyze
73 changes: 73 additions & 0 deletions docs/UiPathAnalyzeProject.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

# UiPathPack
Check project(s) for workflow analyzer violations
```PowerShell
SYNTAX
. 'C:\scripts\UiPathAnalyzeProject.ps1' <project_path> [-analyzerTraceLevel <analyzer_trace_level>] [-stopOnRuleViolation <true|false>] [-treatWarningsAsErrors <true|false>] [-saveOutputToFile] [-ignoredRules <activity_1_id,activity_2_id,activity_3_id,activity_4_id>] [-orchestratorUrl <orchestrator_url> -orchestratorTenant <orchestrator_tenant>] [-orchestratorUsername <orchestrator_user> -orchestratorPassword <orchestrator_pass>] [-orchestratorAuthToken <auth_token> -orchestratorAccountName <account_name>] [-orchestratorFolder <folder>]
Examples:
. 'C:\scripts\UiPathAnalyzeProject.ps1' "C:\UiPath\Project\project.json"
. 'C:\scripts\UiPathAnalyzeProject.ps1' "C:\UiPath\Project\project.json" -analyzerTraceLevel "Error"
. 'C:\scripts\UiPathAnalyzeProject.ps1' "C:\UiPath\Project\project.json" -analyzerTraceLevel "Error" -stopOnRuleViolation true
. 'C:\scripts\UiPathAnalyzeProject.ps1' "C:\UiPath\Project\project.json" -analyzerTraceLevel "Error" -stopOnRuleViolation true -treatWarningsAsErrors true
. 'C:\scripts\UiPathAnalyzeProject.ps1' "C:\UiPath\Project\project.json" -analyzerTraceLevel "Error" -stopOnRuleViolation true -treatWarningsAsErrors true -resultPath "C:\UiPath\Project\output.json"
. 'C:\scripts\UiPathAnalyzeProject.ps1' "C:\UiPath\Project\project.json" -analyzerTraceLevel "Error" -stopOnRuleViolation true -treatWarningsAsErrors true -resultPath "C:\UiPath\Project\output.json" -ignoredRules "ST-NMG-009,ST-DBP-020,UI-USG-011,ST-DBP-020"
. 'C:\scripts\UiPathAnalyzeProject.ps1' "C:\UiPath\Project\project.json" -analyzerTraceLevel "Error" -stopOnRuleViolation true -treatWarningsAsErrors true -resultPath "C:\UiPath\Project\output.json" -ignoredRules "ST-NMG-009,ST-DBP-020,UI-USG-011,ST-DBP-020" -orchestratorUrl "https://orchestratorurl.com" -orchestratorTenant "default" -orchestratorUsername "username" -orchestratorPassword "\_ye5zG9(x" -orchestratorAuthToken "AuthToken" -orchestratorAccountName "AccountName" -orchestratorFolder "OrchestratorFolder"
#Note: if the script folder location is different, you need to replace "C:" with directory folder (e.g. '[FOLDER_VARIABLE]\scripts\UiPathPack.ps1')
```

More on different authentication options here [UiPathAuthenticationsOptions](UiPathAuthenticationsOptions.md)

Script Parameters
- `project_path`
Required. Path to a project.json file or a folder containing project.json files.

- `analyzerTraceLevel`
Specifies what types of messages to output (Off|Error|Warning|Info|Verbose).

- `stopOnRuleViolation`
Fail the job when any rule is violated.

- `treatWarningsAsErrors`
Treat warnings as errors.

- `resultPath`
The full path to a JSON file where the result json file will be created. Otherwise print it to the standard console.

- `ignoredRules`
(Default: ) A comma-separated list of rules to be ignored by the analysis procedure.

- `orchestratorUsername`
(Optional, useful only for additional package feeds) The Orchestrator username used for authentication. Must be used together with the password.

- `orchestratorPassword`
(Optional, useful only for additional package feeds) The Orchestrator password used for authentication. Must be used together with the username.

- `orchestratorAuthToken`
(Optional, useful only for additional package feeds) The Orchestrator OAuth2 refresh token used for authentication. Must be used together with the account name and client id.

- `orchestratorAccountName`
(Optional, useful only for additional package feeds) The Orchestrator CloudRPA account name. Must be used together with the refresh token and client id.

- `orchestratorAccountForApp`
(Optional, useful only for additional package feeds) The Orchestrator CloudRPA account name. Must be used together with id, secret and scope(s) for external application.

- `orchestratorApplicationId`
(Optional, useful only for additional package feeds) The external application id. Must be used together with account, secret and scope(s) for external application.

- `orchestratorApplicationSecret`
(Optional, useful only for additional package feeds) The external application secret. Must be used together with account, id and scope(s) for external application.

- `orchestratorApplicationScope`
(Optional, useful only for additional package feeds) The space-separated list of application scopes. Must be used together with account, id and secret for external application.

- `orchestratorFolder`
(Optional, useful only for additional package feeds) The Orchestrator folder (organization unit).

- `orchestratorUrl`
(Optional, useful only for additional package feeds) The Orchestrator URL.

- `orchestratorTenant`
(Optional, useful only for additional package feeds) The Orchestrator tenant.
6 changes: 6 additions & 0 deletions docs/UiPathAuthenticationsOptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Authentication Options
| Authentication Option | How To |
| ------------- | ------------- |
| External Apps | you will need to retrieve (accountForApp, applicationId, applicationSecret, and applicationScope). Check this link on how to configure External Apps https://docs.uipath.com/orchestrator/docs/managing-external-applications#adding-an-external-application |
| API Access | you will need to retrieve (accountName & UserKey) https://docs.uipath.com/orchestrator/v0/reference/consuming-cloud-api#getting-the-api-access-information-from-the-automation-clouds-ui |
| Username&Password | on-prem orchestrator username & password |
15 changes: 15 additions & 0 deletions docs/UiPathCLIGeneric.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# UiPathCLIGeneric
This script is designed for those who know how to work with uipcli.exe and would like to call the cli directly. This script will pass the provided parameters as is directly to Uipcli.exe.
```PowerShell
SYNTAX
. 'C:\scripts\UiPathCLIGeneric.ps1' <uipcli desired arguments>
Examples:
. 'C:\scripts\UiPathCLIGeneric.ps1' package pack "C:\UiPath\Project\project.json" -o "C:\UiPath\Package"
. 'C:\scripts\UiPathCLIGeneric.ps1' job run ProcessName "https://uipath-orchestrator.myorg.com" default -u admin -p 123456
. 'C:\scripts\UiPathCLIGeneric.ps1' robot connect machine-name "https://uipath-orchestrator.myorg.com" default -u admin -p 123456 -o OurOrganization -l en-US
. 'C:\scripts\UiPathCLIGeneric.ps1' machine provision MachineNameExample Template "https://uipath-orchestrator.myorg.com" default -u admin -p 123456 -o ModernFolder -l en-US
. 'C:\scripts\UiPathCLIGeneric.ps1'app install Studio -m UiPathStudio.msi
#Note: if the script folder location is different, you need to replace "C:" with directory folder (e.g. '[FOLDER_VARIABLE]\scripts\UiPathPack.ps1')
```
29 changes: 23 additions & 6 deletions docs/UiPathDeploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
Deploy packages to an Orchestrator instance, optionally publishing them to a set of environments.
```PowerShell
SYNTAX
. 'C:\scripts\UiPathDeploy.ps1' <packages_path> <orchestrator_url> <orchestrator_tenant> [-orchestrator_user <orchestrator_user> -orchestrator_pass <orchestrator_pass>] [-UserKey <UserKey> -account_name <account_name>] [-folder_organization_unit <folder_organization_unit>] [-environment_list <environment_list>] [-language <language>]
. 'C:\scripts\\UiPathDeploy.ps1' <packages_path> <orchestrator_url> <orchestrator_tenant> [-orchestrator_user <orchestrator_user> -orchestrator_pass <orchestrator_pass>] [-UserKey <auth_token> -account_name <account_name>] [-accountForApp <account_for_app> -applicationId <application_id> -applicationSecret <application_secret> -applicationScope <applicationScope>] [-folder_organization_unit <folder_organization_unit>] [-environment_list <environment_list>] [-language <language>]
Examples:
. 'C:\scripts\UiPathDeploy.ps1' "C:\UiPath\Project 1" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456
. 'C:\scripts\UiPathDeploy.ps1' "C:\UiPath\Project\Package.1.0.6820.22047.nupkg" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456 -folder_organization_unit OurOrganization
. 'C:\scripts\UiPathDeploy.ps1' "C:\UiPath\Project\Package.1.0.6820.22047.nupkg" "https://uipath-orchestrator.myorg.com" default -UserKey a7da29a2c93a717110a82 -account_name myAccount
. 'C:\scripts\UiPathDeploy.ps1' "C:\UiPath\Project\TestsPackage.1.0.6820.22047.nupkg" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456 -environment_list SAPEnvironment,ExcelAutomationEnvironment -language en-US
. 'C:\scripts\\UiPathDeploy.ps1' "C:\UiPath\Project 1" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456
. 'C:\scripts\\UiPathDeploy.ps1' "C:\UiPath\Project\Package.1.0.6820.22047.nupkg" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456 -folder_organization_unit OurOrganization
. 'C:\scripts\\UiPathDeploy.ps1' "C:\UiPath\Project\TestsPackage.1.0.6820.22047.nupkg" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456 -environment_list SAPEnvironment,ExcelAutomationEnvironment -language en-US
. 'C:\scripts\\UiPathDeploy.ps1' "C:\UiPath\Project\Package.1.0.6820.22047.nupkg" "https://uipath-orchestrator.myorg.com" default -UserKey a7da29a2c93a717110a82 -account_name myAccount
. 'C:\scripts\\UiPathDeploy.ps1' "C:\UiPath\Project\TestsPackage.1.0.6820.22047.nupkg" "https://uipath-orchestrator.myorg.com" default -accountForApp myAccountForExternalApp -applicationId myExternalAppId -applicationSecret myExternalAppSecret -applicationScope "OR.Folders.Read OR.Settings.Read"
. 'C:\scripts\\UiPathDeploy.ps1' "C:\UiPath\Project\TestsPackage.1.0.6820.22047.nupkg" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456 -environment_list SAPEnvironment,ExcelAutomationEnvironment -language en-US -entryPoints EntryPoint1,EntryPoint2
#Note: if script folder location is different you need to replace C: with directory folder (e.g. '[FOLDER_VARIABLE]\scripts\UiPathPack.ps1')
#Note: if script path is different you need to replace C: with directory folder (e.g. '[FOLDER_VARIABLE]\scripts\UiPathPack.ps1')
```

More on different authentication options here [UiPathAuthenticationsOptions](UiPathAuthenticationsOptions.md)

Script Parameters
- `packages_path`
Required. The path to a folder containing packages, or to a package file.
Expand All @@ -34,6 +39,18 @@ Script Parameters
- `account_name`
Required. The Orchestrator CloudRPA account name. Must be used together with the refresh token and client id.

- `accountForApp`
The Orchestrator CloudRPA account name. Must be used together with id, secret and scope(s) for external application.

- `applicationId`
The external application id. Must be used together with account, secret and scope(s) for external application.

- `applicationSecret`
The external application secret. Must be used together with account, id and scope(s) for external application.

- `applicationScope`
The space-separated list of application scopes. Must be used together with account, id and secret for external application.

- `folder_organization_unit`
The Orchestrator folder (organization unit).

Expand Down
29 changes: 26 additions & 3 deletions docs/UiPathJobRun.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,26 @@
Trigger a job on Orchestrator
```PowerShell
SYNTAX
. 'C:\scripts\UiPathJobRun.ps1' -processName <processName> <uriOrch> <tenantlName> [-accountName <abumayar> -userKey <userKey>] [-folder_organization_unit <folder_organization_unit>]
. 'C:\scripts\UiPathJobRun.ps1' -processName <processName> <uriOrch> <tenantlName> [-orchestrator_user <orchestrator_user> -orchestrator_pass <orchestrator_pass>] [-folder_organization_unit <folder_organization_unit>]
. 'C:\scripts\UiPathJobRun.ps1' <process_name> <orchestrator_url> <orchestrator_tenant> [-input_path <input_path>] [-jobscount <jobscount>] [-result_path <result_path>] [-priority <priority>] [-robots <robots>]
[-fail_when_job_fails <do_not_fail_when_job_fails>] [-timeout <timeout>] [-wait <do_not_wait>] [-orchestrator_user <orchestrator_user> -orchestrator_pass <orchestrator_pass>] [-userKey <auth_token> -accountName <account_name>] [-accountForApp <account_for_app> -applicationId <application_id> -applicationSecret <application_secret> -applicationScope <applicationScope>] [-folder_organization_unit <folder_organization_unit>] [-language <language>] [-user <robotUser>] [-machine <robotMachine>] [-job_type <Unattended, NonProduction>]
Example 1:
. 'C:\scripts\UiPathJobRun.ps1' -processName SimpleRPAFlow -uriOrch https://cloud.uipath.com -tenantlName AbdullahTenant -accountName accountLogicalName -userKey xxxxxxxxxx -folder_organization_unit folderName
. 'C:\scripts\UiPathJobRun.ps1' "ProcessName" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456
. 'C:\scripts\UiPathJobRun.ps1' "ProcessName" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456 -orchestrator_pass -priority Low
. 'C:\scripts\UiPathJobRun.ps1' "ProcessName" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456 -orchestrator_pass -priority Normal -folder_organization_unit MyFolder
. 'C:\scripts\UiPathJobRun.ps1' "ProcessName" "https://uipath-orchestrator.myorg.com" default -orchestrator_user admin -orchestrator_pass 123456 -orchestrator_pass -priority High -folder_organization_unit MyFolder
. 'C:\scripts\UiPathJobRun.ps1' "ProcessName" "https://uipath-orchestrator.myorg.com" default -userKey a7da29a2c93a717110a82 -accountName myAccount -fail_when_job_fails false -timeout 0
. 'C:\scripts\UiPathJobRun.ps1' "ProcessName" "https://uipath-orchestrator.myorg.com" default -userKey a7da29a2c93a717110a82 -accountName myAccount -orchestrator_pass -priority High -jobscount 3 -wait false -machine ROBOTMACHINE
. 'C:\scripts\UiPathJobRun.ps1' "ProcessName" "https://cloud.uipath.com/" default -userKey a7da29a2c93a717110a82 -accountName myAccount -orchestrator_pass -priority Low -robots robotName -result_path C:\Temp
. 'C:\scripts\UiPathJobRun.ps1' "ProcessName" "https://uipath-orchestrator.myorg.com" default -userKey a7da29a2c93a717110a82 -accountName myAccount -robots robotName -result_path C:\Temp\status.json
. 'C:\scripts\UiPathJobRun.ps1' "ProcessName" "https://uipath-orchestrator.myorg.com" default -accountForApp accountForExternalApp -applicationId myExternalAppId -applicationSecret myExternalAppSecret -applicationScope "OR.Folders.Read OR.Settings.Read" -robots robotName -result_path C:\Temp\status.json
#Note: if script folder location is different you need to replace C: with directory folder (e.g. '[FOLDER_VARIABLE]\scripts\UiPathPack.ps1')
```
More on different authentication options here [UiPathAuthenticationsOptions](UiPathAuthenticationsOptions.md)

Script Parameters
- `processName`
orchestrator process name to run.
Expand All @@ -34,6 +45,18 @@ Script Parameters
- `accountName`
Account logical name for Cloud Platform Orchestrator

- `accountForApp`
The Orchestrator CloudRPA account name. Must be used together with id, secret and scope(s) for external application.

- `applicationId`
The external application id. Must be used together with account, secret and scope(s) for external application.

- `applicationSecret`
The external application secret. Must be used together with account, id and scope(s) for external application.

- `applicationScope`
The space-separated list of application scopes. Must be used together with account, id and secret for external application.

- `input_path`
Client ID for Cloud Platform Orchestrator

Expand Down
Loading

0 comments on commit 4f3031a

Please sign in to comment.