Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/src/scripts/ci.sh
Views: 1324
#!/bin/bash12echo >> ci.log3echo "`date` -- 📈 Starting local CoCalc CI." >> ci.log4echo "`date` -- 🚧 Waiting for changes in upstream..." >> ci.log5echo "You must ALSO run 'pnpm nats-server-ci' and 'pnpm database' in two other terminals."6echo "Run 'tail -F ci.log' in a terminal to monitor CI status."78while true; do9# wait -- best to do this first, since at initial startup we can't immediately kick off build,10# since nats-server needs to build a little to startup, and they will conflict.11sleep 301213# Fetch the latest commits from upstream14git fetch1516# Check if local branch is behind the upstream branch17LOCAL=$(git rev-parse HEAD)18UPSTREAM=$(git rev-parse @{u})1920if [ "$LOCAL" != "$UPSTREAM" ]; then21echo "`date` -- 👌 Changes detected in upstream. Pulling changes and executing commands."22echo "`date` -- 🔨 Pulling..." >> ci.log2324git pull25git log -1 >> ci.log26if [ $? -eq 0 ]; then27echo "`date` -- ✔️ pulled" >> ci.log28echo "`date` -- 🏃 Running..." >> ci.log29./scripts/run-ci.sh30# cleanup -- temporary workaround -- should be part of test suite?31pkill -f `pwd`/packages/project/node_modules/@cocalc/project/bin/cocalc-project.js32if [ $? -eq 0 ]; then33echo "`date` -- 🎉 **SUCCESS**" >> ci.log34else35echo "`date` -- 🤖 **FAIL**" >> ci.log36fi37git log -1 >> ci.log38else39echo "🐛 failed to pull" >> ci.log40fi41echo "" >> ci.log42echo "`date` -- 🚧 Waiting for changes in upstream..." >> ci.log43fi44done4546