Skip to content

Commit

Permalink
Update scripts based on coreteam packages repository
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCakeIsNaOH committed Jan 11, 2024
1 parent b0c3ce7 commit c4b07e5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
28 changes: 24 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
version: '{build}'
max_jobs: 1
image: Visual Studio 2022
# History plugin requires complete log
#clone_depth: 5
branches:
Expand Down Expand Up @@ -41,12 +42,31 @@ environment:
api_key:
secure: YOUR_CHOCO_API_KEY_HERE_ENCRYPTED_STRING # https://ci.appveyor.com/tools/encrypt

#Chocolatey version we want to use when checking for updates (usually latest).
choco_version: '2.2.2'
nupkg_cache_path: C:\packages

init:
- git config --global user.email "[email protected]"
- git config --global user.name "Chocolatey"
- git config --global user.name "Chocolatey-AU"
- git config --global core.safecrlf false

install:
- ps: |
$chocoVersion = $Env:choco_version
if (!(Test-Path "$env:nupkg_cache_path")) { mkdir -Force "$env:nupkg_cache_path" }
@{
'chocolatey' = $chocoVersion
# Uncomment and input the version if you are using any of these in AU scripts
# 'wormies-au-helpers' = 'VERSION_HERE'
# 'chocolatey-core.extension' = 'VERSION_HERE'
# 'autohotkey.install' = 'VERSION_HERE'
}.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') { choco upgrade $_.Key --version $_.Value --source ${env:nupkg_cache_path} --allow-downgrade --pre }
else { choco install $_.Key --version $_.Value --source ${env:nupkg_cache_path} --ignore-dependencies }
}
rm "$env:ChocolateyInstall\logs\*.log"
- ps: 'Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version'
- ps: $PSVersionTable
- git --version
Expand All @@ -60,9 +80,6 @@ install:
' {0,-20} {1}' -f 'SCHEDULED BUILD:', ($Env:APPVEYOR_SCHEDULED_BUILD -eq 'true')
' {0,-20} {1}' -f 'FORCED BUILD:' , ($Env:APPVEYOR_FORCED_BUILD -eq 'true')
' {0,-20} {1}' -f 'RE BUILD:' , ($Env:APPVEYOR_RE_BUILD -eq 'true')
# Uncomment the below line if you are using any of the functions from chocolatey-core.extension - https://chocolatey.org/packages/chocolatey-core.extension. Ensure you also have it listed in your package's dependencies
# - cinst chocolatey-core.extension
build_script:
- ps: |
Expand Down Expand Up @@ -107,5 +124,8 @@ notifications:
on_build_failure: true
on_build_status_changed: true

cache:
- '%nupkg_cache_path% -> .appveyor.yml'

#on_finish:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
6 changes: 6 additions & 0 deletions update_all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ $Options = [ordered]@{
'The operation has timed out'
'Internal Server Error'
'Service Temporarily Unavailable'
'The connection was closed unexpectedly.'
'package version already exists'
'already exists on a Simple OData Server' # https://github.com/chocolatey/chocolatey.org/issues/613
'Conflict'
'A system shutdown has already been scheduled' # https://gist.github.com/choco-bot/a14b1e5bfaf70839b338eb1ab7f8226f#wps-office-free
)
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
Expand All @@ -28,6 +33,7 @@ $Options = [ordered]@{
'Internal Server Error'
'An exception occurred during a WebClient request'
'remote session failed with an unexpected state'
'The connection was closed unexpectedly.'
)
#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
Expand Down

0 comments on commit c4b07e5

Please sign in to comment.