Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions src/commands/yarn_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ parameters:
description: The path to the yarn cache folder. Defaults to /tmp/yarn
type: string
default: "/tmp/yarn"
yarn_install_directory:
description: The working directory to run install at. Defaults to yarn's current working directory
type: string
default: ""

steps:
- when:
Expand All @@ -23,9 +27,20 @@ steps:
- restore_cache:
keys:
- yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json" }}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- run:
name: Yarn Install
command: "yarn install --frozen-lockfile --non-interactive --cache-folder <<parameters.cache_folder>>"
- when:
condition:
equal: ["", <<parameters.yarn_install_directory>>]
steps:
- run:
name: Yarn Install
command: "yarn install --frozen-lockfile --non-interactive --cache-folder <<parameters.cache_folder>>"
- unless:
condition:
equal: ["", <<parameters.yarn_install_directory>>]
steps:
- run:
name: Yarn Install (<<parameters.yarn_install_directory>>)
command: "yarn --cwd <<parameters.yarn_install_directory>> install --frozen-lockfile --non-interactive --cache-folder <<parameters.cache_folder>>"
- when:
condition: <<parameters.cache>>
steps:
Expand Down