We need a second dashboard instance on a new machine that we can use as a test/staging platform. One likely side-effect of this is that we rework the vagrant setup so that it only polls for a new version when it's told to, rather than every N minutes - which honestly is probably a far better approach.
Alright. I've got the following script scheduled to run every 5 minutes (as update-beta.sh in my home directory on that instance. It appears to work as intended (have the latest versions of the dashboards).
cd /srv/dashboards # We need to check if the dashboards repo has been # updated (e.g. packages added to setup.sh). Only # then can we pull latest versions of dashboards. # Bring remote references up to date: git fetch origin # Check if there are remote changes that # need to be merged in: MERGES=$(git log HEAD..origin/master --oneline) if [ ! -z "$MERGES" ]; then CHANGES=$(git diff --shortstat) if [ ! -z "$CHANGES" ]; then # Clean out uncommitted references to dashboards: git submodule update --init # ^ avoids conflicts when pulling origin/master fi # Bring this repo up-to-date: git pull origin master # Do some minor doctoring: sed -i 's/\(Discovery Dashboards\)/\1 (Beta)/g' shiny-server/index.html # Re-provision the vagrant container: bash setup.sh fi # Pull latest version of each dashboard: git submodule foreach git pull origin master # Check if newer ver's of dashboards were downloaded... # ...but first let's ensure we don't get an error: if [ ! -e '/home/bearloga/submodules_status.txt' ]; then touch /home/bearloga/submodules_status.txt fi # ...okay, let's actually do the check now: OLDSTATUS=`cat /home/bearloga/submodules_status.txt` NEWSTATUS=$(git submodule status) if [ "$OLDSTATUS" != "$NEWSTATUS" ]; then # Restart because different (newer?) dashboards were dl'd: service shiny-server restart # Save hashes for next checkup: git submodule status > /home/bearloga/submodules_status.txt fi
Oliver and I discussed adding version info on the index page (http://discovery-beta.wmflabs.org/) and I think the best (read: easiest) way to do that would be something similar to where I add "(Beta)" to the header. We can include empty space for it in index.html and then use sed to inject git commit info into it for the dashboards. (This beats installing and configuring apache2/php5 on the instance, but that's just my $.02)