Skip to content

feat: Start-CippDevInstallation.ps1 #3195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading