Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove code for JSON discofeed generation and publication
See ukf/ukf-meta#420 for details
Alex Stuart committed Jul 1, 2024
1 parent 8c0014e commit fff282e
Showing 3 changed files with 0 additions and 175 deletions.
45 changes: 0 additions & 45 deletions build.xml
@@ -335,9 +335,6 @@
<property name="mdaggr.stats" value="ukfederation-stats.html"/>
<property name="post-receive-githook" value="post-receive"/>
<property name="md.githook.path" value="/var/git/ukf-products/.git/hooks" />
<property name="mdaggr.discofeed.filtered" value="discofeed.json"/>
<property name="mdaggr.discofeed.all" value="discofeed-all.json"/>
<property name="md.discofeed.path" value="/tmp" />

<!--
*************************************************
@@ -672,7 +669,6 @@
git.data.allbranches.pushtoorigin,
scp.githook,
publish.mdqcache,
publish.json,
publish.md,
publish.otherfiles,
samlmd.aggregates.verify.remote,
@@ -1641,11 +1637,6 @@
-->
<CHANNEL.do channel="uk" verb="generate"/>

<!--
Generate discovery feeds.
-->
<CHANNEL.do channel="uk" verb="discofeeds"/>

<!--
Post-process mda-generated output files.
-->
@@ -2447,42 +2438,6 @@
</scp>
</target>

<target name="publish.json">
<!--
Push 2 JSON files to the MD dist servers
-->
<echo>Pushing UK Federation JSON files to MD dist.</echo>
<echo>-> MD-NE-01</echo>
<scp failonerror="true" remoteTodir="${md.user}@${md.dist.host-ne-01.name}:${md.discofeed.path}" keyfile="~/.ssh/id_rsa" knownhosts="~/.ssh/known_hosts">
<fileset dir="${output.dir}">
<include name="${mdaggr.discofeed.filtered}"/>
<include name="${mdaggr.discofeed.all}"/>
</fileset>
</scp>
<echo>-> MD-NE-02</echo>
<scp failonerror="true" remoteTodir="${md.user}@${md.dist.host-ne-02.name}:${md.discofeed.path}" keyfile="~/.ssh/id_rsa" knownhosts="~/.ssh/known_hosts">
<fileset dir="${output.dir}">
<include name="${mdaggr.discofeed.filtered}"/>
<include name="${mdaggr.discofeed.all}"/>
</fileset>
</scp>
<echo>-> MD-WE-01</echo>
<scp failonerror="true" remoteTodir="${md.user}@${md.dist.host-we-01.name}:${md.discofeed.path}" keyfile="~/.ssh/id_rsa" knownhosts="~/.ssh/known_hosts">
<fileset dir="${output.dir}">
<include name="${mdaggr.discofeed.filtered}"/>
<include name="${mdaggr.discofeed.all}"/>
</fileset>
</scp>
<echo>-> MD-WE-02</echo>
<scp failonerror="true" remoteTodir="${md.user}@${md.dist.host-we-02.name}:${md.discofeed.path}" keyfile="~/.ssh/id_rsa" knownhosts="~/.ssh/known_hosts">
<fileset dir="${output.dir}">
<include name="${mdaggr.discofeed.filtered}"/>
<include name="${mdaggr.discofeed.all}"/>
</fileset>
</scp>
</target>


<target name="publish.otherfiles">
<!--
Push other files for the UK Federation to the web server - but only when in prod env!
117 changes: 0 additions & 117 deletions mdx/uk/discofeeds.xml

This file was deleted.

13 changes: 0 additions & 13 deletions utilities/githooks/post-receive
@@ -11,11 +11,6 @@ apachemdqdir=/var/www/html/mdq.uou/entities
# Set the location of the temporary mdq cache dir
mdqcachedir=/tmp/mdqcache

# Set the location of JSON discofeed files
jsontempdir=/tmp
discofeed=discofeed.json
discofeedall=discofeed-all.json

# This Git repo has had the latest stuff pushed to it, but it hasn't checked it out yet. So let's do it.
git --work-tree=$gitdir --git-dir=$gitdir/.git checkout -f

@@ -27,12 +22,6 @@ do
done
echo "Done."

# The JSON files should have been SCPed to /tmp and be sitting there happily.
echo -n "Gzipping 2 JSON discofeed files..."
gzip -9 < "${jsontempdir}/$discofeed" > "${jsontempdir}/${discofeed}.gz"
gzip -9 < "${jsontempdir}/$discofeedall" > "${jsontempdir}/${discofeedall}.gz"
echo "Done."

# The MDQ cache should have been SCPed to /tmp and be sitting there happily.
# First, we should untar it.
echo -n "Untarring mdq cache... "
@@ -88,14 +77,12 @@ mtime=$(git --work-tree=$gitdir --git-dir=$gitdir/.git show $newrev --quiet --pr
echo -n "Setting the timestamp on each file to that of the commit... "
find $gitdir -regextype posix-extended -regex '.*\.(xml|gz)' -exec touch -d @$mtime {} \;
find $mdqcachedir -exec touch -d @$mtime {} \;
touch -d @$mtime ${jsontempdir}/$discofeed ${jsontempdir}/${discofeed}.gz ${jsontempdir}/$discofeedall ${jsontempdir}/${discofeedall}.gz
echo "Done."

# Put files into the correct directory
echo -n "Rsyncing files to the appropriate apache directory... "
rsync -at $gitdir/aggregates/*.{xml,gz} $apacheaggrdir
rsync -at --delete $mdqcachedir/ $apachemdqdir
rsync -at ${jsontempdir}/$discofeed ${jsontempdir}/${discofeed}.gz ${jsontempdir}/$discofeedall ${jsontempdir}/${discofeedall}.gz $apacheaggrdir
echo "Done."

# Remove the temporary files

0 comments on commit fff282e

Please sign in to comment.