Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/dev/project/smc-project-sagews-dev.sh
Views: 687
#!/bin/bash12# script "smc-project-sagews-dev"3# use when ready to start new branch of development for SMC sagews4# requirements:5# git upstream remote repo is sagemathinc.smc, used read-only6# git origin remote repo is developer's fork of smc in developer's github7# local smc git repo at ~/smc8# be ready with new branch name, for example "isssue456utf"9#10# usage:11# new-issue [new-branch-name]12# script will ask for new-branch-name if not provided on command line1314trap "echo '**script error exit**';exit" ERR1516echo "NOTE: restart your SMC dev project before running this script"1718if [[ $# -ge 1 ]];then19BNAME=$120else21echo -n "name of new SMC branch (issueXXXdescword): "22read BNAME23fi24echo -n "ok to start smc dev on new branch $BNAME? (y|n) "25read ans26case $ans in27y|Y)28;;29*)30echo canceled31;;32esac3334cd ~/smc35# echo "checking that 'upstream' remote is main SMC github repo"36git config remote.upstream.url | grep -q sagemathinc/smc.git || {37echo "git remote upstream must point to sagemathinc/smc.git"38exit 139}4041# echo "checking that 'origin' remote is non-upstream SMC github repo"42git remote show origin|grep "Push.*smc.git"|grep -vq sagemathinc || {43echo "git remote origin must point to non-sagemathinc smc github repo"44exit 145}4647if [[ $EUID -eq 0 ]]; then48echo "This script must NOT be run as root"49exit 150fi515253echo "killing old sage worksheet processes"54pkill -f sage_server_command_line || test $? -eq 155rm -f ~/.smc/sage_server/sage_server.pid5657echo "updating git"58git checkout master59git pull upstream master60git checkout -b $BNAME6162echo "updating smc_sagews and tests"63cd ~/smc/src/smc_sagews64pip install --user --upgrade ./6566echo "running tests"67cd ~/smc/src/smc_sagews/smc_sagews/tests6869# baseline run of all tests before we start making changes70python -m pytest7172echo "setup for branch $BNAME done"737475