Skip to content

Commit de26b52

Browse files
committed
Mitigate #2387: Improve cloning logic
- Clone submodules in parallel - Improve workaround to #3415. Don't rely on GitHub to perform the merge on PRs
1 parent bd856dd commit de26b52

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.drone.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ clone:
33
clone:
44
image: plugins/git
55
commands:
6-
- sleep 5s
7-
- git init
8-
- git remote add origin $DRONE_REMOTE_URL
9-
- git fetch --no-tags origin $DRONE_COMMIT_REF
10-
- if [ $DRONE_BUILD_EVENT = "push" ]; then git reset --hard -q $DRONE_COMMIT_SHA; else git checkout -qf FETCH_HEAD; fi
11-
- git submodule update --init --recursive
6+
- git clone -b "$DRONE_BRANCH" "$DRONE_REMOTE_URL" .
7+
- git fetch origin "$DRONE_COMMIT_REF"
8+
- if [ "$DRONE_BUILD_EVENT" = "pull_request" ]; then git merge "$DRONE_COMMIT_SHA"; else git checkout -qf "$DRONE_COMMIT_SHA"; fi
9+
- git submodule update --init --recursive --jobs 3
1210

1311
pipeline:
1412
# TESTS:

0 commit comments

Comments
 (0)