Skip to content

Commit 55696fe

Browse files
authored
Merge pull request #26 from screwdriver-cd/dir
Git clone to $SD_SOURCE_DIR
2 parents f217c9a + 4612337 commit 55696fe

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ class BitbucketScm extends Scm {
480480

481481
// Git clone
482482
command.push(`echo Cloning ${checkoutUrl}, on branch ${config.branch}`);
483-
command.push(`git clone --quiet --progress --branch ${config.branch} ${checkoutUrl}`);
484-
command.push(`cd ${config.repo}`);
483+
command.push(`git clone --quiet --progress --branch ${config.branch} `
484+
+ `${checkoutUrl} $SD_SOURCE_DIR`);
485485
// Reset to Sha
486486
command.push(`echo Reset to SHA ${checkoutRef}`);
487487
command.push(`git reset --hard ${checkoutRef}`);

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": "echo Cloning https://bitbucket.org/screwdriver-cd/scm-bitbucket, on branch master && git clone --quiet --progress --branch master https://bitbucket.org/screwdriver-cd/scm-bitbucket && cd scm-bitbucket && echo Reset to SHA 40171b678527 && git reset --hard 40171b678527 && echo Setting user name and user email && git config user.name sd-buildbot && git config user.email dev-null@screwdriver.cd"
3+
"command": "echo Cloning https://bitbucket.org/screwdriver-cd/scm-bitbucket, on branch master && git clone --quiet --progress --branch master https://bitbucket.org/screwdriver-cd/scm-bitbucket $SD_SOURCE_DIR && echo Reset to SHA 40171b678527 && git reset --hard 40171b678527 && echo Setting user name and user email && git config user.name sd-buildbot && git config user.email dev-null@screwdriver.cd"
44
}

test/data/prCommands.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": "echo Cloning https://bitbucket.org/screwdriver-cd/scm-bitbucket, on branch master && git clone --quiet --progress --branch master https://bitbucket.org/screwdriver-cd/scm-bitbucket && cd scm-bitbucket && echo Reset to SHA master && git reset --hard master && echo Setting user name and user email && git config user.name sd-buildbot && git config user.email dev-null@screwdriver.cd && echo Fetching PR and merging with master && git fetch origin prBranch && git merge 40171b678527"
3+
"command": "echo Cloning https://bitbucket.org/screwdriver-cd/scm-bitbucket, on branch master && git clone --quiet --progress --branch master https://bitbucket.org/screwdriver-cd/scm-bitbucket $SD_SOURCE_DIR && echo Reset to SHA master && git reset --hard master && echo Setting user name and user email && git config user.name sd-buildbot && git config user.email dev-null@screwdriver.cd && echo Fetching PR and merging with master && git fetch origin prBranch && git merge 40171b678527"
44
}

0 commit comments

Comments
 (0)