Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

AppVeyor

Miodrag Milić edited this page Nov 2, 2016 · 55 revisions

You can make AU updater run on AppVeyor.

For this to work you must create account and then create the .appveyor.yml file in the package repository root. AU provides an AppVeyor build template that you can use to quickly get started.

Setup

  1. Go to AppVeyor and sign up/sign in. https://ci.appveyor.com
  2. Set up new AppVeyor project: https://ci.appveyor.com/projects/new
  3. Go to project settings and ensure the following items are set (these items cannot be configured in the yaml):
  • In Build Schedule, set up the cron job - if we want to run this three times a day - set it like this: 5 */6 * * *. This ensures it runs at 06:05, 12:05, and 18:05. You can use crontab.guru for help with this.
  • Ensure Skip branches without appveyor.yml is checked.
  • Click Save.

This is enough to make AppVeyor run the build. However, if you want it to use all AU plugins you need to set few environment variables. Edit appveyor.yml environment and create secure variables. Go to encrypt tool and log in, then:

  • Get encrypted values for
    • Github password or api token (only if you use non anonymous Gist and/or Git plugins).
    • Email password (only if you use email for notifications).
    • Chocolatey API key (mandatory).
  • Edit the appveyor.yml to add those values in and also fill in all other non-secure variables.

Its advisable to disable build on push request as some plugins will fail due to the way AppVeyor handles secrets:

Secure variables are not decoded during Pull Request builds which prevents someone from submitting PR with malicious build script displaying those variables

Go to your Github repository settings - Repository Settings -> Webhooks - and edit the AppVeyor hook then uncheck Pull request.

Sending commands to AppVeyor

You can send commands to build server using specific keywords on the first line of the commit message.

Forcing update of set of packages

You can force update of specific packages by sending specially crafted commit message keyword:

git commit -m '[AU pkg1 pkg2:ver2 ... pkgN ]' --allow-empty

which will trigger

./update_all.ps1 -ForcedPackages 'pkg1 pkg2 ...'

that will force update for given packages. Invalid package names are ignored and version is optional.

NOTE: In order for this NOT to produce and push a chocolatey package with version set to fixed choco notation you need to set the package version to lower then current RemoteVersion (0.0 for example). On the other hand, if you want the fix notation, you should set the package version equal to RemoteVersion.

Pushing specific automatic or manual packages

You can push any package on any repository path using simple push command:

git commit -m '[PUSH pkg1 pkg2 ... pkgN ]' --allow-empty

This will choco pack the package and use AU function Push-Package to publish it to the community repository. You are responsible for setting correct nuspec version. This will not invoke AU updater at all and will simply exit after each package is pushed. No report is available, build output should be enough.

Notes

Clone this wiki locally