7 # Read out ACCOUNT and REPO from the slug
8 # Cribbed from http://unix.stackexchange.com/a/53323/118117
9 ACCOUNT
=${TRAVIS_REPO_SLUG%%"/"*}
10 REPO
=${TRAVIS_REPO_SLUG#*"/"}
12 # TAG will be used to uniquely identify a matrix entry; we
13 # need to push each matrix entry to a separate branch.
14 TAG
="$TRAVIS_OS_NAME-$GHCVER$TAGSUFFIX"
16 # This is the commit for which we want a GitHub status update
17 # ping to go to. Note that it is NOT TRAVIS_COMMIT unconditionally,
18 # since if we have a pull request, this commit will be a merge
19 # commit which no one from GitHub will be able to see.
20 COMMIT
=${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT}
22 # This is just to help you correlate the build to what it's for
23 if [ "x$TRAVIS_PULL_REQUEST" != "xfalse" ]; then
24 ORIGIN
="${TRAVIS_REPO_SLUG}/pull/$TRAVIS_PULL_REQUEST"
25 URL
="pull/${TRAVIS_PULL_REQUEST}"
27 ORIGIN
="${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}"
28 URL
="commits/${TRAVIS_BRANCH}"
31 # Git will complain if these fields don't work when committing,
33 git config
--global user.name
"$(git --no-pager show -s --format='%an' $COMMIT)"
34 git config
--global user.email
"$(git --no-pager show -s --format='%ae' $COMMIT)"
35 git config
--global push.default simple
39 # Setup SSH key we will use to push to binaries repository.
40 # umask to get the permissions to be 600 (not 400, because the deploy
41 # script in .travis.yml is going to clobber this private key)
42 (umask 177 && tr A-Za-z N-ZA-Mn-za-m
< id_rsa.rot13
> $HOME/.ssh
/id_rsa
)
45 ssh-keyscan github.com
>> $HOME/.ssh
/known_hosts
49 # Setup binaries repository for pushing
52 git remote add origin git@github.com
:haskell-pushbot
/cabal-binaries.git
54 # Make some final modifications to .travis.yml based so
55 # that downstream builds with the correct configuration
56 echo "env: GHCVER=$GHCVER UPSTREAM_BUILD_DIR=$TRAVIS_BUILD_DIR CABAL_LIB_ONLY=$CABAL_LIB_ONLY TEST_OTHER_VERSIONS=$TEST_OTHER_VERSIONS" >> .travis.yml
57 echo "os: $TRAVIS_OS_NAME" >> .travis.yml
58 if [ "x$GHCVER" = "x7.8.4" ] && [ "x$TRAVIS_OS_NAME" = "xosx" ]; then
59 echo "osx_image: xcode6.4" >> .travis.yml
62 # Make directory layout
65 cp -R $TRAVIS_BUILD_DIR/Cabal
/tests Cabal
66 cp -R $TRAVIS_BUILD_DIR/cabal-install
/tests cabal-install
67 # Copy in credentials so we can delete branch when done
68 cp $TRAVIS_BUILD_DIR/travis
/id_rsa.rot13 .
69 # Install all of the necessary files for testing
70 cp $TRAVIS_BUILD_DIR/travis-install.sh .
71 cp $TRAVIS_BUILD_DIR/travis-common.sh .
72 # The binaries to test (statically linked, of course!)
73 cp ${CABAL_BDIR}/c
/unit-tests
/build
/unit-tests
/unit-tests Cabal
74 cp ${CABAL_BDIR}/c
/check-tests
/build
/check-tests
/check-tests Cabal
75 cp ${CABAL_BDIR}/c
/parser-tests
/build
/parser-tests
/parser-tests Cabal
76 cp ${CABAL_BDIR}/c
/hackage-tests
/build
/hackage-tests
/hackage-tests Cabal
77 if [ "x$CABAL_LIB_ONLY" != "xYES" ]; then
78 cp ${CABAL_INSTALL_BDIR}/build
/cabal
/cabal cabal-install
83 # The JSON in the commit message is used by the webhook listening
84 # on the downstream repo to figure out who to communicate the
85 # status update back to
86 git commit
-m '{"origin":"'$ORIGIN'",
89 "account":"'$ACCOUNT'",
91 "commit": "'$COMMIT'",
94 travis_retry git push
-f origin
"HEAD:$TAG/$COMMIT"