From 9cd3ba5c725fa1e071a9472d5f289d9b7ba37ff7 Mon Sep 17 00:00:00 2001 From: Viet Nguyen <3805254+vnugent@users.noreply.github.com> Date: Sun, 14 Jan 2024 19:28:44 -0700 Subject: [PATCH] feat: update github push script (#381) --- .gitignore | 2 ++ export-crag-data.sh | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 17550172..e54f7667 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,8 @@ pids *.pid *.seed *.pid.lock +*.gz +*.geojson # Directory for instrumented libs generated by jscoverage/JSCover lib-cov diff --git a/export-crag-data.sh b/export-crag-data.sh index 53799988..e3bd1747 100755 --- a/export-crag-data.sh +++ b/export-crag-data.sh @@ -6,17 +6,24 @@ then exit 1 fi -echo "cloning openbeta-export repository" -git clone --depth 1 --branch production https://ob-bot-user:${GITHUB_ACCESS_TOKEN}@github.com/OpenBeta/openbeta-export || exit 1 -git config user.name "db-export-bot" -git config user.email "db-export-bot@noreply" -cd .. - echo "start exporting CRAG data..." yarn export-crags +ZIP_FILE=crags.geojson.gz + +tar -czf ${ZIP_FILE} crags.geojson crag-groups.geojson + echo "... finished export. Committing data..." +echo "cloning openbeta-export repository" +git clone --depth 1 --branch production https://ob-export-user:${GITHUB_ACCESS_TOKEN}@github.com/OpenBeta/openbeta-export.git || exit 1 + +cd openbeta-export +git config user.name "ob-export-user" +git config user.email "db-export-bot@noreply" + +mv ../${ZIP_FILE} . + git add -A git commit -am "export crag data" git push origin production