Skip to content

Commit 224e0f8

Browse files
Merge pull request #3195 from Ren-Roros-Digital/CippDevInstallation
feat: Start-CippDevInstallation.ps1
2 parents 84b5f55 + 00aee49 commit 224e0f8

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
Get-Command kitty -ErrorAction Stop | Out-Null
2-
Write-Host 'Starting CIPP Dev Emulators'
32
Get-Process node -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue
43
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName
54

5+
pwsh -file (Join-Path $PSScriptRoot 'Start-CippDevInstallation.ps1')
6+
7+
Write-Host 'Starting CIPP Dev Emulators'
8+
69
if (Test-Path (Join-Path $Path 'CIPP-API-Processor')) {
710
$Process = Read-Host -Prompt 'Start Process Function (y/N)?'
811
}
@@ -11,14 +14,14 @@ if ($Process -eq 'y') {
1114
kitty --detach --title 'CIPP' -o allow_remote_control=yes -- pwsh -c "
1215
kitty @new-window --new-tab --tab-title `"Azurite`" --cwd $Path -- azurite ;
1316
kitty @new-window --new-tab --tab-title `"FunctionApp`" --cwd (Join-Path $Path `"CIPP-API`") -- func start;
14-
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- npm run dev ;
17+
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- yarn run dev ;
1518
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- npm run start-swa;
1619
kitty @new-window --new-tab --tab-title `"CIPP-API-Processor`" --cwd (Join-Path $Path `"CIPP-API-Processor`") -- func start --port 7072"
1720

1821
} else {
1922
kitty --detach --title 'CIPP' -o allow_remote_control=yes -- pwsh -c "
2023
kitty @new-window --new-tab --tab-title `"Azurite`" --cwd $Path -- azurite ;
2124
kitty @new-window --new-tab --tab-title `"FunctionApp`" --cwd (Join-Path $Path `"CIPP-API`") -- func start;
22-
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- npm run dev ;
25+
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- yarn run dev ;
2326
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- npm run start-swa"
2427
}

Tools/Start-CippDevInstallation.ps1

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName
2+
3+
if (-not(Get-Command npm)) {
4+
throw 'npm is required to install the CIPP development environment'
5+
}
6+
7+
if (-not(Get-Command azurite)) {
8+
Write-Host 'Installing Azurite'
9+
npm install --global 'azurite'
10+
}
11+
12+
if (-not(Get-Command swa)) {
13+
Write-Host 'Installing @azure/static-web-apps-cli'
14+
npm install --global '@azure/static-web-apps-cli'
15+
}
16+
17+
if (-not(Get-Command func)) {
18+
Write-Host 'Installing Azure Functions Core Tools'
19+
npm install --global 'azure-functions-core-tools@4' --unsafe-perms true
20+
}
21+
22+
if (-not(Get-Command yarn)) {
23+
Write-Host 'Installing Yarn'
24+
npm install --global yarn
25+
}
26+
27+
if (-not(yarn list --global --pattern 'next' | Select-String -Pattern 'next')) {
28+
Write-Host 'Installing Next.js'
29+
yarn install --global next --network-timeout 500000
30+
}
31+
32+
yarn install --cwd (Join-Path $Path "CIPP") --network-timeout 500000

0 commit comments

Comments
 (0)