diff --git a/appveyor.yml b/appveyor.yml index 9c55d87..9a4c68f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -69,7 +69,14 @@ install: build_script: - ps: | - ./update_all.ps1 + if ( ($Env:APPVEYOR_REPO_COMMIT_MESSAGE -match '\[AU (.+?)\]') -and + ($Env:APPVEYOR_SCHEDULED_BUILD -ne 'true') -and + ($Env:APPVEYOR_FORCED_BUILD -ne 'true') + ) { $forced = $Matches[1] } + + ./update_all.ps1 -Name * -ForcedPackages $forced + + 7z a au_temp.zip $Env:TEMP\chocolatey\au\* #on_finish: #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) @@ -77,6 +84,8 @@ build_script: artifacts: - path: update_info.xml - path: Update-AUPackages.md +- path: au_temp.zip + notifications: - provider: Email diff --git a/update_all.ps1 b/update_all.ps1 index 8b59d45..f69794c 100644 --- a/update_all.ps1 +++ b/update_all.ps1 @@ -1,6 +1,6 @@ # AU Packages Template: https://github.com/majkinetor/au-packages-template -param($Name = $null) +param($Name = $null, [string] $ForcedPackages) if (Test-Path $PSScriptRoot/update_vars.ps1) { . $PSScriptRoot/update_vars.ps1 } @@ -12,7 +12,7 @@ $Options = [ordered]@{ Report = @{ Type = 'markdown' #Report type: markdown or text - Path = "$PSScriptRoot\Update-AUPacakges.md" #Path where to save the report + Path = "$PSScriptRoot\Update-AUPackages.md" #Path where to save the report Params= @{ #Report parameters: Github_UserRepo = $Env:github_user_repo # Markdown: shows user info in upper right corner NoAppVeyor = $false # Markdown: do not show AppVeyor build shield @@ -21,9 +21,9 @@ $Options = [ordered]@{ } Gist = @{ - Id = $Env:gist_id #Your gist id or leave empty for anonymous - ApiKey = $Env:github_api_key #Your github api key - Path = "$PSScriptRoot\Update-AUPacakges.md" #List of files to add to gist + Id = $Env:gist_id #Your gist id or leave empty for anonymous + ApiKey = $Env:github_api_key #Your github api key + Path = "$PSScriptRoot\Update-AUPackages.md" #List of files to add to gist } #Git = @{ @@ -38,20 +38,27 @@ $Options = [ordered]@{ Mail = if ($Env:mail_user) { @{ - To = $Env:mail_user - Server = $Env:mail_server - UserName = $Env:mail_user - Password = $Env:mail_pass - Port = $Env:mail_port - EnableSsl = $Env:mail_enable_ssl -eq 'true' - Attachments = "$PSScriptRoot\update_info.xml" + To = $Env:mail_user + Server = $Env:mail_server + UserName = $Env:mail_user + Password = $Env:mail_pass + Port = $Env:mail_port + EnableSsl = $Env:mail_enablessl -eq 'true' + Attachment = "$PSScriptRoot\update_info.xml" UserMessage = '' SendAlways = $false #Send notifications every time } } else {} + + ForcedPackages = $ForcedPackages -split ' ' + BeforeEach = { + param($PackageName, $Options ) + if ($Options.ForcedPackages -contains $PackageName) { $global:au_Force = $true } + } } -$global:au_Root = "$PSScriptRoot" #Path to the AU packages +if ($ForcedPackages) { Write-Host "FORCED PACKAGES: $ForcedPackages" } +$au_Root = $PSScriptRoot #Path to the AU packages $info = updateall -Name $Name -Options $Options #Uncomment to fail the build on AppVeyor on any package error