init
This commit is contained in:
parent
3f213642c9
commit
f90d7ee523
@ -57,7 +57,7 @@ spec:
|
||||
|
||||
- name: deleteExisting
|
||||
type: string
|
||||
default: "false"
|
||||
default: "true"
|
||||
description: Clean out the contents of the destination directory if it already exists before cloning.
|
||||
|
||||
- name: httpProxy
|
||||
@ -166,12 +166,16 @@ spec:
|
||||
if [ "$(params.deleteExisting)" = "true" ] && [ -d "$CLONE_DIR" ]; then
|
||||
echo "[INFO] Deleting existing directory $CLONE_DIR"
|
||||
rm -rf "$CLONE_DIR"
|
||||
echo "[INFO] Cloning repository..."
|
||||
git clone --depth=$(params.depth) $(params.url) "$CLONE_DIR"
|
||||
cd "$CLONE_DIR"
|
||||
else
|
||||
cd "$CLONE_DIR"
|
||||
git init
|
||||
git remote add origin $(params.url)
|
||||
git pull --depth=$(params.depth) origin master --allow-unrelated-histories
|
||||
fi
|
||||
|
||||
echo "[INFO] Cloning repository..."
|
||||
git clone --depth=$(params.depth) $(params.url) "$CLONE_DIR"
|
||||
cd "$CLONE_DIR"
|
||||
|
||||
if [ -n "$(params.refspec)" ]; then
|
||||
git fetch origin $(params.refspec)
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user