> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# valimail/dependency-manager

Restore, install, and cache dependencies like Ruby gems and JS packages.


## Commands

### bundle-gems

Verifies dependencies are met by installed gems or installs gems


| Parameter | Type | Default | Description |
|---|---|---|---|
| `bundle-path` | string | vendor/bundle | Path to store gems bundle |

### cache-gems

Saves installed bundle and cached rubygems to persistent cache


| Parameter | Type | Default | Description |
|---|---|---|---|
| `bundle-path` | string | vendor/bundle | Path to store gems bundle |
| `cache-version` | string | v1 | Version prefix to use in cache key |

### cache-packages

Saves installed node packages to persistent cache


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Version prefix to use in cache key |
| `node-modules-path` | string | node_modules | Path to store packages |
| `yarn-cache-path` | string | ~/.cache/yarn | Path to cache yarn packages |

### cache-webpacker-packages

Saves compiled webpacker packages to persistent cache


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Version prefix to use in cache key |
| `public-packs-path` | string | public/packs | Path to store webpacker packages |

### clean-gems

Cleanup old gems so they are not cached


### install-gems

Restore, install, and cache Ruby gems


| Parameter | Type | Default | Description |
|---|---|---|---|
| `bundle-gems` | boolean | true |  |
| `bundle-path` | string | vendor/bundle | Path to store gems bundle |
| `cache-gems` | boolean | true |  |
| `cache-version` | string | v1 | Version prefix to use in cache key |
| `clean-gems` | boolean | true |  |
| `restore-gems` | boolean | true |  |
| `rubygems-version` | string |  | Which version of Rubygems to target for install, empty is latest |
| `update-bundler` | boolean | true |  |

### install-go-dependencies

Install Go dependencies


### install-go-modules

Restore, install, and cache Go modules


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Version prefix to use in cache key |

### install-packages

Restore, install, and cache JS packages using Yarn


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-packages` | boolean | true |  |
| `cache-version` | string | v1 | Version prefix to use in cache key |
| `cache-webpacker-packages` | boolean | false |  |
| `node-modules-path` | string | node_modules | Path to store packages |
| `public-packs-path` | string | public/packs | Path to store webpacker packages |
| `restore-packages` | boolean | true |  |
| `restore-webpacker-packages` | boolean | false |  |
| `yarn-cache-path` | string | ~/.cache/yarn | Path to cache yarn packages |
| `yarn-compile` | boolean | false |  |
| `yarn-install` | boolean | true |  |

### install-postgres-client

Install PostgreSQL client tools


### install-requirements

Install Python requirements


### install-yarn

Install nvm, nodejs and yarn


| Parameter | Type | Default | Description |
|---|---|---|---|
| `node-major-version` | string | 22 |  |

### restore-gems

Tries to restore cached gems from several different cache-keys


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Version prefix to use in cache key |

### restore-packages

Tries to restore cached packages from several different cache-keys


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Version prefix to use in cache key |

### restore-webpacker-packages

Tries to restore cached webpacker packages from several different cache-keys


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Version prefix to use in cache key |

### update-bundler

Update rubygems and bundler


| Parameter | Type | Default | Description |
|---|---|---|---|
| `rubygems-version` | string |  | Which version of Rubygems to target for install, empty is latest |

## Examples

### default

Install dependencies using the default cache-version ("v1").


```yaml
jobs:
  setup-job:
    executor:
      name: ruby-system
    steps:
      - checkout
      - install_required_software
      - dependency-manager/install-gems
      - dependency-manager/install-packages
orbs:
  dependency-manager: valimail/dependency-manager@0.1.2
version: 2.1
```

### simple

Install dependencies, explicitly setting the cache-version parameter (recommended).


```yaml
jobs:
  setup-job:
    executor:
      name: ruby-system
    steps:
      - checkout
      - install_required_software
      - dependency-manager/install-gems:
          cache-version: v3
      - dependency-manager/install-packages:
          cache-version: v2
orbs:
  dependency-manager: valimail/dependency-manager@0.1.2
version: 2.1
```