annotate deploy/provision.d/130-reposman.sh @ 1628:9c5f8e24dadc live tip

Quieten this cron script
author Chris Cannam
date Tue, 25 Aug 2020 11:38:49 +0100
parents 45b0571b684d
children
rev   line source
Chris@1590 1 #!/bin/bash
Chris@1590 2
Chris@1590 3 set -e
Chris@1590 4
Chris@1596 5 # Copy reposman (repository manager) scripts, including the generated
Chris@1596 6 # scripts with interpolated API key etc, to the directory they will be
Chris@1596 7 # run from.
Chris@1596 8
Chris@1596 9 # There are two sets of scripts here:
Chris@1596 10 #
Chris@1596 11 # 1. The reposman script that plods through all the projects that have
Chris@1596 12 # repositories defined, creates those repositories on disc, and
Chris@1596 13 # registers their locations with the projects. This happens often,
Chris@1596 14 # currently every minute.
Chris@1596 15 #
Chris@1596 16 # 2. The external repo management script that plods through all the
Chris@1596 17 # projects that have external repositories defined, clones or updates
Chris@1596 18 # those external repos to their local locations, and if necessary
Chris@1596 19 # registers them with the projects. This happens less often, currently
Chris@1596 20 # every hour.
Chris@1590 21
Chris@1590 22 cd /var/www/code
Chris@1590 23
Chris@1590 24 mkdir -p reposman
Chris@1590 25
Chris@1590 26 for file in \
Chris@1590 27 convert-external-repos.rb \
Chris@1590 28 reposman-soundsoftware.rb \
Chris@1590 29 run-hginit.sh \
Chris@1590 30 update-external-repo.sh ; do
Chris@1590 31 if [ ! -f reposman/"$file" ]; then
Chris@1590 32 cp extra/soundsoftware/"$file" reposman/
Chris@1590 33 fi
Chris@1590 34 done
Chris@1590 35
Chris@1590 36 for file in \
Chris@1590 37 run-external.sh \
Chris@1590 38 run-reposman.sh ; do
Chris@1590 39 if [ ! -f reposman/"$file" ]; then
Chris@1593 40 cp deploy/config/"$file".gen reposman/"$file"
Chris@1590 41 fi
Chris@1590 42 done
Chris@1590 43
Chris@1590 44 chown code.www-data reposman/*
Chris@1590 45 chmod +x reposman/*.sh
Chris@1590 46 chmod +x reposman/*.rb
Chris@1590 47
Chris@1590 48 touch /var/log/reposman.log
Chris@1590 49 touch /var/log/external-repos.log
Chris@1590 50 chown www-data.code /var/log/reposman.log
Chris@1590 51 chown www-data.code /var/log/external-repos.log
Chris@1590 52