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