diff options
author | Björn Mattsson <bjorn@sunet.se> | 2025-02-27 14:59:52 +0100 |
---|---|---|
committer | Björn Mattsson <bjorn@sunet.se> | 2025-02-27 14:59:52 +0100 |
commit | 94bb0684f57a09b6ee9c2f97c1b50c36ca8e5235 (patch) | |
tree | 2be7a5598fb6e1197409b31e99361838318f50c4 | |
parent | 88d1642cde6300b8b75ebc5484c1005e27174e13 (diff) | |
parent | 3426cc592747c93243432965dd2628a197e5a205 (diff) |
Merge branch 'master' of git.swamid.se:swamid-metadataHEADmd-2025-02-27-v01master
-rw-r--r-- | metadata/Makefile.validate-debian | 12 | ||||
-rwxr-xr-x | metadata/scripts/update-and-validate.sh | 22 | ||||
-rwxr-xr-x | metadata/scripts/weekly-routines-metadata.sh | 11 |
3 files changed, 35 insertions, 10 deletions
diff --git a/metadata/Makefile.validate-debian b/metadata/Makefile.validate-debian new file mode 100644 index 00000000..d0782cf4 --- /dev/null +++ b/metadata/Makefile.validate-debian @@ -0,0 +1,12 @@ +EDUGAIN=$(patsubst swamid-edugain/%.xml,.time/%.validate,$(wildcard swamid-edugain/*.xml)) +SWAMDI20=$(patsubst swamid-2.0/%.xml,.time/%.validate,$(wildcard swamid-2.0/*.xml)) + +all: validate + +validate: $(EDUGAIN) $(SWAMDI20) + +.time/%.validate: swamid-edugain/%.xml + @docker exec metadata-sp-metadata-sp-1 /var/www/scripts/importXML.bash /opt/metadata/$< Prod | grep -v "Import -> Added to db" > $@ + +.time/%.validate: swamid-2.0/%.xml + @docker exec metadata-sp-metadata-sp-1 /var/www/scripts/importXML.bash /opt/metadata/$< Prod | grep -v "Import -> Added to db" > $@ diff --git a/metadata/scripts/update-and-validate.sh b/metadata/scripts/update-and-validate.sh index 86d5da33..9e3aa169 100755 --- a/metadata/scripts/update-and-validate.sh +++ b/metadata/scripts/update-and-validate.sh @@ -9,29 +9,37 @@ update() ls swamid-edugain/*.xml swamid-2.0/*.xml | sed 's@swamid-.*/\(.*\).xml@.time/\1.validate@' | sort > /tmp/$$.xml ls .time/*.validate > /tmp/$$.time comm -13 /tmp/$$.xml /tmp/$$.time | while read file; do - docker exec swamid-metadata-sp /var/www/scripts/removeEntity.bash /opt/metadata/$file + docker exec ${CONTAINER} /var/www/scripts/removeEntity.bash /opt/metadata/$file done rm /tmp/$$.xml /tmp/$$.time # Update/Import "new" xml-files - make -f Makefile.validate -s + make -f ${MAKE} -s # Revalidate entities in prod not validated for the last nr of days - docker exec swamid-metadata-sp php /var/www/scripts/revalidate.php 14 10 + docker exec ${CONTAINER} php /var/www/scripts/revalidate.php 14 10 # check URL:s - docker exec swamid-metadata-sp php /var/www/scripts/checkURLs.php + docker exec ${CONTAINER} php /var/www/scripts/checkURLs.php # update TestResults from release-check -> DB - docker exec swamid-metadata-sp php /var/www/scripts/updateTestResults.php + docker exec ${CONTAINER} php /var/www/scripts/updateTestResults.php # Cleanup Pending-queue - docker exec swamid-metadata-sp php /var/www/scripts/cleanupPending.php + docker exec ${CONTAINER} php /var/www/scripts/cleanupPending.php # to be able to show non-swamid entities on web-page wget -qO swamid-2.0.xml https://mds.swamid.se/md/swamid-2.0.xml - docker exec swamid-metadata-sp php /var/www/scripts/updateExternalEntities.php + docker exec ${CONTAINER} php /var/www/scripts/updateExternalEntities.php } +CONTAINER="swamid-metadata-sp" +MAKE="Makefile.validate" + +if [ "$(lsb_release -i -s)" = "Debian" ]; then + CONTAINER="metadata-sp-metadata-sp-1" + MAKE="Makefile.validate-debian" +fi + cd /opt/metadata || exit 1 update diff --git a/metadata/scripts/weekly-routines-metadata.sh b/metadata/scripts/weekly-routines-metadata.sh index 66c99828..8a09de94 100755 --- a/metadata/scripts/weekly-routines-metadata.sh +++ b/metadata/scripts/weekly-routines-metadata.sh @@ -1,5 +1,10 @@ #!/bin/bash # Used on metadata.swamid.se and metadata.lab.swamid.se +# +CONTAINER="swamid-metadata-sp" +if [ "$(lsb_release -i -s)" = "Debian" ]; then + CONTAINER="metadata-sp-metadata-sp-1" +fi # Store statistics #docker exec swamid-metadata-sp php /var/www/scripts/saveWeekStats.php @@ -8,15 +13,15 @@ if [ `/usr/bin/hostname -f` == 'metadata.swamid.se' ] ;then # Send out reminders only from metadata.swamid.se echo echo "Sending reminders" - docker exec swamid-metadata-sp php /var/www/scripts/sendMailReminders.php + docker exec ${CONTAINER} php /var/www/scripts/sendMailReminders.php fi # Clean up database echo echo "Remove old entities" -docker exec swamid-metadata-sp php /var/www/scripts/cleanupDatabase.php +docker exec ${CONTAINER} php /var/www/scripts/cleanupDatabase.php #Remove old URLs echo echo "Checking URL:s" -docker exec swamid-metadata-sp php /var/www/scripts/checkOldURLs.php +docker exec ${CONTAINER} php /var/www/scripts/checkOldURLs.php |