-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: ca55: Avoid to run git clone again when clean build
Git clone takes a lot of time and network resource. By this patch, local repositories into common_data/repo direcotry are used instead of network repository if common_data/repo is exist. Signed-off-by: Yuya Hamamachi <[email protected]>
- Loading branch information
1 parent
f40d419
commit df7ae32
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash -eu | ||
|
||
SCRIPT_DIR=$(cd `dirname $0` && pwd) | ||
repolist=$(grep -h url: ./*.yaml | grep -v "^#" | awk '{print $2}' | sed 's/"//g' ) | ||
REPO_DIR=${SCRIPT_DIR}/common_data/repo | ||
|
||
mkdir -p $REPO_DIR | ||
for repo in ${repolist[@]}; do | ||
DIR_NAME=$(echo $repo | rev | cut -d'/' -f1 | rev | sed 's/.git//') | ||
# echo $repo: dir_name is $DIR_NAME | ||
if [ ! -d ${REPO_DIR}/${DIR_NAME} ]; then | ||
git clone $repo ${REPO_DIR}/${DIR_NAME} | ||
fi | ||
cd ${REPO_DIR}/${DIR_NAME} && git pull | ||
done | ||
|