-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathimport.ps1
More file actions
40 lines (35 loc) · 1.34 KB
/
Copy pathimport.ps1
File metadata and controls
40 lines (35 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Param(
[Parameter(Mandatory,
HelpMessage="The Admin token from DocuEye configuration")]
[string]$adminToken,
[Parameter(Mandatory,
HelpMessage="The ID of the Workspace. If not provided the new workspace will be created. Also if workspace with given id does not exists new workspace will be created.")]
[string]$workspaceId,
[Parameter(HelpMessage="Unique import key. If not provided, one will be generated.")]
[string]$importKey = (New-Guid).Guid,
[Parameter(Mandatory,
HelpMessage="DocuEye address ex. http://localhost:8080")]
[string]$docueyeAddress,
[Parameter(
HelpMessage="Indicates that script will use dotnet tool instead of docueye-cli docker image")]
[switch]$useDotNetTool
)
####
# .\import.ps1 -docueyeAddress http://localhost:8080 -adminToken docueyedmintoken -workspaceId 638d0822-12c7-4998-8647-9c7af7ad2989
####
if(!$useDotNetTool) {
docker run -it --rm --network="host" -v "$($PWD):/app/import" jacekzwpl/docueye-cli `
workspace import `
--docueye-address="$docueyeAddress" `
--admin-token="$adminToken" `
--key="$importKey" `
--id="$workspaceId" `
--file=./import/workspace.dsl
}else {
docueye workspace import `
--docueye-address="$docueyeAddress" `
--admin-token="$adminToken" `
--key="$importKey" `
--id="$workspaceId" `
--file=workspace.dsl
}