mirror of
https://github.com/wavetermdev/chocolatey.git
synced 2026-08-05 13:47:23 -07:00
updated for version 2018.1.11
This commit is contained in:
@@ -17,8 +17,10 @@ The repository is setup so that you can manage your packages entirely from the G
|
||||
|
||||
To run locally you will need:
|
||||
|
||||
- Powershell 5+: `cinst powershell`
|
||||
- [Chocolatey Automatic Package Updater Module](https://github.com/majkinetor/au): `Install-Module au` or `cinst au`
|
||||
- Powershell 5+.
|
||||
- [Chocolatey Automatic Package Updater Module](https://github.com/majkinetor/au): `Install-Module au` or `cinst au`.
|
||||
|
||||
In order to setup AppVeyor update runner please take a look at the AU wiki [AppVeyor section](https://github.com/majkinetor/au/wiki/AppVeyor).
|
||||
|
||||
## Create a package
|
||||
|
||||
@@ -37,12 +39,12 @@ Run from within the directory of the package to update that package:
|
||||
|
||||
cd <package_dir>
|
||||
./update.ps1
|
||||
|
||||
|
||||
If this script is missing, the package is not automatic.
|
||||
Set `$au_Force = $true` prior to script call to update the package even if no new version is found.
|
||||
|
||||
### Multiple packages
|
||||
|
||||
|
||||
To update all packages run `./update_all.ps1`. It accepts few options:
|
||||
|
||||
```powershell
|
||||
@@ -63,18 +65,19 @@ You can also call AU method `Update-AUPackages` (alias `updateall`) on its own i
|
||||
|
||||
updateall -Options ([ordered]@{ Force = $true })
|
||||
|
||||
To quickly test if all of the packages update force all with `test_all.ps1` script:
|
||||
## Testing all packages
|
||||
|
||||
You can force the update of all or subset of packages to see how they behave when complete update procedure is done:
|
||||
|
||||
|
||||
```powershell
|
||||
./test_all.ps1 # Test force update on all packages
|
||||
./test_all.ps1 'cdrtfe','freecad', 'p*' # Test force update on only given packages
|
||||
./test_all.ps1 'random 3' # Split packages in 3 groups and randomly select and test 1 of those each time
|
||||
```
|
||||
master~> .\test_all.ps1
|
||||
Updating 4 automatic packages at 2017-04-30 10:54:34 (forced)
|
||||
Push is disabled
|
||||
FORCE IS ENABLED. All packages will be updated
|
||||
less is updated to 4.87.0.20170430
|
||||
copyq is updated to 3.0.0.20170430
|
||||
librecad is updated to 2.1.3.20170430
|
||||
prey is updated to 1.6.6.20170430
|
||||
```
|
||||
|
||||
|
||||
**Note**: If you run this locally your packages will get updated. Use `git reset --hard` after running this to revert the changes.
|
||||
|
||||
## Pushing To Community Repository Via Commit Message
|
||||
|
||||
@@ -109,3 +112,4 @@ To use this system with your own packages do the following steps:
|
||||
Add your own packages now, with this in mind:
|
||||
* You can keep both manual and automatic packages together. To get only AU packages any time use `Get-AUPackages` function (alias `lsau` or `gau`)
|
||||
* Keep all package additional files in the package directory (icons, screenshots etc.). This keeps everything related to one package in its own directory so it is easy to move it around or remove it.
|
||||
|
||||
|
||||
+36
-6
@@ -20,27 +20,57 @@ if (($Name.Length -gt 0) -and ($Name[0] -match '^random (.+)')) {
|
||||
}
|
||||
|
||||
$options = [ordered]@{
|
||||
Force = $true
|
||||
Push = $false
|
||||
Force = $true
|
||||
Push = $false
|
||||
Threads = 10
|
||||
|
||||
IgnoreOn = @( #Error message parts to set the package ignore status
|
||||
'Could not create SSL/TLS secure channel'
|
||||
'Could not establish trust relationship'
|
||||
'The operation has timed out'
|
||||
'Internal Server Error'
|
||||
'Service Temporarily Unavailable'
|
||||
'Choco pack failed with exit code 1'
|
||||
)
|
||||
|
||||
RepeatOn = @( #Error message parts on which to repeat package updater
|
||||
'Could not create SSL/TLS secure channel' # https://github.com/chocolatey/chocolatey-coreteampackages/issues/718
|
||||
'Could not establish trust relationship' # -||-
|
||||
'Unable to connect'
|
||||
'The remote name could not be resolved'
|
||||
'Choco pack failed with exit code 1' # https://github.com/chocolatey/chocolatey-coreteampackages/issues/721
|
||||
'The operation has timed out'
|
||||
'Internal Server Error'
|
||||
'An exception occurred during a WebClient request'
|
||||
'Job returned no object, Vector smash ?'
|
||||
)
|
||||
RepeatSleep = 60 #How much to sleep between repeats in seconds, by default 0
|
||||
RepeatCount = 2 #How many times to repeat on errors, by default 1
|
||||
|
||||
Report = @{
|
||||
Type = 'markdown' #Report type: markdown or text
|
||||
Path = "$PSScriptRoot\Update-Force-Test-${n}.md" #Path where to save the report
|
||||
Path = "$PSScriptRoot\Update-Force-Test-${n}.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
|
||||
NoAppVeyor = $true # Markdown: do not show AppVeyor build shield
|
||||
Title = "Update Force Test - Group ${n}"
|
||||
UserMessage = "[Update report](https://gist.github.com/$Env:gist_id) | **USING AU NEXT VERSION**" # Markdown, Text: Custom user message to show
|
||||
UserMessage = "[Ignored](#ignored) | [Update report](https://gist.github.com/$Env:gist_id)" # Markdown, Text: Custom user message to show
|
||||
}
|
||||
}
|
||||
|
||||
Gist = @{
|
||||
Id = $Env:gist_id_test #Your gist id; leave empty for new private or anonymous gist
|
||||
ApiKey = $Env:github_api_key #Your github api key - if empty anoymous gist is created
|
||||
Path = "$PSScriptRoot\Update-Force-Test-${n}.md" #List of files to add to the gist
|
||||
Path = "$PSScriptRoot\Update-Force-Test-${n}.md" #List of files to add to the gist
|
||||
Description = "Update Force Test Report #powershell #chocolatey"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$global:info = updateall -Name $Name -Options $Options
|
||||
|
||||
$au_errors = $global:info | ? { $_.Error } | select -ExpandProperty Error
|
||||
|
||||
if ($ThrowOnErrors -and $au_errors.Count -gt 0) {
|
||||
throw 'Errors during update'
|
||||
}
|
||||
|
||||
+35
-16
@@ -5,23 +5,34 @@ param([string[]] $Name, [string] $ForcedPackages, [string] $Root = $PSScriptRoot
|
||||
if (Test-Path $PSScriptRoot/update_vars.ps1) { . $PSScriptRoot/update_vars.ps1 }
|
||||
|
||||
$Options = [ordered]@{
|
||||
WhatIf = $au_WhatIf #WhatIf all packages
|
||||
WhatIf = $au_WhatIf #Whatif all packages
|
||||
Force = $false #Force all packages
|
||||
Timeout = 100 #Connection timeout in seconds
|
||||
UpdateTimeout = 1200 #Update timeout in seconds
|
||||
Threads = 10 #Number of background jobs to use
|
||||
Push = $Env:au_Push -eq 'true' #Push to chocolatey
|
||||
PushAll = $true #Allow to push multiple packages at once
|
||||
PluginPath = '' #Path to user plugins
|
||||
|
||||
IgnoreOn = @( #Error message parts to set the package ignore status
|
||||
)
|
||||
RepeatOn = @( #Error message parts on which to repeat package updater
|
||||
'Unable to create secure channel'
|
||||
'Could not establish trust relationship'
|
||||
'Unable to connect'
|
||||
IgnoreOn = @( #Error message parts to set the package ignore status
|
||||
'Could not create SSL/TLS secure channel'
|
||||
'Could not establish trust relationship'
|
||||
'The operation has timed out'
|
||||
'Internal Server Error'
|
||||
'Service Temporarily Unavailable'
|
||||
)
|
||||
RepeatSleep = 0 #How much to sleep between repeats in seconds, by default 0
|
||||
RepeatCount = 1 #How many times to repeat on errors, by default 1
|
||||
RepeatOn = @( #Error message parts on which to repeat package updater
|
||||
'Could not create SSL/TLS secure channel' # https://github.com/chocolatey/chocolatey-coreteampackages/issues/718
|
||||
'Could not establish trust relationship' # -||-
|
||||
'Unable to connect'
|
||||
'The remote name could not be resolved'
|
||||
'Choco pack failed with exit code 1' # https://github.com/chocolatey/chocolatey-coreteampackages/issues/721
|
||||
'The operation has timed out'
|
||||
'Internal Server Error'
|
||||
'An exception occurred during a WebClient request'
|
||||
'remote session failed with an unexpected state'
|
||||
)
|
||||
#RepeatSleep = 250 #How much to sleep between repeats in seconds, by default 0
|
||||
#RepeatCount = 2 #How many times to repeat on errors, by default 1
|
||||
|
||||
Report = @{
|
||||
Type = 'markdown' #Report type: markdown or text
|
||||
@@ -29,7 +40,7 @@ $Options = [ordered]@{
|
||||
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
|
||||
UserMessage = "[History](#update-history)" # Markdown, Text: Custom user message to show
|
||||
UserMessage = "[Ignored](#ignored) | [History](#update-history) | [Force Test](https://gist.github.com/$Env:gist_id_test) | [Releases](https://github.com/$Env:github_user_repo/tags)" # Markdown, Text: Custom user message to show
|
||||
NoIcons = $false # Markdown: don't show icon
|
||||
IconSize = 32 # Markdown: icon size
|
||||
Title = '' # Markdown, Text: TItle of the report, by default 'Update-AUPackages'
|
||||
@@ -37,7 +48,7 @@ $Options = [ordered]@{
|
||||
}
|
||||
|
||||
History = @{
|
||||
Lines = 30 #Number of lines to show
|
||||
Lines = 120 #Number of lines to show
|
||||
Github_UserRepo = $Env:github_user_repo #User repo to be link to commits
|
||||
Path = "$PSScriptRoot\Update-History.md" #Path where to save history
|
||||
}
|
||||
@@ -53,8 +64,13 @@ $Options = [ordered]@{
|
||||
Password = $Env:github_api_key #Password if username is not empty, otherwise api key
|
||||
}
|
||||
|
||||
GitReleases = @{
|
||||
ApiToken = $Env:github_api_key #Your github api key
|
||||
ReleaseType = 'package' #Either 1 release per date, or 1 release per package
|
||||
}
|
||||
|
||||
RunInfo = @{
|
||||
Exclude = 'password', 'apikey' #Option keys which contain those words will be removed
|
||||
Exclude = 'password', 'apikey', 'apitoken' #Option keys which contain those words will be removed
|
||||
Path = "$PSScriptRoot\update_info.xml" #Path where to save the run info
|
||||
}
|
||||
|
||||
@@ -75,11 +91,14 @@ $Options = [ordered]@{
|
||||
ForcedPackages = $ForcedPackages -split ' '
|
||||
BeforeEach = {
|
||||
param($PackageName, $Options )
|
||||
$p = $Options.ForcedPackages | ? { $_ -match "^${PackageName}(?:\:(.+))*$" }
|
||||
|
||||
$pattern = "^${PackageName}(?:\\(?<stream>[^:]+))?(?:\:(?<version>.+))?$"
|
||||
$p = $Options.ForcedPackages | ? { $_ -match $pattern }
|
||||
if (!$p) { return }
|
||||
|
||||
$global:au_Force = $true
|
||||
$global:au_Version = ($p -split ':')[1]
|
||||
$global:au_Force = $true
|
||||
$global:au_IncludeStream = $Matches['stream']
|
||||
$global:au_Version = $Matches['version']
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user