Created
May 8, 2020 08:06
-
-
Save jaimevalero/baafd0dcc78f51e8f3f8d974ce66979b to your computer and use it in GitHub Desktop.
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
#! /bin/bash | |
# script to update jupyter notebooks from command line | |
#### Environment | |
git config --global core.mergeoptions --no-edit | |
DATE=`Actualizado a fecha: date +'%Y-%m-%d %H:%M'` | |
export GIT_MERGE_AUTOEDIT=no | |
export GIT_PULL_AUTOEDIT=no | |
NOTEBOOK_LIST="Madrid_Pain_Graphs.ipynb Pain_Graphs.ipynb Momo.ipynb" | |
#### Get Data from upstream | |
cd /root/scripts/COVID-19/jupyter ; | |
source activate jupyter ; | |
MODIFIED_FILES=` git pull --no-edit original master 2>&1 | grep -e csv | wc -l ` | |
[ $MODIFIED_FILES -eq 0 ] && echo "Nothin to update, exit " && exit 0 | |
#### Update data | |
for NOTEBOOK in `echo $NOTEBOOK_LIST` | |
do | |
echo `date`:: $NOTEBOOK | |
jupyter nbconvert --to notebook --inplace --execute ${NOTEBOOK} | |
done | |
#### Push data | |
cd .. | |
git add jupyter | |
git commit -m "$DATE" | |
git push origin master | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment