-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathimport-openapi.ps1
More file actions
43 lines (40 loc) · 1.45 KB
/
Copy pathimport-openapi.ps1
File metadata and controls
43 lines (40 loc) · 1.45 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
41
42
43
Param(
[Parameter(Mandatory,
HelpMessage="The Admin token from DocuEye configuration")]
[string]$adminToken,
[Parameter(Mandatory,
HelpMessage="The ID of the Workspace. ")]
[string]$workspaceId,
[Parameter(Mandatory,
HelpMessage="DocuEye address ex. http://localhost:8080")]
[string]$docueyeAddress,
[Parameter(Mandatory,
HelpMessage="Path to openapi specification file")]
[string]$openApiFile,
[Parameter(Mandatory,
HelpMessage="element Structurizr DSL ID")]
[string]$elementDslId,
[Parameter(
HelpMessage="Indicates that script will use dotnet tool insead of docueeye-cli docker image")]
[switch]$useDotNetTool
)
#####
# .\import-openapi.ps1 -docueyeAddress http://localhost:8080 -adminToken docueyedmintoken -workspaceId 638d0822-12c7-4998-8647-9c7af7ad2989 -openApiFile "/app/import/openapi/onlineshop/basket/swagger.yml" -elementDslId onlineshop.basket
#####
# import workspace to DocuEye
if(!$useDotNetTool) {
docker run -it --rm --network="host" -v "$($PWD):/app/import" jacekzwpl/docueye-cli `
openapi import `
--docueye-address="$docueyeAddress" `
--admin-token="$adminToken" `
--id="$workspaceId" `
--file="$openApiFile" `
--element-dsl-id="$elementDslId"
}else {
docueye openapi import `
--docueye-address="$docueyeAddress" `
--admin-token="$adminToken" `
--id="$workspaceId" `
--file="$openApiFile" `
--element-dsl-id="$elementDslId"
}