Avoid cloning entire repos
This commit is contained in:
parent
cf486fe562
commit
b4bbce3020
20 changed files with 29 additions and 36 deletions
|
@ -9,3 +9,4 @@ RUN \
|
|||
apt-get -y clean
|
||||
|
||||
ADD run_stage.sh /usr/bin/run_stage
|
||||
ADD git-mini-clone.sh /usr/bin/git-mini-clone
|
||||
|
|
10
images/base/git-mini-clone.sh
Executable file
10
images/base/git-mini-clone.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
set -xe
|
||||
REPO="$1"
|
||||
REF="$2"
|
||||
DEST="$3"
|
||||
git init "$DEST"
|
||||
git -C "$DEST" remote add origin "$REPO"
|
||||
git -C "$DEST" fetch --depth=1 origin "$REF"
|
||||
git -C "$DEST" config advice.detachedHead false
|
||||
git -C "$DEST" checkout FETCH_HEAD
|
Loading…
Add table
Add a link
Reference in a new issue