-
Notifications
You must be signed in to change notification settings - Fork 0
/
Provision.ps1
25 lines (21 loc) · 1.2 KB
/
Provision.ps1
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
param (
[string] $GitHubApiKey,
[string] $ExportFileName,
[string] $GitHubOrganization,
[string] $AzureUserPrinciple,
[securestring] $AzureUserPrincipleSecret,
[string] $AzureTenant,
[string] $AzureResourceGroup,
[string] $AzureApplicationName
)
$env:GitHubApiKey = $GitHubApiKey
Import-module .\Authentication.ps1 -Force
$teams = (Get-Content $ExportFileName | Out-String | ConvertFrom-Json)
foreach ($team in $teams) {
$repositoryName = "PartsUnlimited-$($team.TeamName)"
$createdTeam = .\Create-OrganisationTeam.ps1 -TeamName $team.TeamName -OrganizationName $GitHubOrganization
.\Create-Repo.ps1 -RepositoryName $RepositoryName -OrganizationName $GitHubOrganization -TeamId $createdTeam.Id
.\Create-AzureResources.ps1 -AzureUserPrinciple $AzureUserPrinciple -AzureUserPrincipleSecret $AzureUserPrincipleSecret -AzureResourceGroup $AzureResourceGroup-$($team.TeamName) -AzureApplicationName $repositoryName -AzureTenantName $AzureTenant -GitHubRepository $RepositoryName -GitHubOrganization $GitHubOrganization
.\Add-ApplicationNameToYml.ps1 -ApplicationName $repositoryName
.\Add-CodeToRepo.ps1 -OrganizationName $GitHubOrganization -RepositoryName $RepositoryName
}