Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Feny Mehta <[email protected]>
  • Loading branch information
fbm3307 committed Aug 13, 2024
1 parent 6f451ef commit 0c427bc
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions verify-replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,36 @@ TMP_DIR=/tmp/
BASE_REPO_PATH=$(mktemp -d ${TMP_DIR}replace-verify.XXX)
GH_BASE_URL_KS=https://github.com/kubesaw/
GH_BASE_URL_CRT=https://github.com/codeready-toolchain/
GH_KSCTL=${GH_BASE_URL_KS}ksctl
GH_HOST=${GH_BASE_URL_CRT}host-operator
GH_MEMBER=${GH_BASE_URL_CRT}member-operator
GH_REGSVC=${GH_BASE_URL_CRT}registration-service
GH_E2E=${GH_BASE_URL_CRT}toolchain-e2e
GH_TC=${GH_BASE_URL_CRT}toolchain-common
declare -a repos=("${GH_BASE_URL_KS}ksctl" "${GH_BASE_URL_CRT}host-operator" "${GH_BASE_URL_CRT}member-operator" "${GH_BASE_URL_CRT}registration-service" "${GH_BASE_URL_CRT}toolchain-e2e")
C_PATH=${PWD}
ERRORLIST=()

echo Initiating verify-replace on dependent repos
for repo in ${GH_HOST} ${GH_REGSVC} ${GH_KSCTL} ${GH_MEMBER} ${GH_E2E}
for repo in "${repos[@]}"
do
echo =========================================================================================
echo
echo $(basename $repo)
echo "$(basename $repo)"
echo
echo =========================================================================================
REPO_PATH=$BASE_REPO_PATH/$(basename $repo)
echo Cloning repo in /tmp
echo "Cloning repo in /tmp"
git clone --depth=1 $repo $REPO_PATH
echo Repo cloned successfully
cd $REPO_PATH
echo Initiating 'go mod replace' of current toolchain common version in dependent repos
echo "Repo cloned successfully"
cd $REPO_PATH || exit
echo "Initiating 'go mod replace' of current toolchain common version in dependent repos"
go mod edit -replace github.com/codeready-toolchain/toolchain-common=$C_PATH
make verify-dependencies || ERRORLIST+=($(basename $repo))
make verify-dependencies || ERRORLIST+="($(basename $repo))"
echo
echo =========================================================================================
echo
done
if [ ${#ERRORLIST[@]} -ne 0 ]; then
echo Below are the repos with error:
echo "Below are the repos with error: "
for e in ${ERRORLIST[*]}
do
echo $e
echo "$e"
done
else
echo No errors detected
echo "No errors detected"
fi

0 comments on commit 0c427bc

Please sign in to comment.