Updated Makefile.validate to add entityID to .validate-file, updated update-and-valid...
[swamid-metadata.git] / scripts / update-and-validate.sh
1 #!/bin/sh
2 # Used on release-check.swamid.se
3
4 update()
5 {
6 #       echo "git pull"
7         git pull -q || return $?
8
9         /var/www/scripts/updateWebb.bash
10
11         make -f Makefile.validate -s
12
13         ls swamid-2.0/*.xml | sed 's@swamid-2.0/\(.*\).xml@.time/\1.validate@' > /tmp/$$.xml
14         ls .time/*.validate > /tmp/$$.time
15         comm -13 /tmp/$$.xml /tmp/$$.time | while read file; do
16                 docker exec release-check /var/www/scripts/removeEntity.bash /opt/swamid-metadata/$file
17         done
18         rm /tmp/$$.xml /tmp/$$.time
19
20         # remove some to get DB refreshed
21         if [ $(find .time/ -ctime +15 | wc -l) -ne 0 ]; then
22                 rm `find .time/ -ctime +15 | tail -10`
23         fi
24 }
25
26 cd /opt/swamid-metadata || exit 1
27 update