Skip to content
Snippets Groups Projects
Commit e393b555 authored by Jaime Perez's avatar Jaime Perez
Browse files

Some fixes to the build script to adapt to the new versioning standard.

parent 870709bb
No related branches found
No related tags found
No related merge requests found
...@@ -2,21 +2,25 @@ ...@@ -2,21 +2,25 @@
set -e set -e
TAG=$1 VERSION=$1
if ! shift; then if ! shift; then
echo "$0: Missing required tag parameter." >&2 echo "$0: Missing required version parameter." >&2
exit 1 exit 1
fi fi
if [ -z "$TAG" ]; then if [ -z "$VERSION" ]; then
echo "$0: Empty tag parameter." >&2 echo "$0: Empty version parameter." >&2
exit 1 exit 1
fi fi
TAG="v$VERSION"
TARGET="simplesamlphp-$VERSION"
cd /tmp cd /tmp
if [ -a "$TAG" ]; then if [ -a "$TARGET" ]; then
echo "$0: Destination already exists: $TAG" >&2 echo "$0: Destination already exists: $TARGET" >&2
exit 1 exit 1
fi fi
...@@ -24,27 +28,28 @@ umask 0022 ...@@ -24,27 +28,28 @@ umask 0022
REPOPATH="https://github.com/simplesamlphp/simplesamlphp.git" REPOPATH="https://github.com/simplesamlphp/simplesamlphp.git"
git clone $REPOPATH $TAG git clone $REPOPATH $TARGET
cd $TAG cd $TARGET
git checkout $TAG git checkout $TAG
cd .. cd ..
# Use composer only on newer versions that have a composer.json # Use composer only on newer versions that have a composer.json
if [ -f "$TAG/composer.json" ]; then if [ -f "$TARGET/composer.json" ]; then
if [ ! -x "TAG/composer.phar" ]; then if [ ! -x "$TARGET/composer.phar" ]; then
curl -sS https://getcomposer.org/installer | php -- --install-dir=$TAG curl -sS https://getcomposer.org/installer | php -- --install-dir=$TARGET
fi fi
# Install dependencies (without vcs history or dev tools) # Install dependencies (without vcs history or dev tools)
php "$TAG/composer.phar" install --no-dev --prefer-dist -o -d "$TAG" php "$TARGET/composer.phar" install --no-dev --prefer-dist -o -d "$TARGET"
fi fi
mkdir -p "$TAG/config" "$TAG/metadata" mkdir -p "$TARGET/config" "$TARGET/metadata"
cp -rv "$TAG/config-templates/"* "$TAG/config/" cp -rv "$TARGET/config-templates/"* "$TARGET/config/"
cp -rv "$TAG/metadata-templates/"* "$TAG/metadata/" cp -rv "$TARGET/metadata-templates/"* "$TARGET/metadata/"
rm -rf "$TAG/.git" rm -rf "$TARGET/.git"
rm "$TAG/composer.phar" rm "$TARGET/composer.phar"
tar --owner 0 --group 0 -cvzf "$TAG.tar.gz" "$TAG" tar --owner 0 --group 0 -cvzf "$TARGET.tar.gz" "$TARGET"
rm -rf "$TAG" rm -rf "$TARGET"
echo "Created: /tmp/$TARGET.tar.gz"
echo "Created: /tmp/$TAG.tar.gz"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment