Updated Makefile.validate to add entityID to .validate-file, updated update-and-valid...
authorBjörn Mattsson <bjorn@sunet.se>
Thu, 11 Mar 2021 16:34:57 +0000 (17:34 +0100)
committerBjörn Mattsson <bjorn@sunet.se>
Thu, 11 Mar 2021 16:34:57 +0000 (17:34 +0100)
Makefile.validate
scripts/update-and-validate.sh

index 324b82d..f7c968b 100644 (file)
@@ -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 > $@
index 800ccc8..280064f 100755 (executable)
@@ -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