update_all.ps1 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # AU Packages Template: https://github.com/majkinetor/au-packages-template
  2. param($Name = $null)
  3. if (Test-Path $PSScriptRoot/update_vars.ps1) { . $PSScriptRoot/update_vars.ps1 }
  4. $Options = [ordered]@{
  5. Timeout = 100 #Connection timeout in seconds
  6. Threads = 10 #Number of background jobs to use
  7. Push = $Env:au_Push -eq 'true' #Push to chocolatey
  8. PluginPath = '' #Path to user plugins
  9. Report = @{
  10. Type = 'markdown' #Report type: markdown or text
  11. Path = "$PSScriptRoot\Update-AUPacakges.md" #Path where to save the report
  12. Params= @{ #Report parameters:
  13. Github_UserRepo = $Env:github_UserRepo # Markdown: shows user info in upper right corner
  14. NoAppVeyor = $false # Markdown: do not show AppVeyor build shield
  15. UserMessage = '' # Markdown, Text: Custom user message to show
  16. }
  17. }
  18. Gist = @{
  19. Id = '' #Your gist id or leave empty for anonymous
  20. ApiKey = '' #Your github api key
  21. Path = "$PSScriptRoot\Update-AUPacakges.md" #List of files to add to gist
  22. }
  23. #Git = @{
  24. #User = '' #Git username, leave empty if github api key is used
  25. #Password = $Env:github_api_key #Password if username is not empty, otherwise api key
  26. #}
  27. RunInfo = @{
  28. Exclude = 'password', 'apikey' #Option keys which contain those words will be removed
  29. Path = "$PSScriptRoot\update_info.xml" #Path where to save the run info
  30. }
  31. Mail = if ($Env:mail_user) {
  32. @{
  33. To = $Env:mail_user
  34. Server = $Env:mail_server
  35. UserName = $Env:mail_user
  36. Password = $Env:mail_pass
  37. Port = $Env:mail_port
  38. EnableSsl = $Env:enable_ssl
  39. Attachments = "$PSScriptRoot\update_info.xml"
  40. UserMessage = ''
  41. SendAlways = $false #Send notifications every time
  42. }
  43. } else {}
  44. }
  45. $global:au_Root = "$PSScriptRoot" #Path to the AU packages
  46. $info = updateall -Name $Name -Options $Options
  47. #Uncomment to fail the build on AppVeyor on any package error
  48. #if ($info.error_count.total) { throw 'Errors during update' }