aboutsummaryrefslogblamecommitdiffstats
path: root/scripts/bundle-otp
blob: 87b3b90a25ac96347f89734eedb6f147309176d8 (plain) (tree)
1
2
3
4
5
6
7
8



           



                                                                                    















                                               
                                                                        







                                         

      
#!/bin/bash

set -e

if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_REPO_SLUG" != "erlang/otp" ]; then
    exit 0
fi

OTP_META_FILE=$ERL_TOP/${TRAVIS_TAG}-bundle.txt
OTP_FILE=$ERL_TOP/${TRAVIS_TAG}-bundle.tar.gz

REPOSITORIES="otp,$TRAVIS_TAG corba,.*"

mkdir bundle

for repo in $REPOSITORIES; do
    OLD_IFS=$IFS
    IFS=','
    set -- $repo
    IFS=$OLD_IFS
    cd $ERL_TOP/bundle/
    git clone https://github.com/erlang/$1 $1
    cd $1
    echo $1 $2
    TAG=`git tag -l | grep -v "\-rc" | grep -P "$2" | sort -V | tail -1`
    git checkout $TAG
    SHA=`git rev-parse --verify HEAD`
    rm -rf .git
    echo "$1 $TAG $SHA" >> $OTP_META_FILE
done

cd $ERL_TOP/bundle/
tar czf $OTP_FILE *

exit 0