Skip to content

Commit

Permalink
sync with au-packages-template
Browse files Browse the repository at this point in the history
  • Loading branch information
majkinetor committed Nov 4, 2016
1 parent 6738ecb commit 5811f8c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
45 changes: 21 additions & 24 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,33 @@ init:
install:
- ps: 'Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version'
- ps: $PSVersionTable
- git --version
- ps: |
$x=$null; $is_branch = ($Env:au_version -ne $null) -and ([version]::TryParse($Env:au_version, [ref]$x) -eq $false)
if ($is_branch) {
pushd ..
git clone -q https://github.com/majkinetor/au.git
cd au
git fetch
git checkout -q $Env:au_version
./build.ps1 -Install -NoChocoPackage
popd
} else {
Install-PackageProvider -Name NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
$params = @{ Name = 'au' }
if ( $Env:au_version -ne $null ) { $params.MinimumVersion = $Env:au_version }
Install-Module @params
Get-Module au -ListAvailable | select Name, Version
}
git clone -q https://github.com/majkinetor/au.git $Env:TEMP/au
. "$Env:TEMP/au/scripts/Install-AU.ps1" $Env:au_version
build_script:
- ps: |
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] }
if ( ($Env:APPVEYOR_SCHEDULED_BUILD -ne 'true') -and ($Env:APPVEYOR_FORCED_BUILD -ne 'true') ) {
switch -regex ($Env:APPVEYOR_REPO_COMMIT_MESSAGE)
{
'\[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; choco pack; Push-Package; popd
}
return
}
}
}
./update_all.ps1 -ForcedPackages $forced
7z a au_temp.zip $Env:TEMP\chocolatey\au\*
artifacts:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ You can choose to use one or both of the different methods currently supported i

### Folder Structure

* au - The scripts for running Automatic Updater (AU) are here.
* automatic - where automatic packaging and packages are kept. These are packages that are automatically maintained using either [AU](https://chocolatey.org/packages/au) or [Ketarin](https://chocolatey.org/packages/ketarin)/[ChocolateyPackageUpdater](https://chocolatey.org/packages/chocolateypackageupdater) combo.
* icons - Where you keep icon files for the packages. This is done to reduce issues when packages themselves move around.
* ketarin - where ketarin jobs (aka applications or searches) exported as XML are kept. This is done to allow ease of contribution.
Expand All @@ -43,6 +42,8 @@ For setting up your own automatic package repository, please see [Automatic Pack
* PowerShell v4+.
* The [AU module](https://chocolatey.org/packages/au).

For daily operations check out the AU packages [template README](https://github.com/majkinetor/au-packages-template/blob/master/README.md).

### Getting started

1. Fork this repository and rename it to `chocolatey-packages` (on GitHub - go into Settings, Repository name and rename).
Expand All @@ -62,15 +63,14 @@ So for best visibility, enjoying the ease of using AppVeyor, and for a nice repo
You want to bring in all of your packages into the proper folders. We suggest using some sort of diffing tool to look at the differences between your current solution and this solution and then making adjustments to it. Pay special attention to the setup folder.

1. Bring over the following files to your package source repository:
* `au\*.*`
* `automatic\README.md`
* `icons\README.md`
* `ketarin\README.md`
* `ketarin\_KetarinChocolateyTemplate.xml`
* `manual\README.md`
* `ops\*.*`
* `setup\*.*`
* `appveyor.yml`
* `.appveyor.yml`
1. Inspect the following file and add the differences:
* `.gitignore`

Expand Down
1 change: 1 addition & 0 deletions setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
* Run `au_setup.ps1`.
* Configure AU [plugins](https://github.com/majkinetor/au/wiki/Plugins).
* Configure [AppVeyor](https://github.com/majkinetor/au/wiki/AppVeyor).
* Configure [local run](https://github.com/majkinetor/au/wiki#local-run).
18 changes: 11 additions & 7 deletions update_all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,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-AUPackages.md" #List of files to add to gist
Id = $Env:gist_id #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-AUPackages.md" #List of files to add to the gist
}

Git = @{
Expand Down Expand Up @@ -54,13 +54,17 @@ $Options = [ordered]@{
ForcedPackages = $ForcedPackages -split ' '
BeforeEach = {
param($PackageName, $Options )
if ($Options.ForcedPackages -contains $PackageName) { $global:au_Force = $true }
$p = $Options.ForcedPackages | ? { $_ -match "^${PackageName}(?:\:(.+))*$" }
if (!$p) { return }

$global:au_Force = $true
$global:au_Version = ($p -split ':')[1]
}
}

if ($ForcedPackages) { Write-Host "FORCED PACKAGES: $ForcedPackages" }
if ($ForcedPackages) { Write-Host "FORCED PACKAGES: $ForcedPackages" }
$global:au_Root = $Root #Path to the AU packages
$info = updateall -Name $Name -Options $Options
$global:info = updateall -Name $Name -Options $Options

#Uncomment to fail the build on AppVeyor on any package error
#if ($info.error_count.total) { throw 'Errors during update' }
#if ($global:info.error_count.total) { throw 'Errors during update' }

0 comments on commit 5811f8c

Please sign in to comment.