- "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"
0 commit comments