diff options
author | Björn Mattsson <bjorn@sunet.se> | 2021-03-11 17:34:57 +0100 |
---|---|---|
committer | Björn Mattsson <bjorn@sunet.se> | 2021-03-11 17:34:57 +0100 |
commit | 29d45d0b0b3bf81c7693d50bd77f3388f8de7f3c (patch) | |
tree | 235440ed01b40d6e9839e3511b5e38768584edb8 | |
parent | 22ec03f78674419a898c670600751d2915f25bc6 (diff) |
Updated Makefile.validate to add entityID to .validate-file, updated update-and-validate.sh to remove old entitys
-rw-r--r-- | Makefile.validate | 7 | ||||
-rwxr-xr-x | scripts/update-and-validate.sh | 32 |
2 files changed, 16 insertions, 23 deletions
diff --git a/Makefile.validate b/Makefile.validate index 324b82dd..f7c968b0 100644 --- a/Makefile.validate +++ b/Makefile.validate @@ -1,8 +1,7 @@ - VALIDATEXML=$(patsubst swamid-2.0/%.xml,.time/%.validate,$(wildcard swamid-2.0/*.xml)) -.time/%.validate: swamid-2.0/%.xml - @docker exec release-check /var/www/scripts/importXML.bash /opt/swamid-metadata/$< Prod - @touch $@ +all: validate validate: $(VALIDATEXML) +.time/%.validate: swamid-2.0/%.xml + @docker exec release-check /var/www/scripts/importXML.bash /opt/swamid-metadata/$< Prod > $@ diff --git a/scripts/update-and-validate.sh b/scripts/update-and-validate.sh index 800ccc8f..280064f9 100755 --- a/scripts/update-and-validate.sh +++ b/scripts/update-and-validate.sh @@ -8,25 +8,19 @@ update() /var/www/scripts/updateWebb.bash - make -f Makefile.validate - -# echo - - #echo "make aggregate" - #make aggregate || return $? - #echo - - #echo "make (2007) web site for backwards compat" - #env SWAMID_MK_CONFIG=swamid2007.mk make web || return $? - #echo - - #echo "make (2016)" - #env SWAMID_MK_CONFIG=swamid2016.mk make || return $? - #echo - - #echo "make (2016 - test)" - #env SWAMID_MK_CONFIG=swamid2016-test.mk make # Allow this to fail - #echo + make -f Makefile.validate -s + + ls swamid-2.0/*.xml | sed 's@swamid-2.0/\(.*\).xml@.time/\1.validate@' > /tmp/$$.xml + ls .time/*.validate > /tmp/$$.time + comm -13 /tmp/$$.xml /tmp/$$.time | while read file; do + docker exec release-check /var/www/scripts/removeEntity.bash /opt/swamid-metadata/$file + done + rm /tmp/$$.xml /tmp/$$.time + + # remove some to get DB refreshed + if [ $(find .time/ -ctime +15 | wc -l) -ne 0 ]; then + rm `find .time/ -ctime +15 | tail -10` + fi } cd /opt/swamid-metadata || exit 1 |