diff --git a/ci/deploy-all.sh b/ci/deploy-all.sh index 3ff5a6869..4d2883c71 100755 --- a/ci/deploy-all.sh +++ b/ci/deploy-all.sh @@ -44,6 +44,10 @@ if ! [ -x "$(command -v ${CONTAINER_CMD})" ]; then fi echo "Found: ${CONTAINER_CMD}" +# Clone forkliftci +# --------------- +bash ${script_dir}/git-clone-forkliftci.sh + # Install cluster # --------------- diff --git a/ci/git-clone-forkliftci.sh b/ci/git-clone-forkliftci.sh new file mode 100644 index 000000000..b8a452ff4 --- /dev/null +++ b/ci/git-clone-forkliftci.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -euo pipefail +script_dir=$(realpath $(dirname "$0")) +forkliftci_dir="${script_dir}/forkliftci" + +echo "" +echo "Git clone forkliftci repository" +echo "===============================" +echo "" + +# Check if the target directory exists and is a Git repository +if [ -d "$forkliftci_dir/.git" ]; then + echo "forkliftci already exists in $forkliftci_dir." +else + # If not, clone the repository into the target directory + echo "Cloning the forkliftci into $forkliftci_dir..." + + # In case we are running CI as different user + git clone https://github.com/kubev2v/forkliftci.git "$forkliftci_dir" + chmod -R ugo+rwx "$forkliftci_dir" +fi