#!/bin/bash

if [ "$#" -ne 2 ]; then
  echo USAGE: `basename $0` deegree-version new-snapshot-version
  exit
fi

DEEGREE_VERSION=$1
SNAPSHOT_VERSION=$2

rm -f workspaces-${DEEGREE_VERSION} workspaces-${SNAPSHOT_VERSION}-SNAPSHOT

echo http://repo.deegree.org/content/groups/public/org/deegree/deegree-workspace-csw/${DEEGREE_VERSION}/deegree-workspace-csw-${DEEGREE_VERSION}.deegree-workspace deegree-workspace-csw >> workspaces-${DEEGREE_VERSION}
echo http://repo.deegree.org/content/groups/public/org/deegree/deegree-workspace-inspire/${DEEGREE_VERSION}/deegree-workspace-inspire-${DEEGREE_VERSION}.deegree-workspace deegree-workspace-inspire >> workspaces-${DEEGREE_VERSION}
echo http://repo.deegree.org/content/groups/public/org/deegree/deegree-workspace-utah/${DEEGREE_VERSION}/deegree-workspace-utah-${DEEGREE_VERSION}.deegree-workspace deegree-workspace-utah >> workspaces-${DEEGREE_VERSION}
echo http://repo.deegree.org/content/groups/public/org/deegree/deegree-workspace-wps/${DEEGREE_VERSION}/deegree-workspace-wps-${DEEGREE_VERSION}.deegree-workspace deegree-workspace-wps >> workspaces-${DEEGREE_VERSION}

echo "http://repo.deegree.org/service/local/artifact/maven/redirect?r=snapshots&g=org.deegree&a=deegree-workspace-csw&v=${SNAPSHOT_VERSION}-SNAPSHOT&p=deegree-workspace" deegree-workspace-csw >> workspaces-${SNAPSHOT_VERSION}-SNAPSHOT
echo "http://repo.deegree.org/service/local/artifact/maven/redirect?r=snapshots&g=org.deegree&a=deegree-workspace-inspire&v=${SNAPSHOT_VERSION}-SNAPSHOT&p=deegree-workspace" deegree-workspace-inspire >> workspaces-${SNAPSHOT_VERSION}-SNAPSHOT
echo "http://repo.deegree.org/service/local/artifact/maven/redirect?r=snapshots&g=org.deegree&a=deegree-workspace-utah&v=${SNAPSHOT_VERSION}-SNAPSHOT&p=deegree-workspace" deegree-workspace-utah >> workspaces-${SNAPSHOT_VERSION}-SNAPSHOT
echo "http://repo.deegree.org/service/local/artifact/maven/redirect?r=snapshots&g=org.deegree&a=deegree-workspace-wps&v=${SNAPSHOT_VERSION}-SNAPSHOT&p=deegree-workspace" deegree-workspace-wps >> workspaces-${SNAPSHOT_VERSION}-SNAPSHOT

