Skip to content

Commit

Permalink
git stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jmczerk committed May 18, 2024
1 parent 0790ebf commit 11147ff
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions startupscript/git-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,14 @@ ${RUN_AS_LOGIN_USER} "mkdir -p '${WORKBENCH_GIT_REPOS_DIR}'"
# to the git references, the corresponding git repo cloning will be skipped.
# Keep this as last thing in script. There will be integration test for git cloning (PF-1660). If this is last thing, then
# integration test will ensure that everything in script worked.
${RUN_AS_LOGIN_USER} "cd '${WORKBENCH_GIT_REPOS_DIR}' && wb git clone --all"

pushd "${WORKBENCH_GIT_REPOS_DIR}" || exit 1
wb resource list --type=GIT_REPO --format json | \
jq -c .[] | \
while read -r ITEM; do
GIT_REPO_NAME="$(echo "$ITEM" | jq -r .id)"
GIT_REPO_URL="$(echo "$ITEM" | jq -r .gitRepoUrl)"
if [[ ! -d "${GIT_REPO_NAME}" ]]; then
${RUN_AS_LOGIN_USER} git clone "${GIT_REPO_URL}" "${GIT_REPO_NAME}"
fi
done
popd || exit 1

0 comments on commit 11147ff

Please sign in to comment.