Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
install-sfdx: heroku/install-sfdx@1.1.0
Use install-sfdx
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Install `sfdx` CLI and plugins.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
package | The sfdx CLI to install (npm package like "name@version") | No | sfdx-cli | string |
plugins | A comma-delimited list of sfdx plugins to install (npm packages like "name@version") | No | '' | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/ja/orbs/licensing
commands:
setup:
description: |
Install `sfdx` CLI and plugins.
parameters:
package:
default: sfdx-cli
description: The sfdx CLI to install (npm package like "name@version")
type: string
plugins:
default: ""
description: A comma-delimited list of sfdx plugins to install (npm packages like "name@version")
type: string
steps:
- run:
command: |
echo "npm install << parameters.package >>"
npm install << parameters.package >>
mkdir -p "$HOME/bin"
ln -s "$(pwd)/node_modules/sfdx-cli/bin/run" "$HOME/bin/sfdx"
# This includes special "\" to escape from CircleCI's parameter syntax
IFS=',' read -ra plugins \<<< "<< parameters.plugins >>"
for plugin in "${plugins[@]}"; do
echo "sfdx plugins:install $plugin"
sfdx plugins:install $plugin
done
sfdx version | tee current-sfdx-version.txt
sfdx plugins | tee current-sfdx-plugins.txt
name: Install sfdx CLI + plugins
description: |
Install `sfdx` CLI for Salesforce development.
version: 2.1