tag:help.appveyor.com,2012-11-13:/discussions/questions/31063-separate-cache-statements-per-operating-systemAppVeyor: Discussion 2018-12-05T23:33:58Ztag:help.appveyor.com,2012-11-13:Comment/466223962018-12-05T16:07:12Z2018-12-05T16:07:12ZSeparate cache statements per operating system?<div><p>Sure, this is described <a href="https://www.appveyor.com/docs/build-configuration/#specializing-matrix-job-configuration">here</a> with the following as an example.</p>
<pre>
<code>image:
- Visual Studio 2017
- Ubuntu
build:
project: src
publish_wap: true
verbosity: minimal
for:
-
matrix:
only:
- image: Ubuntu
cache:
-/home/appveyor/.nuget</code>
</pre></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/466223962018-12-05T21:03:28Z2018-12-05T21:03:28ZSeparate cache statements per operating system?<div><p>OK I didn't realize for: was that flexible based on the example. Thanks!</p></div>Justin Grotetag:help.appveyor.com,2012-11-13:Comment/466223962018-12-05T21:33:02Z2018-12-05T21:33:03ZSeparate cache statements per operating system?<div><p>I tried this and it worked if I only specify one matrix: statement. However, when I try the second matrix statement for the Windows (for windows only tasks) the Appveyor YAML Validator fails saying 'Invalid "matrix" setting: cache (Line: 49, Column: 5)'</p>
<p>Am I doing the syntax right? It validated as valid YAML otherwise (attached). I tried simplifying it down to just cache and same result.</p></div>Justin Grotetag:help.appveyor.com,2012-11-13:Comment/466223962018-12-05T21:49:03Z2018-12-05T21:49:03ZSeparate cache statements per operating system?<div><p>Nevermind I figured it out, my indents were a little off. Here's the<br>
finished .yml for posterity for future searchers.</p>
<h1><a name="see-http-www-appveyor-com-docs-appveyor-yml-for-many-more-options" class="anchor" href="#see-http-www-appveyor-com-docs-appveyor-yml-for-many-more-options"></a>See <a href="http://www.appveyor.com/docs/appveyor-yml">http://www.appveyor.com/docs/appveyor-yml</a> for many more options</h1>
<p>version: '{build}-{branch}'</p>
<p>image:<br>
- Visual Studio 2017 - Ubuntu</p>
<p>#Encrypted Variables - <a href="https://ci.appveyor.com/tools/encrypt">https://ci.appveyor.com/tools/encrypt</a> environment:<br>
GitHubUserName: JustinGrote<br>
GitHubAPIKey:<br>
secure: MolSn4T0aNBnph/BVkKA8HQ1qvpJjIV3CcjRg3DYynijlOVL5RftqbXD5l0IUw6L<br>
NuGetAPIKey:<br>
secure: HncD30pn+cWRepdP28pyB1l4BNg3x3MdvcNV8EysOhQ5kBFMHVyXiQM0whuUW78P<br>
APPVEYOR_SSH_KEY: ssh-rsa<br>
AAAAB3NzaC1yc2EAAAABJQAAAQEAqOJfFgHyHbQk1d/oCxPn2mGCd92GOFaT9PvA4pICCpMH8w+9Cv1OZpNcwvk+RIzTO9Fm8ilfK/x4gUFrRmAp9BkkmFDhqol0/3e2ZrsxjsYJsUcic/fcRINrDTrwSMaOghUO2fcSTJ3N7WsGKlcG3NXszPgJD95Ulpgk6qvclWJEt15xoYuqHnlhohkXA3zbfcWzuGsMZkuv1fMZB5nEjfLKegzCesQ+swAUaEbUxOeKIFD4VlluDuKONeKqDTETkpLZXKV8pRwDBxgD3i8zQJcSGZ8XoYyPLPbZD/J7AEOap6uYOr4jC8EbFug8SsnxPQ7vxnwslgHoRFzNeYlkIQ==<br>
d8:72:f4:1f:1f:31:4c:01:ce:3e:5a:ec:1b:31:8b:da rsa-jgrote-Jan2016</p>
<h1><a name="skip-on-updates-to-the-readme-" class="anchor" href="#skip-on-updates-to-the-readme-"></a>Skip on updates to the readme.</h1>
<h1><a name="we-can-force-this-by-adding-skip-ci-or-ci-skip-anywhere-in-commit" class="anchor" href="#we-can-force-this-by-adding-skip-ci-or-ci-skip-anywhere-in-commit"></a>We can force this by adding [skip ci] or [ci skip] anywhere in commit</h1>
<p>message<br>
skip_commits:<br>
message: /updated README.*|Update README.*s/</p>
<h1><a name="skip-tags-with-github" class="anchor" href="#skip-tags-with-github"></a>Skip Tags with GitHub</h1>
<h1><a name="releases-are-tracked-and-tagged-by-the-build-script-in-appveyor-having" class="anchor" href="#releases-are-tracked-and-tagged-by-the-build-script-in-appveyor-having"></a>Releases are tracked and tagged by the build script in Appveyor, having</h1>
<p>this enabled results in a double build<br>
skip_tags: true</p>
<p>#Kick off the CI/CD pipeline. We do test and build in the same script #To be portable to non-Appveyor builds build_script:<br>
- ps: .\build.ps1</p>
<p>#Capture the artifacts artifacts:<br>
- path: Release*.zip name: Powershell Module Zip Package</p>
<ul>
<li>path: Release*.nupkg name: Powershell Module NuGet Package</li>
</ul>
<p>#Save the following files for faster subsequent builds for:<br>
- matrix: only:<br>
- image: Ubuntu init:<br>
- ps: if ($isLinux -and ($env:APPVEYOR_REPO_COMMIT_MESSAGE -match 'AppveyorSSHDebug')) {"export APPVEYOR_SSH_BLOCK=true" + [Environment]::NewLine + (iwr -useb ' <a href="https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh').content">https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable...</a><br>
| bash -e -} cache:<br>
- '/home/appveyor/.nuget' - '/home/appveyor/.cache/powershell' - '/home/appveyor/.local/share/NuGet' - '/home/appveyor/.local/share/powershell' - '/home/appveyor/.config/share/powershell' on_finish:<br>
- ps: if ($isLinux -and ($env:APPVEYOR_REPO_COMMIT_MESSAGE -match 'AppveyorSSHDebug')) {"export APPVEYOR_SSH_BLOCK=true" + [Environment]::NewLine + (iwr -useb ' <a href="https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh').content">https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable...</a><br>
| bash -e -}</p>
<ul>
<li>matrix: only:<br></li>
<li>image: Visual Studio 2017 init:<br></li>
<li>ps: if ($isWindows -and ($env:APPVEYOR_REPO_COMMIT_MESSAGE -match 'AppveyorRDPDebug')) {$blockRdp = $true; iex (iwr -useb ' <a href="https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1').content">https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable...</a><br>
} cache:<br></li>
<li>'%USERPROFILE%\Documents\WindowsPowerShell\Modules -> PSModule.requirements.ps1'<br></li>
<li>'%USERPROFILE%\Documents\PowerShell\Modules -> PSModule.requirements.ps1'</li>
<li>'%LOCALAPPDATA%\PackageManagement\NuGet' deploy_script:<br></li>
<li>ps: .\build.ps1 Publish on_finish:<br></li>
<li>ps: if ($isWindows -and ($env:APPVEYOR_REPO_COMMIT_MESSAGE -match 'AppveyorRDPDebug')) {$blockRdp = $true; iex (iwr -useb ' <a href="https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1').content">https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable...</a><br>
}</li>
</ul></div>Justin Grotetag:help.appveyor.com,2012-11-13:Comment/466223962018-12-05T21:50:39Z2018-12-05T21:50:41ZSeparate cache statements per operating system?<div><p>Err, that formatting didn't come out as expected. Attached.</p></div>Justin Grotetag:help.appveyor.com,2012-11-13:Comment/466223962018-12-05T23:33:58Z2018-12-05T23:33:58ZSeparate cache statements per operating system?<div><p>Cool, thanks for your contribution to posterity!</p></div>Owen McDonnell