Skip to content

Commit

Permalink
Merge pull request MicrosoftDocs#2938 from MicrosoftDocs/users/ramiMS…
Browse files Browse the repository at this point in the history
…FT/1821119

NuGet path variable
  • Loading branch information
PRMerger12 authored Mar 17, 2021
2 parents 57faeac + 6f73532 commit cf60a3d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/pipelines/release/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Pipeline caching and [pipeline artifacts](../artifacts/pipeline-artifacts.md) pe

* **Use pipeline caching** when you want to improve build time by reusing files from previous runs (and not having these files will not impact the job's ability to run).

## Using the Cache task
## Use Cache task

Caching is added to a pipeline using the `Cache` pipeline task. This task works like any other task and is added to the `steps` section of a job.

Expand All @@ -33,7 +33,7 @@ When a cache step is encountered during a run, the task will restore the cache b
> [!NOTE]
> Caches are immutable, meaning that once a cache is created, its contents cannot be changed. See [Can I clear a cache?](#can-i-clear-a-cache) in the FAQ section for additional details.
### Configuring the task
### Configure Cache task

The `Cache` task has two required inputs: `key` and `path`.

Expand Down Expand Up @@ -150,15 +150,15 @@ When a cache step is encountered during a run, the cache identified by the key i
|--------|------|-------|
| Source branch | Yes | No |
| Target branch | Yes | No |
| Intermediate branch (e.g. `refs/pull/1/merge`) | Yes | Yes |
| Intermediate branch (such as `refs/pull/1/merge`) | Yes | Yes |
| main branch | Yes | No |

### Pull request fork runs

| Branch | Read | Write |
|--------|------|-------|
| Target branch | Yes | No |
| Intermediate branch (e.g. `refs/pull/1/merge`) | Yes | Yes |
| Intermediate branch (such as `refs/pull/1/merge`) | Yes | Yes |
| main branch | Yes | No |

> [!TIP]
Expand Down Expand Up @@ -208,9 +208,9 @@ steps:
- script: bundle install
```

## ccache (C/C++)
## Ccache (C/C++)

[ccache](https://ccache.dev/) is a compiler cache for C/C++. To use ccache in your pipeline make sure `ccache` is installed, and optionally added to your `PATH` (see [ccache run modes](https://ccache.dev/manual/3.7.1.html#_run_modes)). Set the `CCACHE_DIR` environment variable to a path under `$(Pipeline.Workspace)` and cache this directory.
[Ccache](https://ccache.dev/) is a compiler cache for C/C++. To use Ccache in your pipeline make sure `Ccache` is installed, and optionally added to your `PATH` (see [Ccache run modes](https://ccache.dev/manual/3.7.1.html#_run_modes)). Set the `CCACHE_DIR` environment variable to a path under `$(Pipeline.Workspace)` and cache this directory.

**Example**:

Expand All @@ -234,7 +234,7 @@ steps:
> [!NOTE]
> In this example, the key is a fixed value (the OS name) and because caches are immutable, once a cache with this key is created for a particular scope (branch), the cache cannot be updated. This means subsequent builds for the same branch will not be able to update the cache even if the cache's contents have changed. This problem will be addressed in an upcoming feature: [10842: Enable fallback keys in Pipeline Caching](https://github.com/microsoft/azure-pipelines-tasks/issues/10842)

See [ccache configuration settings](
See [Ccache configuration settings](
https://ccache.dev/manual/latest.html#_configuration_settings) for more options, including settings to control compression level.

## Docker images
Expand Down Expand Up @@ -354,7 +354,7 @@ If you use `PackageReferences` to manage NuGet dependencies directly within your

```yaml
variables:
NUGET_PACKAGES: $(UserProfile)/.nuget/packages
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
steps:
- task: Cache@2
Expand Down Expand Up @@ -501,7 +501,7 @@ If you experience problems enabling caching for your project, first check the li

### Can I clear a cache?

Clearing a cache is currently not supported. However you can add a string literal (e.g. `version2`) to your existing cache key to change the key in a way that avoids any hits on existing caches. For example, change the following cache key from this:
Clearing a cache is currently not supported. However you can add a string literal (such as `version2`) to your existing cache key to change the key in a way that avoids any hits on existing caches. For example, change the following cache key from this:

```yaml
key: 'yarn | "$(Agent.OS)" | yarn.lock'
Expand All @@ -515,7 +515,7 @@ key: 'version2 | yarn | "$(Agent.OS)" | yarn.lock'

### When does a cache expire?

A cache will expire after 7 days of no activity.
A cache will expire after seven days of no activity.

### Is there a limit on the size of a cache?

Expand Down

0 comments on commit cf60a3d

Please sign in to comment.