Skip to content

Commit

Permalink
trigger feedstock on merge
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf committed Aug 20, 2016
1 parent b3ab94e commit f005e29
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ addons:
- libmpc-dev
- binutils-dev
- g++-4.7

env:
global:
- secure: "f9AO8l3yvOHe9Fjkdyzt5CWU9763FJ6S7WFIb3upMceL+JrvQtdWkDXwxWTJzYPxUk0rqnnnUiHQHHyoSKaEKAoU6UQEjN+WiDH86E531LeRoMpCOTPN0XS8jpnpu+gwmMLCW2Hu58i3hgg0gnh6O8XYOHlkWMJS0BxrZcqawI0="

## All these variables are sent into the bin/test_travis.sh script. See this
## script to know how they are used. Most of them are just passed to cmake,
## so if they are not set, cmake will use a default value. For the rest, the
## bin/test_travis.sh script usually checks for either "yes" or "no" in an if
## statement, so if the variable is not set, the other if branch will get
## executed.

matrix:
## Out of tree builds (default):
# Debug build (with BFD)
- BUILD_TYPE="Debug" WITH_BFD="yes"
- BUILD_TYPE="Debug" WITH_BFD="yes" TRIGGER_FEEDSTOCK="yes"
# Debug build (with BFD and SYMENGINE_THREAD_SAFE)
- BUILD_TYPE="Debug" WITH_BFD="yes" WITH_SYMENGINE_THREAD_SAFE="yes"
# Debug build (with BFD) with ECM
Expand Down Expand Up @@ -142,5 +146,6 @@ install:
script:
- bin/travis_clang.sh
- bin/test_travis.sh
- bin/trigger_feedstock.sh
notifications:
email: false
35 changes: 35 additions & 0 deletions bin/trigger_feedstock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

if [[ "${TRIGGER_FEEDSTOCK}" != "yes" ]]; then
exit 0;
fi
if [[ "${TRAVIS_PULL_REQUEST}" != "false" ]]; then
echo "Testing a pull request, feedstock is not triggered.";
exit 0;
fi

cd $SOURCE_DIR;
export ver=`git describe --tags`
export commit=`git rev-parse HEAD`

git config --global user.name "Isuru Fernando"
git config --global user.email "isuruf@gmail.com"

set +x
git clone "https://${GH_TOKEN}@github.com/symengine/symengine-feedstock.git" feedstock -q
set -x

cd feedstock
if [[ "${TRAVIS_TAG}" != "" ]]; then
git checkout tagged
else
git checkout dev
fi

sed -ie '1,2d' recipe/meta.yaml
sed -i '1s/^/{% set version = "'${ver}'" %}\n/' recipe/meta.yaml
sed -i '1s/^/{% set commit = "'${commit}'" %}\n/' recipe/meta.yaml
git add recipe/meta.yaml
git commit -m "Update symengine version to ${ver}"
git push -q

0 comments on commit f005e29

Please sign in to comment.