File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ Paths accepted by `git sparse-checkout set`.
2020
2121Whether to pass ` --no-cone ` to ` git sparse-checkout ` so that the paths are considered to be a list of patterns.
2222
23+ #### ` skip_ssh_keyscan ` ('true' or 'false')
24+
25+ Whether to skip ssh-keyscan step. This will skip adding each ssh public key into the known-hosts file. Only use if ssh keys are already setup.
26+
2327## Example
2428
2529Below is an example for using sparse-checkout plugin.
Original file line number Diff line number Diff line change @@ -11,16 +11,20 @@ NO_CONE_OPTION="$(plugin_read_config NO_CONE "false")"
1111NO_CONE_PARAM=" "
1212[[ $NO_CONE_OPTION = false ]] || NO_CONE_PARAM=" --no-cone"
1313
14+ SKIP_SSH_KEYSCAN_OPTION=" $( plugin_read_config SKIP_SSH_KEYSCAN " false" ) "
15+
1416if plugin_read_list_into_result PATHS; then
1517 CHECKOUT_PATHS=(" ${result[@]} " )
1618else
1719 echo " Missing 'paths' option in the plugin"
1820 exit 1
1921fi
2022
21- echo " Scanning SSH keys for remote git repository"
22- [[ -d ~ /.ssh ]] || mkdir -p ~ /.ssh
23- ssh-keyscan " ${BUILDKITE_REPO_SSH_HOST} " >> ~ /.ssh/known_hosts
23+ if [[ " $SKIP_SSH_KEYSCAN_OPTION " != " false" ]]; then
24+ echo " Scanning SSH keys for remote git repository"
25+ [[ -d ~ /.ssh ]] || mkdir -p ~ /.ssh
26+ ssh-keyscan " ${BUILDKITE_REPO_SSH_HOST} " >> ~ /.ssh/known_hosts
27+ fi
2428
2529echo " Creating sparse-checkout with paths: ${CHECKOUT_PATHS[*]} "
2630
You can’t perform that action at this time.
0 commit comments