From 6cf03adfee1b8c82967b13a04bf8fa0a636c6ab2 Mon Sep 17 00:00:00 2001 From: Daniel Scott-Raynsford Date: Sat, 2 Jul 2016 17:38:39 +1200 Subject: [PATCH] Converted AppVeyor.yml to pull Pester from PSGallery instead of Chocolatey --- README.md | 1 + appveyor.yml | 56 ++++++++++++++++++++++++++-------------------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index cb6726045..61827247a 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,7 @@ Setting an ODJ Request file path for a configuration that creates a computer acc ## Versions ### Unreleased +* Converted AppVeyor.yml to pull Pester from PSGallery instead of Chocolatey ### 2.12.0.0 * xADDomainController: Customer identified two cases of incorrect variables being called in Verbose output messages. Corrected. diff --git a/appveyor.yml b/appveyor.yml index 96a66f1b8..de435a530 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,26 +1,26 @@ -#---------------------------------# -# environment configuration # -#---------------------------------# +#---------------------------------# +# environment configuration # +#---------------------------------# version: 2.12.{build}.0 -install: - - cinst -y pester +install: - git clone https://github.com/PowerShell/DscResource.Tests - - ps: Push-Location - - cd DscResource.Tests - - ps: Import-Module .\TestHelper.psm1 -force - - ps: Pop-Location - ps: | + Push-Location + cd DscResource.Tests + Import-Module .\TestHelper.psm1 -force + Pop-Location + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force + Install-Module -Name Pester -Repository PSGallery -Force Add-WindowsFeature RSAT-AD-PowerShell - -#---------------------------------# -# build configuration # -#---------------------------------# +#---------------------------------# +# build configuration # +#---------------------------------# build: false -#---------------------------------# -# test configuration # -#---------------------------------# +#---------------------------------# +# test configuration # +#---------------------------------# test_script: - ps: | @@ -33,16 +33,16 @@ test_script: $testResultsFile = ".\TestsResults.xml" $res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) - if ($res.FailedCount -gt 0) { + if ($res.FailedCount -gt 0) { throw "$($res.FailedCount) tests failed." } - -#---------------------------------# -# deployment configuration # -#---------------------------------# -# scripts to run before deployment -deploy_script: +#---------------------------------# +# deployment configuration # +#---------------------------------# + +# scripts to run before deployment +deploy_script: - ps: | # Creating project artifact $stagingDirectory = (Resolve-Path ..).Path @@ -51,22 +51,22 @@ deploy_script: $zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip" Add-Type -assemblyname System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath) - + # Creating NuGet package artifact New-Nuspec -packageName $env:APPVEYOR_PROJECT_NAME -version $env:APPVEYOR_BUILD_VERSION -author "Microsoft" -owners "Microsoft" -licenseUrl "https://github.com/PowerShell/DscResources/blob/master/LICENSE" -projectUrl "https://github.com/$($env:APPVEYOR_REPO_NAME)" -packageDescription $env:APPVEYOR_PROJECT_NAME -tags "DesiredStateConfiguration DSC DSCResourceKit" -destinationPath . nuget pack ".\$($env:APPVEYOR_PROJECT_NAME).nuspec" -outputdirectory . $nuGetPackageName = $env:APPVEYOR_PROJECT_NAME + "." + $env:APPVEYOR_BUILD_VERSION + ".nupkg" $nuGetPackagePath = (Get-ChildItem $nuGetPackageName).FullName - + @( # You can add other artifacts here $zipFilePath, $nuGetPackagePath - ) | % { + ) | % { Write-Host "Pushing package $_ as Appveyor artifact" Push-AppveyorArtifact $_ } - - + +