summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Wassberg <jocar@sunet.se>2025-02-26 20:24:05 +0100
committerJohan Wassberg <jocar@sunet.se>2025-02-26 20:24:05 +0100
commit8a68027c46ce7e202003b6d35d9ba8ad75d5a2aa (patch)
treeb7815b22767b39ebcc8b617482819a44d8878950
parent3ba02f87e101c23f3f9a563f37f7cd99bf6651bf (diff)
Debian awaremd-2025-02-26-v02
-rw-r--r--metadata/Makefile.validate-debian12
-rwxr-xr-xmetadata/scripts/update-and-validate.sh22
2 files changed, 27 insertions, 7 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..c2d320c4 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="Make.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