Skip to content

Commit 567c742

Browse files
authored
fix: shallow clone submodules default (#103)
1 parent bc7f7b2 commit 567c742

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ class BitbucketScm extends Scm {
825825
'if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then',
826826
' export GIT_RECURSIVE_OPTION="";',
827827
'else',
828-
' export GIT_RECURSIVE_OPTION="--recursive";',
828+
' export GIT_RECURSIVE_OPTION="--recursive --shallow-submodules";',
829829
'fi'
830830
]),
831831
// Set sparse option
@@ -958,7 +958,7 @@ class BitbucketScm extends Scm {
958958
' if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then',
959959
` ${gitWrapper} "git submodule init";`,
960960
' else',
961-
` ${gitWrapper} "git submodule update --init --recursive";`,
961+
` ${gitWrapper} "git submodule update --init --recursive --depth 1";`,
962962
' fi;',
963963
'fi'
964964
])

test/data/childCommands.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "sd-checkout-code",
3-
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export CONFIG_URL=git@github.com:screwdriver-cd/parent-repo; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export CONFIG_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@github.com/screwdriver-cd/parent-repo; else export CONFIG_URL=https://github.com/screwdriver-cd/parent-repo; fi; && export SD_CONFIG_DIR=$SD_ROOT_DIR/config && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch master'; else echo 'Cloning external config repo github.com/screwdriver-cd/parent-repo'; if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'master' $CONFIG_URL $SD_CONFIG_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'master' $CONFIG_URL $SD_CONFIG_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -C $SD_CONFIG_DIR reset --hard 54321\"; echo Reset external config repo to 54321; fi && echo 'Cloning hostName/orgName/repoName, on branch branchName' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch branchName'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -v\" >/dev/null 2>&1; then echo 'Skipping git config'; else echo \"Setting user name and user email\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
3+
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive --shallow-submodules\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export CONFIG_URL=git@github.com:screwdriver-cd/parent-repo; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export CONFIG_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@github.com/screwdriver-cd/parent-repo; else export CONFIG_URL=https://github.com/screwdriver-cd/parent-repo; fi; && export SD_CONFIG_DIR=$SD_ROOT_DIR/config && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch master'; else echo 'Cloning external config repo github.com/screwdriver-cd/parent-repo'; if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'master' $CONFIG_URL $SD_CONFIG_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'master' $CONFIG_URL $SD_CONFIG_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -C $SD_CONFIG_DIR reset --hard 54321\"; echo Reset external config repo to 54321; fi && echo 'Cloning hostName/orgName/repoName, on branch branchName' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch branchName'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -v\" >/dev/null 2>&1; then echo 'Skipping git config'; else echo \"Setting user name and user email\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
44
}

test/data/commands.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "sd-checkout-code",
3-
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && echo 'Cloning hostName/orgName/repoName, on branch branchName' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch branchName'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -v\" >/dev/null 2>&1; then echo 'Skipping git config'; else echo \"Setting user name and user email\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
3+
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive --shallow-submodules\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && echo 'Cloning hostName/orgName/repoName, on branch branchName' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch branchName'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -v\" >/dev/null 2>&1; then echo 'Skipping git config'; else echo \"Setting user name and user email\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "sd-checkout-code",
3-
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && echo 'Cloning hostName/orgName/repoName, on branch commitBranch' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch commitBranch'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'commitBranch' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'commitBranch' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -v\" >/dev/null 2>&1; then echo 'Skipping git config'; else echo \"Setting user name and user email\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
3+
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive --shallow-submodules\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && echo 'Cloning hostName/orgName/repoName, on branch commitBranch' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch commitBranch'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'commitBranch' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'commitBranch' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -v\" >/dev/null 2>&1; then echo 'Skipping git config'; else echo \"Setting user name and user email\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
44
}

0 commit comments

Comments
 (0)