aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2019-02-02 14:52:39 +0100
committerKevin F. Haggerty <haggertk@lineageos.org>2019-06-13 21:13:08 -0600
commitd215ccb05220d645e52e9cb0bc6ce179d3af6e50 (patch)
treee45b8316f4602d53da588106de7c8b2a6ed90ff0
parent6bdb683551f3e4b0bd0757c5e084f59f92c1aa8b (diff)
downloadcontributors-cloud-generator-d215ccb05220d645e52e9cb0bc6ce179d3af6e50.tar.gz
contributors-cloud-generator-d215ccb05220d645e52e9cb0bc6ce179d3af6e50.tar.bz2
contributors-cloud-generator-d215ccb05220d645e52e9cb0bc6ce179d3af6e50.zip
Add support for local mirrors
Change-Id: If1d98b81bc10d4ab4837a976603498f88e124a08
-rw-r--r--README.md14
-rwxr-xr-xrepo_fetch.sh10
2 files changed, 19 insertions, 5 deletions
diff --git a/README.md b/README.md
index 0e0e4d3..cc28a5c 100644
--- a/README.md
+++ b/README.md
@@ -8,13 +8,21 @@ To build the jar, run the following:
If you make changes in `source/`, this will need to be re-built
+If you have a local mirror of all the LineageOS code repositories,
+then you can reduce the processing time and additional storage space
+required to build the cloud by telling the tool where your repository
+exists; otherwise, it will download hundreds of GB of data. Reference
+your local mirror by doing the following:
+
+ export MIRROR_ROOT=/path/to/mirror
+
To generate the code, open a linux console and type:
./generate_wordcloud.sh
-This will fetch all LineageOS repos (around 110Gb), parse the commits
-logs, mix the data and generate a cloud.zip in the output
-folder. This will take look long time the first time.
+This will parse the commit logs in all the LineageOS repos,
+downloading as required, mix the data and generate a cloud.zip in the
+output folder. This will take look long time the first time.
The file resources/well-known-accounts.txt allows merging multiple
Gerrit accounts into a single cloud entry. The format of this file
diff --git a/repo_fetch.sh b/repo_fetch.sh
index a390cf6..3038359 100755
--- a/repo_fetch.sh
+++ b/repo_fetch.sh
@@ -8,14 +8,20 @@ OLD_PWD=`pwd`
REPO_DIR=$OLD_PWD/db/repos/$1
STATS_DIR=$OLD_PWD/db/stats/$1
-echo "REPO: $REPO_DIR"
-if [ ! -d "$REPO_DIR" ]; then
+MIRROR_DIR=$MIRROR_ROOT/$1.git
+
+if [ -d "$MIRROR_DIR" ]; then
+ echo "MIRROR: $MIRROR_DIR"
+ cd "$MIRROR_DIR"
+elif [ ! -d "$REPO_DIR" ]; then
+ echo "REPO: $REPO_DIR"
mkdir -p $REPO_DIR
cd $REPO_DIR
$GIT_CMD init
$GIT_CMD remote add origin https://$GIT_USER:$GIT_PWD@github.com/$1.git
$GIT_CMD fetch
else
+ echo "REPO: $REPO_DIR"
cd $REPO_DIR
$GIT_CMD fetch
fi