To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / deploy / provision.d / 130-reposman.sh @ 1598:073a75bf07fb
History | View | Annotate | Download (1.37 KB)
| 1 | 1590:c18460da6620 | Chris | #!/bin/bash |
|---|---|---|---|
| 2 | |||
| 3 | set -e |
||
| 4 | |||
| 5 | 1596:45b0571b684d | Chris | # Copy reposman (repository manager) scripts, including the generated |
| 6 | # scripts with interpolated API key etc, to the directory they will be |
||
| 7 | # run from. |
||
| 8 | |||
| 9 | # There are two sets of scripts here: |
||
| 10 | # |
||
| 11 | # 1. The reposman script that plods through all the projects that have |
||
| 12 | # repositories defined, creates those repositories on disc, and |
||
| 13 | # registers their locations with the projects. This happens often, |
||
| 14 | # currently every minute. |
||
| 15 | # |
||
| 16 | # 2. The external repo management script that plods through all the |
||
| 17 | # projects that have external repositories defined, clones or updates |
||
| 18 | # those external repos to their local locations, and if necessary |
||
| 19 | # registers them with the projects. This happens less often, currently |
||
| 20 | # every hour. |
||
| 21 | 1590:c18460da6620 | Chris | |
| 22 | cd /var/www/code |
||
| 23 | |||
| 24 | mkdir -p reposman |
||
| 25 | |||
| 26 | for file in \ |
||
| 27 | convert-external-repos.rb \ |
||
| 28 | reposman-soundsoftware.rb \ |
||
| 29 | run-hginit.sh \ |
||
| 30 | update-external-repo.sh ; do |
||
| 31 | if [ ! -f reposman/"$file" ]; then |
||
| 32 | cp extra/soundsoftware/"$file" reposman/ |
||
| 33 | fi |
||
| 34 | done |
||
| 35 | |||
| 36 | for file in \ |
||
| 37 | run-external.sh \ |
||
| 38 | run-reposman.sh ; do |
||
| 39 | if [ ! -f reposman/"$file" ]; then |
||
| 40 | 1593:83412a0a2389 | Chris | cp deploy/config/"$file".gen reposman/"$file" |
| 41 | 1590:c18460da6620 | Chris | fi |
| 42 | done |
||
| 43 | |||
| 44 | chown code.www-data reposman/* |
||
| 45 | chmod +x reposman/*.sh |
||
| 46 | chmod +x reposman/*.rb |
||
| 47 | |||
| 48 | touch /var/log/reposman.log |
||
| 49 | touch /var/log/external-repos.log |
||
| 50 | chown www-data.code /var/log/reposman.log |
||
| 51 | chown www-data.code /var/log/external-repos.log |