This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
spip-saml/inc/simplesamlphp/bin/build-release.sh

46 lines
967 B
Bash
Raw Normal View History

2013-06-07 12:19:28 +02:00
#!/usr/bin/env bash
set -e
TAG=$1
if ! shift; then
echo "$0: Missing required tag parameter." >&2
exit 1
fi
if [ -z "$TAG" ]; then
echo "$0: Empty tag parameter." >&2
exit 1
fi
cd /tmp
if [ -a "$TAG" ]; then
echo "$0: Destination already exists: $TAG" >&2
exit 1
fi
umask 0022
2015-03-27 18:15:46 +01:00
REPOPATH="http://simplesamlphp.googlecode.com/svn/tags/$TAG/"
2013-06-07 12:19:28 +02:00
svn export "$REPOPATH"
2015-03-27 18:15:46 +01:00
# Use composer only on newer versions that have a composer.json
if [ -f "$TAG/composer.json" ]; then
if [ ! -x composer.phar ]; then
curl -sS https://getcomposer.org/installer | php
fi
# Install dependencies (without vcs history or dev tools)
php composer.phar install --no-dev --prefer-dist -o -d "$TAG"
fi
2013-06-07 12:19:28 +02:00
mkdir -p "$TAG/config" "$TAG/metadata"
cp -rv "$TAG/config-templates/"* "$TAG/config/"
cp -rv "$TAG/metadata-templates/"* "$TAG/metadata/"
tar --owner 0 --group 0 -cvzf "$TAG.tar.gz" "$TAG"
rm -rf "$TAG"
echo "Created: /tmp/$TAG.tar.gz"