forked from deuill/go-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in feature/resource-group-param (pull request deuill#18)
Feature/resource group param Approved-by: James Stow <james.stow@antstream.com>
- Loading branch information
Showing
4 changed files
with
403 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
function CopyUsingSSHSFTP { | ||
#will recurse switch break single files? | ||
<# | ||
.Synopsis | ||
Copy files and folders from source to destination server | ||
.Example | ||
DownloadAzureStorageBlob $StorageAccountName $StorageAccountKey $Destination; | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
$orig, | ||
$destFolder, | ||
$ComputerName, | ||
$port, | ||
$username, | ||
$password | ||
) | ||
|
||
Write-Host "Copy $orig to $destFolder in VM $ComputerName using psftp." | ||
#dos2unix $orig | ||
Write-Host "Starting copy" | ||
|
||
$program = "..\..\libraries\putty\psftp.exe" | ||
$cmd = @( | ||
"cd /$destFolder", | ||
"put -r $orig" | ||
"bye" | ||
) | ||
# Detect hostkey | ||
$output1 = [String]($cmd | & $program -batch -pw $password "$username@$ComputerName" 2>&1 ) | ||
$output1 | Out-File "temp.txt" -Force # It is horrible but I am in a hurry | ||
$output2 = Get-Content "temp.txt" | ||
foreach ($line in $output2) | ||
{ | ||
if ($line -like "ssh-rsa 2048 *") | ||
{ | ||
$hostkey = $line -replace "ssh-rsa 2048 ","" | ||
Write-Host "Hostkey detected." | ||
} | ||
} | ||
Write-Host "Hostkey=$hostkey." | ||
|
||
# Do the copy with Hostkey | ||
[String]($cmd | & $program -batch -pw $password "$username@$ComputerName" -hostkey $hostkey 2>&1 ) | ||
|
||
Write-Host "Copy finished." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<# | ||
.SYNOPSIS | ||
Functions that return locations of external resources that comply with our new naming convention/ | ||
This is basically a dynamic config file | ||
Author: Matthew Tyas | ||
#> | ||
|
||
#Azure Resources | ||
function GetVMImageName($environment, $branch) | ||
{ | ||
return "GameServerBaseImage_${environment}_${branch}" | ||
} | ||
|
||
function GetVmName($environment) | ||
{ | ||
return "as-gstemplate-$environment" | ||
} | ||
|
||
function GetASLAddress($environment, $region) | ||
{ | ||
return "https://as-${environment}-asl-${region}.azurewebsites.net/api" | ||
} | ||
|
||
function GetVirtualNetwork($environment, $region) | ||
{ | ||
return "as-${environment}-vnet-GS-${region}" | ||
} | ||
|
||
function GetNetworkSecurityGroupName($environment) | ||
{ | ||
return "as-${environment}-nsg-GS" | ||
} | ||
|
||
function GetAzureResourceGroupName($environment, $region) | ||
{ | ||
return "as-${environment}-rg-GS-${region}" | ||
} | ||
|
||
function GetEmulatorStorageResourceGroupName($environment, $region) | ||
{ | ||
return "as-${environment}-rg-storage-${region}" | ||
} | ||
# Storage Accounts | ||
|
||
function GetImageStorageAccount($environment, $region) | ||
{ | ||
return "as${environment}rggs${region}disks01" | ||
} | ||
|
||
function GetDiagnosticsStorageAccountName($environment, $region) | ||
{ | ||
return "as${environment}rggs${region}diag01" | ||
} | ||
|
||
# Azure storage account name for the emulators and roms | ||
function GetEmulatorStorageAccount($environment, $region) | ||
{ | ||
return "as${environment}storage${region}".ToLower() | ||
} | ||
|
||
function GetEmulatorFileShareName() | ||
{ | ||
return "binaries" | ||
} | ||
|
||
function GetGameSettingsStorageAccount() | ||
{ | ||
return "asdevblob" | ||
} | ||
|
||
function GetRomStorageAccount($environment, $region) | ||
{ | ||
return "as${environment}storage${region}".ToLower() | ||
} |
Oops, something went wrong.