-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
364068f
commit 6d02626
Showing
5 changed files
with
136 additions
and
150 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,125 @@ | ||
trigger: | ||
- master | ||
|
||
pr: | ||
- master | ||
|
||
jobs: | ||
- job: Windows | ||
strategy: | ||
maxParallel: 1 | ||
pool: | ||
vmImage: 'vs2017-win2016' | ||
variables: | ||
# Set au version to use or omit to use the latest. Specify branch name to use development version from Github | ||
au_version: | ||
au_push: true | ||
# Use 1 to test all, or N to split testing into N groups | ||
au_test_groups: 1 | ||
|
||
# Github token to commit pushed packages to repository | ||
github_user_repo: bbtsoftware/chocolatey-packages | ||
|
||
# ID of the gist used to save run results - create a gist under the github_user (secret or not) and grab the id - https://gist.github.com/name/id | ||
# Optional, leave empty to create anonymous gist | ||
gist_id: b601bc1e0835054f4df23310100983ee | ||
|
||
#ID of the gist used to save test run results | ||
gist_id_test: c72aa859cc786592b658a439f10fb5fc | ||
|
||
# Chocolatey API key - to push updated packages | ||
|
||
#Chocolatey version we want to use when checking for updates (usually latest). | ||
choco_version: '0.10.13' | ||
choco_version_pr: '0.10.8' # Should be kept to the version available one year ago | ||
nupkg_cache_path: C:\packages | ||
steps: | ||
- powershell: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "BBT Software AG" | ||
git config --global core.safecrlf false | ||
displayName: 'Initialize Git environment' | ||
- powershell: | | ||
$chocoVersion = if (($Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER -eq $null) -or ($ENV:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER -eq '')) { $Env:choco_version } else { $Env:choco_version_pr } | ||
if (!(Test-Path "$env:nupkg_cache_path")) { mkdir -Force "$env:nupkg_cache_path" } | ||
@{ | ||
'chocolatey' = $chocoVersion | ||
'wormies-au-helpers' = '0.3.2' | ||
}.GetEnumerator() | % { | ||
if (!(Test-Path "${env:nupkg_cache_path}\$($_.Key).$($_.Value).nupkg")) { rm "${env:nupkg_cache_path}\$($_.Key).*.nupkg" ; iwr "https://chocolatey.org/api/v2/package/$($_.Key)/$($_.Value)" -OutFile "${env:nupkg_cache_path}\$($_.Key).$($_.Value).nupkg" } | ||
if ($_.Key -eq 'chocolatey') { cup $_.Key --version $_.Value --source ${env:nupkg_cache_path} --allow-downgrade } | ||
else { cinst $_.Key --version $_.Value --source ${env:nupkg_cache_path} --ignore-dependencies } | ||
} | ||
rm "$env:ChocolateyInstall\logs\*.log" | ||
displayName: 'Initialize Chocolatey' | ||
- powershell: | | ||
Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version | ||
$PSVersionTable | ||
git --version | ||
choco --version | ||
displayName: 'Show environment information' | ||
- powershell: | | ||
git clone -q https://github.com/majkinetor/au.git $Env:TEMP/au | ||
. "$Env:TEMP/au/scripts/Install-AU.ps1" $Env:au_version | ||
displayName: 'Clone AU' | ||
- powershell: | | ||
"Build info" | ||
' {0,-20} {1}' -f 'Build reason:', $Env:BUILD_REASON | ||
displayName: 'Show build information' | ||
- powershell: | | ||
$ErrorActionPreference = 'Continue' | ||
. ./scripts/EventLogs.ps1 | ||
Clear-EventLogs | ||
if ($Env:BUILD_DEFINITIONNAME -like '*test*') { ./test_all.ps1 "random $Env:au_test_groups"; return } | ||
if (($Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER -ne $null) -and ($Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER -ne '')) { | ||
Set-Service wuauserv -StartupType Manual | ||
./scripts/Test-RepoPackage.ps1 -CleanFiles -TakeScreenshots | ||
return | ||
} else { | ||
# Clean the choco logs as it's quite large | ||
rm "$env:ChocolateyInstall\logs\*.log" | ||
} | ||
if ( ($Env:BUILD_REASON -eq 'IndividualCI') -or ($Env:BUILD_REASON -eq 'BatchedCI') ) { | ||
switch -regex ($Env:BUILD_SOURCEVERSIONMESSAGE) | ||
{ | ||
'\[AU (.+?)\]' { $forced = $Matches[1] } | ||
'\[PUSH (.+?)\]' { | ||
$packages = $Matches[1] -split ' ' | ||
Write-Host "PUSHING PACKAGES: $packages" | ||
foreach ($package in $packages) { | ||
Write-Host ("{0}`n{1}`n" -f ('-'*60), "PACKAGE: $package") | ||
$package_dir = ls -recurse | ? { $_.Name -eq "$package.nuspec"} | select -First 1 | % Directory | ||
if (!$package_dir) { Write-Warning "Can't find package '$package'"; continue } | ||
pushd $package_dir | ||
if (Test-Path update.ps1 -ea 0) { ./update.ps1 } | ||
choco pack; Push-Package -All; | ||
popd | ||
} | ||
return | ||
} | ||
} | ||
} | ||
./update_all.ps1 -ForcedPackages $forced | ||
Get-EventLogs * | ? Source -eq 'Schannel' | fl * | out-file eventlogs.txt | ||
env: | ||
api_key: $(api_key) | ||
github_api_key: $(github_api_key) | ||
displayName: 'Run build' | ||
- powershell: | | ||
if (Test-Path $Env:TEMP\chocolatey\au) { 7z a -mx9 au_temp.7z $Env:TEMP\chocolatey\au\* } | ||
$paths = @( | ||
Resolve-Path "$env:TEMP\artifacts\*" -ea 0 | ||
Resolve-Path "$env:ChocolateyInstall\logs\*.log" -ea 0 | ||
'au_temp.7z' | ||
'update_info.xml' | ||
'Update-AUPackages.md' | ||
'Update-History.md' | ||
'eventlogs.txt' | ||
) | ||
$paths | ? { Test-Path $_ } | % { Copy-Item "$_" -Destination "$env:BUILD_ARTIFACTSTAGINGDIRECTORY" } | ||
displayName: 'Collecting build artifacts' | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
artifactName: 'drop' | ||
displayName: 'Publishing build artifacts' |
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