Skip to content

Commit

Permalink
Merge pull request #3195 from Ren-Roros-Digital/CippDevInstallation
Browse files Browse the repository at this point in the history
feat: Start-CippDevInstallation.ps1
  • Loading branch information
KelvinTegelaar authored Jan 14, 2025
2 parents 84b5f55 + 00aee49 commit 224e0f8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Tools/Start-CippDevEmulatorsWithKitty.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Get-Command kitty -ErrorAction Stop | Out-Null
Write-Host 'Starting CIPP Dev Emulators'
Get-Process node -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName

pwsh -file (Join-Path $PSScriptRoot 'Start-CippDevInstallation.ps1')

Write-Host 'Starting CIPP Dev Emulators'

if (Test-Path (Join-Path $Path 'CIPP-API-Processor')) {
$Process = Read-Host -Prompt 'Start Process Function (y/N)?'
}
Expand All @@ -11,14 +14,14 @@ if ($Process -eq 'y') {
kitty --detach --title 'CIPP' -o allow_remote_control=yes -- pwsh -c "
kitty @new-window --new-tab --tab-title `"Azurite`" --cwd $Path -- azurite ;
kitty @new-window --new-tab --tab-title `"FunctionApp`" --cwd (Join-Path $Path `"CIPP-API`") -- func start;
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- npm run dev ;
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- yarn run dev ;
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- npm run start-swa;
kitty @new-window --new-tab --tab-title `"CIPP-API-Processor`" --cwd (Join-Path $Path `"CIPP-API-Processor`") -- func start --port 7072"

} else {
kitty --detach --title 'CIPP' -o allow_remote_control=yes -- pwsh -c "
kitty @new-window --new-tab --tab-title `"Azurite`" --cwd $Path -- azurite ;
kitty @new-window --new-tab --tab-title `"FunctionApp`" --cwd (Join-Path $Path `"CIPP-API`") -- func start;
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- npm run dev ;
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- yarn run dev ;
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- npm run start-swa"
}
32 changes: 32 additions & 0 deletions Tools/Start-CippDevInstallation.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName

if (-not(Get-Command npm)) {
throw 'npm is required to install the CIPP development environment'
}

if (-not(Get-Command azurite)) {
Write-Host 'Installing Azurite'
npm install --global 'azurite'
}

if (-not(Get-Command swa)) {
Write-Host 'Installing @azure/static-web-apps-cli'
npm install --global '@azure/static-web-apps-cli'
}

if (-not(Get-Command func)) {
Write-Host 'Installing Azure Functions Core Tools'
npm install --global 'azure-functions-core-tools@4' --unsafe-perms true
}

if (-not(Get-Command yarn)) {
Write-Host 'Installing Yarn'
npm install --global yarn
}

if (-not(yarn list --global --pattern 'next' | Select-String -Pattern 'next')) {
Write-Host 'Installing Next.js'
yarn install --global next --network-timeout 500000
}

yarn install --cwd (Join-Path $Path "CIPP") --network-timeout 500000

0 comments on commit 224e0f8

Please sign in to comment.