In [ ]:
# setting up a temp directory to checkout the git repository
export TUTORIAL_FOLDER="$HOME/tutorial-$(date +%s)"
echo $TUTORIAL_FOLDER
In [ ]:
# check out the git repository
git clone --depth 1 https://github.com/agaveplatform/SC17-container-tutorial.git $TUTORIAL_FOLDER
In [ ]:
# the latest notebooks should all be present
ls -l $TUTORIAL_FOLDER/content/notebooks | grep ".ipynb"
In [ ]:
# list current tutorials
cd $HOME
ls -l | grep ".ipynb"
In [ ]:
# check that the checkout completed
if [[ -d $TUTORIAL_FOLDER ]]; then
# backup current tutorials
mkdir -p "$HOME/work/tutorial-backup-$(date +%s)"
cp $HOME/*.ipynb $HOME/work/tutorial-backup-$(date +%s)
# copy the checkout to the server root
for file in $TUTORIAL_FOLDER/content/notebooks/*.ipynb
do
if [[ $(basename "$file") != "INSTALL.ipynb" ]]
then
cp -f "$file" .
fi
done
echo "Tutorial notebooks successfully installed. Please go to the http://$VM_HOSTNAME/notebooks/00%20-%20Introduction.ipynb to begin the tutorial."
else
echo "Tutorial checkout directory is missing. No tutorials will be updated"
fi
In [ ]: