|
| 1 | +# Setting up Cake Contrib Addins on CI providers |
| 2 | + |
| 3 | +<!-- markdownlint-disable --> |
| 4 | +<!-- TOC depthfrom:2 depthto:6 --> |
| 5 | + |
| 6 | +- [What is this](#what-is-this) |
| 7 | +- [Using AppVeyor](#using-appveyor) |
| 8 | + - [Available Environment Variables](#available-environment-variables) |
| 9 | + - [Using Cake.Recipe 2.x with AppVeyor](#using-cakerecipe-2x-with-appveyor) |
| 10 | + - [Using Cake.Recipe 1.x with AppVeyor](#using-cakerecipe-1x-with-appveyor) |
| 11 | + - [Additional notes](#additional-notes) |
| 12 | +- [Using Azure Pipelines](#using-azure-pipelines) |
| 13 | + |
| 14 | +<!-- /TOC --> |
| 15 | +<!-- markdownlint-enable --> |
| 16 | + |
| 17 | +## What is this |
| 18 | + |
| 19 | +The goal of this document is to help setting up new builds for different build |
| 20 | +providers under the cake-contrib organization. |
| 21 | +Some CI providers may already have Environment Variables or secrets set on the |
| 22 | +organization level that are available during the build. |
| 23 | + |
| 24 | +## Using AppVeyor |
| 25 | + |
| 26 | +### Available Environment Variables |
| 27 | + |
| 28 | +The following environment variables are accessible when running builds on the |
| 29 | +AppVeyor CI provider and will be available without further configuration. |
| 30 | +Private variables are noted, which means they will no be available in pull requests. |
| 31 | +However, these private variables can be made available in pull requests |
| 32 | +originating from the same repository. |
| 33 | + |
| 34 | +- `APPVEYOR_API_TOKEN` (_secret variable_) |
| 35 | +- `AZURE_PASSWORD` |
| 36 | +- `AZURE_SOURCE` |
| 37 | +- `AZURE_USER` |
| 38 | +- `GITHUB_PASSWORD` (_secret variable, can be used as a GitHub Token_) |
| 39 | +- `GITHUB_USERNAME` |
| 40 | +- `GITTER_ROOM_ID` (_secret variable_) |
| 41 | +- `GITTER_TOKEN` (_secret variable_) |
| 42 | +- `GPR_PASSWORD` |
| 43 | +- `GPR_SOURCE` |
| 44 | +- `GPR_USER` |
| 45 | +- `MYGET_API_KEY` (_secret variable_) |
| 46 | +- `MYGET_SOURCE` |
| 47 | +- `NUGET_API_KEY` (_secret variable_) |
| 48 | +- `NUGET_SOURCE` |
| 49 | +- `TWITTER_ACCESS_TOKEN_SECRET` (_secret variable_) |
| 50 | +- `TWITTER_ACCESS_TOKEN` (_secret variable_) |
| 51 | +- `TWITTER_CONSUMER_KEY` (_secret variable_) |
| 52 | +- `TWITTER_CONSUMER_SECRET` (_secret variable_) |
| 53 | +- `WYAM_ACCESS_TOKEN` (_secret variable_) |
| 54 | +- `WYAM_DEPLOY_BRANCH` |
| 55 | + |
| 56 | +### Using Cake.Recipe 2.x with AppVeyor |
| 57 | + |
| 58 | +While the latest version of Cake.Recipe is currently in pre-release stage, |
| 59 | +it is entirely usable on AppVeyor. |
| 60 | +We already assume you have configured the repository to use Cake.Recipe, |
| 61 | +otherwise please see its [Getting Started][cake-recipe-started] on how to proceed. |
| 62 | + |
| 63 | +_Please see the [Cake.Recipe documentatian][cake-recipe-migrate] on how to upgrade |
| 64 | +from Cake.Recipe 1.x te 2.x._ |
| 65 | + |
| 66 | +If you do not need to specify any additional configuration, and wishes to just |
| 67 | +have it work with default options. |
| 68 | +Then the most basic build script can be specified as follows: |
| 69 | + |
| 70 | +```yml |
| 71 | +# This image may be changed when needed, |
| 72 | +# but the recommendation is to keep it on |
| 73 | +# Visual Studio 2019. |
| 74 | +image: Visual Studio 2019 |
| 75 | + |
| 76 | +#---------------------------------# |
| 77 | +# Build Script # |
| 78 | +#---------------------------------# |
| 79 | +build_script: |
| 80 | + - ps: .\build.ps1 -Target CI |
| 81 | + |
| 82 | +# Tests |
| 83 | +test: off |
| 84 | + |
| 85 | +#---------------------------------# |
| 86 | +# Branches to build # |
| 87 | +#---------------------------------# |
| 88 | +branches: |
| 89 | + # Whitelist |
| 90 | + only: |
| 91 | + - develop |
| 92 | + - master |
| 93 | + - /release/.*/ |
| 94 | + - /hotfix/.*/ |
| 95 | + |
| 96 | +#---------------------------------# |
| 97 | +# Build Cache # |
| 98 | +#---------------------------------# |
| 99 | +cache: |
| 100 | + # Update this cache variable to match |
| 101 | + # your current setup. |
| 102 | + - "tools -> recipe.cake,tools/packages.config" |
| 103 | + |
| 104 | +#---------------------------------# |
| 105 | +# Environment Variables # |
| 106 | +#---------------------------------# |
| 107 | + |
| 108 | +environment: |
| 109 | + # We set MYGET_SOURCE to an empty variable due to known issues when pushing |
| 110 | + # packages to MyGet |
| 111 | + MYGET_SOURCE: |
| 112 | +``` |
| 113 | +
|
| 114 | +**WARNING: At this time it is not recommended to add a matrix to build on |
| 115 | +multiple platforms on AppVeyor due to the increased build time necessary.** |
| 116 | +
|
| 117 | +### Using Cake.Recipe 1.x with AppVeyor |
| 118 | +
|
| 119 | +Configuring AppVeyor to build projects targeting Cake.Recipe 1.x is very similar |
| 120 | +to how to use Cake.Recipe 2.x documentation. |
| 121 | +The main change between the build script on AppVeyor is mainly to change the |
| 122 | +build target from `CI` to `AppVeyor`. |
| 123 | +See the below build script as an example of this. |
| 124 | + |
| 125 | +```yml |
| 126 | +image: Visual Studio 2017 |
| 127 | +#---------------------------------# |
| 128 | +# Build Script # |
| 129 | +#---------------------------------# |
| 130 | +build_script: |
| 131 | + - ps: .\build.ps1 -Target AppVeyor |
| 132 | +
|
| 133 | +# Tests |
| 134 | +test: off |
| 135 | +
|
| 136 | +#---------------------------------# |
| 137 | +# Branches to build # |
| 138 | +#---------------------------------# |
| 139 | +branches: |
| 140 | + # Whitelist |
| 141 | + only: |
| 142 | + - develop |
| 143 | + - master |
| 144 | + - /release/.*/ |
| 145 | + - /hotfix/.*/ |
| 146 | +
|
| 147 | +#---------------------------------# |
| 148 | +# Build Cache # |
| 149 | +#---------------------------------# |
| 150 | +cache: |
| 151 | + # Update this cache variable to match |
| 152 | + # your current setup. |
| 153 | + - "tools -> recipe.cake,tools/packages.config" |
| 154 | +
|
| 155 | +#---------------------------------# |
| 156 | +# Environment Variables # |
| 157 | +#---------------------------------# |
| 158 | +
|
| 159 | +environment: |
| 160 | + # We set MYGET_SOURCE to an empty variable due to known issues when pushing |
| 161 | + # packages to MyGet |
| 162 | + MYGET_SOURCE: |
| 163 | +``` |
| 164 | + |
| 165 | +**WARNING: At this time it is not recommended to add a matrix to build on |
| 166 | +multiple platforms on AppVeyor due to the increased build time necessary.** |
| 167 | + |
| 168 | +#### Additional notes |
| 169 | + |
| 170 | +If you do not plan to use AppVeyor as the preferred build platform, |
| 171 | +it may not be possible to use Cake.Recipe 1.x. Please migrate to the latest 2.x |
| 172 | +pre-release instead. |
| 173 | + |
| 174 | +## Using Azure Pipelines |
| 175 | + |
| 176 | +There is currently no documentation on how to set up Cake Contrib addins for |
| 177 | +building on Azure Pipelines. |
| 178 | + |
| 179 | +<!-- The following migrate docs need to be |
| 180 | + updated when migration documentation are |
| 181 | + complete --> |
| 182 | + |
| 183 | +[cake-recipe-migrate]: https://github.com/cake-contrib/Cake.Recipe/issues/612 |
| 184 | +[cake-recipe-started]: https://cake-contrib.github.io/Cake.Recipe/docs/usage/getting-started-with-cake-recipe |
0 commit comments