Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added a script to download a json file containing the global entity l…
…ist from the mdq-beta server
ij committed May 14, 2018
1 parent ed54369 commit 6ebdb01
Showing 2 changed files with 42 additions and 6 deletions.
20 changes: 14 additions & 6 deletions README.md
@@ -1,9 +1,17 @@
# inc-md-js
## InCommon Metadata-Driven Web Pages

This produces the web pages found at:
<p>https://incommon.org/federation/info/all-entities.html</p>
and
<p>https://incommon.org/federation/info/all-entities-mdq-beta.html</p>
It depends on a JSON feed of metadata produced by:
<p>https://github.internet2.edu/InCommon/inc-md-json</p>
At deploy-time, the symlink from 'metadata' needs to point to /usr/local/pkg/metadriven/metadata on the web server, which is where the JSON metadata files are maintained
https://incommon.org/federation/info/all-entities.html and
https://incommon.org/federation/info/all-entities-mdq-beta.html.


The all-entities.html page depends on a JSON feed of metadata produced by:
[https://github.internet2.edu/InCommon/inc-md-json](https://github.internet2.edu/InCommon/inc-md-json).
At deploy-time, the symlink from 'metadata' needs to point to
/usr/local/pkg/metadriven/metadata on the web server, which is where the JSON
metadata files are maintained.


The all-entities-mdq-beta.html depends on a JSON feed downloaded from
[http://mdq-beta.incommon.org/global/x-entity-list](http://mdq-beta.incommon.org/global/x-entity-list).
28 changes: 28 additions & 0 deletions bin/get_mdq_entity_list.sh
@@ -0,0 +1,28 @@
#!/bin/bash

NOW=`date -u "+%Y%m%dT%H%M%S"`
DIR="/home/htdocs/www.incommonfederation.org/federation/metadata_global"
TARGET="${DIR}/entity-list-mdq-beta-${NOW}.json"
SOURCE="${DIR}/entity-list-mdq-beta.json"
URL="http://mdq-beta.incommon.org/global/x-entity-list"

cleanup() {
count=`ls ${DIR}/entity-list-mdq-beta-*T*.json | wc -l`

if [[ $count -ge 5 ]]
then
for f in `ls ${DIR}/entity-list-mdq-beta-*T*.json |head -n $(($count - 3))`
do
rm $f
done
fi
}

cleanup

/usr/bin/curl -s ${URL} -o ${TARGET}
if [[ $? == 0 ]]
then
ln -fs ${TARGET} ${SOURCE}
fi

0 comments on commit 6ebdb01

Please sign in to comment.