Skip to content

Commit

Permalink
Merge from experiments branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed Sep 19, 2017
2 parents a034a9b + 127395f commit b0958e9
Show file tree
Hide file tree
Showing 25 changed files with 3,947 additions and 10 deletions.
23 changes: 20 additions & 3 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
Condition=" '$(Scope)' == 'ServiceManagement'"/>
<CmdletSolutionsToBuild Include=".\src\Storage\Storage.sln"
Condition=" '$(Scope)' == 'AzureStorage' "/>
<ExperimentalCmdletSolutionsToBuild Include=".\experiments\Websites.Experiments\Microsoft.Azure.Commands.Websites.Experiments.sln"/>
<SetupSln Include=".\setup\azurepowershell.sln" />
<StaticAnalysis Include=".\tools\StaticAnalysis\StaticAnalysis.sln" />
<LocalBuildTasks Include="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.sln" />
Expand Down Expand Up @@ -140,8 +141,8 @@
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
<NuGetRestoreConfigSwitch>-ConfigFile &quot;$(NuGetRestoreConfigFile)&quot;</NuGetRestoreConfigSwitch>
<NuGetRestorePackageSetting>-PackagesDirectory $(LibraryNugetPackageFolder)</NuGetRestorePackageSetting>
<NuGetExperimentalCmdletPackages>-PackagesDirectory ".\experiments\Websites.Experiments\packages" </NuGetExperimentalCmdletPackages>
<NuGetLocalBuildTaskPackages>-PackagesDirectory $(LibraryToolsFolder)\BuildPackagesTask\packages</NuGetLocalBuildTaskPackages>

<PowerShellCommand Condition=" '$(PowerShellCommand)' == '' ">C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
</PropertyGroup>

Expand Down Expand Up @@ -171,6 +172,8 @@
<!-- Restore packages for static analysis-->
<Exec Command="$(NuGetCommand) restore %(StaticAnalysis.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
ContinueOnError="false" />
<Exec Command="$(NuGetCommand) restore %(ExperimentalCmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetExperimentalCmdletPackages)"
ContinueOnError="false" />
<!-- Restore packages for local build tasks-->
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetLocalBuildTaskPackages)"
ContinueOnError="false" />
Expand All @@ -196,7 +199,17 @@
Targets="Build"
Properties="Configuration=$(Configuration);Platform=Any CPU"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />
ContinueOnError="false" />

<MSBuild
Projects="@(ExperimentalCmdletSolutionsToBuild)"
Targets="Build"
Properties="Configuration=$(Configuration);Platform=Any CPU"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />

<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; $(LibraryRoot)\experiments\Compute.Experiments\copy-dev.ps1 -Config $(Configuration) &quot;"
ContinueOnError="ErrorAndContinue" />

<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;"
ContinueOnError="false"
Expand Down Expand Up @@ -322,7 +335,7 @@
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) $(Scope) &quot;"/>
<!-- Copying shortcut to be signed -->
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psd1"
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" Condition= " '$(NetCore)' == 'false' "/>
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" Condition= " '$(NetCore)' == 'false' "/>
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1"
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" Condition= " '$(NetCore)' == 'false' "/>
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM.Netcore\AzureRM.Netcore.psd1"
Expand Down Expand Up @@ -397,6 +410,7 @@
DestinationFolder="$(LibraryRoot)tools\AzureRM" Condition= " '$(NetCore)' == 'false' "/>
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.Netcore.psd1"
DestinationFolder="$(LibraryRoot)tools\AzureRM" Condition= " '$(NetCore)' == 'true' "/>

</Target>

<Target Name="CodeSignInstaller">
Expand Down Expand Up @@ -460,6 +474,9 @@
<!-- Run checkin tests for each pull request -->
<Target Name="Test" DependsOnTargets="BeforeRunTests">
<Message Importance="high" Text="Running check in tests..." />
<!-- Run unit tests for AppService experimental cmdlets -->
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;Import-Module $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Profile\AzureRM.Profile.psd1; Import-Module $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Resources\AzureRM.Resources.psd1; Import-Module $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Websites\AzureRM.Websites.psd1; Import-Module $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Websites.Experiments\AzureRM.Websites.Experiments.psd1; $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Websites.Experiments\Run-UnitTests.ps1&quot;"
ContinueOnError="false"/>
<CallTarget Targets="InvokeXUnit"/>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CompanyName = 'Microsoft'
Copyright = 'Microsoft'

# Description of the functionality provided by this module
Description = 'Azure Compute'
Description = 'Azure Compute experiments for VM creation'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '5.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

$clientSecret = ConvertTo-SecureString ([Guid]::NewGuid().ToString().Substring(1,10)) -AsPlainText -Force
$pscredentials = New-Object System.Management.Automation.PSCredential("vmadmin", $clientSecret)
New-AzVm -Name myVm1234 -Credential $pscredentials -WhatIf
$vm = New-AzVm -Name myVm1234 -Credential $pscredentials
$vm

#Cleanup
Remove-AzureRmResourceGroup -ResourceId $vm.ResourceGroupId -Force
7 changes: 7 additions & 0 deletions experiments/Compute.Experiments/copy-dev.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
param([string] $Config="Release")

$outPath = Join-Path $PSScriptRoot -ChildPath "..\..\src\Package\$Config\ResourceManager\AzureResourceManager\AzureRM.Compute.Experiments\"
Write-Host $outPath
Copy-Item -Path $PSScriptRoot -Destination $outPath -Recurse -Exclude "AzureRM.Compute.Experiments.Tests.ps1", "publish-dev.ps1", "copy-dev.ps1" -Force


Loading

0 comments on commit b0958e9

Please sign in to comment.