Skip to content

Commit

Permalink
Squashed '.travis/' changes from f50b3e4..2a03b5b
Browse files Browse the repository at this point in the history
2a03b5b [AppVeyor] Support for projects with fortran subdirectory
b819e8a dependencies: add missing -qq for apt-get
9b94f1a dependencies/ipopt: install dependencies with apt
7b21446 dependencies: add script to install Ipopt from source
211e163 Merge pull request #28 from gergondet/topic/Win32
8f7b969 [Win32] Add AppVeyor support
1e4f677 eigen: fix cflags
0fced9b eigen: fix for new pkg-config handling
4240350 eigen: update to 3.2.8
3b01c11 dependencies: update NAG to Mark 25
507fed5 Merge pull request #25 from olivier-stasse/master
971d761 Remove lcov from ppa installation and uses 1.12 release tarball
bf3d460 Merge pull request #23 from haudren/topic/fix-english
b889a27 Correct multiple typos and some syntax
70b93ea Pass CMAKE_ADDITIONAL_OPTIONS to git dependencies
ec12523 Merge pull request #21 from gergondet/topic/FixCatkinDependencies
72765fe Build ROS git dependencies in a separate workspace
ee85d3a Fix test on ROS_GIT_DEPENDENCIES
e54278a Reflect change to branch character delimiter in comment
f8c01cf Actually build ROS git dependencies
9756122 Factorize git dependency handling
d002d2a Stop relying on exit codes to avoid issues with set -e
bd9308e after_success: prevent failure
08bac20 [dependencies] Use -qq when installing ros packages
ca8a895 [dependencies] Automatically select the right ubuntu repository
edfdf75 Merge pull request #20 from gergondet/topic/Reforge
9979090 Only update the documentation if gh-pages branch exists
41133ab Re-write all scripts in a functions/main way
90c3ab9 Add support for ssh-formed git dependencies
66007c9 Add a script to install pybindgen-0.16
41116fc Fix eigen script for eigen 3.2.7
acf4e57 Adapt the scripts to non-travis environment
c000879 dependencies: update Eigen version to 3.2.7

git-subtree-dir: .travis
git-subtree-split: 2a03b5bf12ff198b7bc97d45c39a531db54c3a58
  • Loading branch information
gergondet committed Mar 9, 2016
1 parent 49562e8 commit ed38c7f
Show file tree
Hide file tree
Showing 19 changed files with 908 additions and 411 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ directory.
Features
--------

Unless Python or Ruby packages, streamlined C++ application deployment
Unlike Python or Ruby packages, streamlined C++ application deployment
is extremely challenging. Portability issues, compilation flags,
interoperability between packages is notable difficult to ensure.
interoperability between packages is notably difficult to ensure.

This submodule contains a set of shell scripts which can be used to
help Travis integrate with various services and tools useful for any
Expand Down Expand Up @@ -80,8 +80,8 @@ Development branch
### Before Install

In this case, the complex part is that we have to obtain the project
current dependencies both from APT and those which must be compiled
from source.
current dependencies both those available from APT and those which
must be compiled from source.

The following environment variables are defining the project
dependencies or parameters:
Expand Down Expand Up @@ -179,11 +179,11 @@ automatically by using the `Build-Depends` field of the

### Build

The `build` step first generate a fake entry into the
The `build` step first generates a fake entry into the
`debian/changelog` file indicating that this build is a snapshot.

`git-buildpackage` is then called to try building the package into the
pbuilder sandbox. If it success, `git-buidpackage` is called once more
pbuilder sandbox. If it succeeds, `git-buildpackage` is called once more
to generate a source package.

To sign the package so that it can be uploaded to a remote location
Expand Down Expand Up @@ -252,15 +252,15 @@ All the fields `@FOO@` must be replaced by their real value.
### Looking for successful builds

The `after_success` script is automatically adding a [git-notes][] to
all the successful build. These notes will not be displayed by default
though. To retrieve the notes and display them:
every successful build. These notes will not be displayed by default
though. To retrieve the notes and display them, type:

```sh
$ git fetch origin refs/notes/travis:refs/notes/travis
$ git log --notes=travis --show-notes
```

You should see an output like this one:
You should see an output similar to this one:

```
commit 8e78835cdbbf89f099f394dce9f6083dc802c994
Expand All @@ -276,7 +276,7 @@ Date: Mon Sep 16 13:37:19 2013 +0900
Dependencies commit id:
```

The note also contain the commit id of all the dependencies installed
The notes also contain the commit id of all the dependencies installed
from source to allow you to go back to the exact setup used by Travis
in this build.

Expand Down
6 changes: 3 additions & 3 deletions after_failure
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
. .travis/common.sh
. `dirname $0`/common.sh

# Set debug mode
set -x
Expand All @@ -13,8 +13,8 @@ if [ -d debian ]; then
echo "Debian build failed"
else
if [ ! x${DIST} = x ]; then
echo "skipping this build"
exit 0
echo "skipping this build"
exit 0
fi

# Dump as much log as we can
Expand Down
185 changes: 107 additions & 78 deletions after_success
Original file line number Diff line number Diff line change
@@ -1,99 +1,128 @@
#!/bin/bash
. .travis/common.sh
. `dirname $0`/common.sh

# Set debug mode
set -x
set -v

if [ -d debian ]; then
if `test x${DIST} = x`; then
echo "distribution is not set, skipping this build"
exit 0
fi
echo "Target distribution: ${DIST}"
##############################
# -- Helper functions -- #
##############################

export GNUPGHOME="$root_dir/.travis/.gnupg"
# If the build is a success, upload the source package to Launchpad.
if `test x${DIST} = xunstable`; then
echo "Debian Sid package. Skipping Launchpad upload..."
upload_to_ppa()
{
if `test x${DIST} = x`; then
echo "distribution is not set, skipping this build"
exit 0
fi
echo "Target distribution: ${DIST}"

export GNUPGHOME="`dirname $0`/.gnupg"
# If the build is a success, upload the source package to Launchpad.
if `test x${DIST} = xunstable`; then
echo "Debian Sid package. Skipping Launchpad upload..."
else
if `! test ${CI_PULL_REQUEST} = false`; then
echo "skipping launchpad upload in pull request"
else
if `! test ${TRAVIS_PULL_REQUEST} = false`; then
echo "skipping launchpad upload in pull request"
else
dput ppa:${PPA_URI} "$build_dir"/export/*_source.changes
fi
fi
elif [[ ${TRAVIS_OS_NAME} = linux ]]; then
if [ ! x${DIST} = x ]; then
echo "skipping this build"
exit 0
dput ppa:${PPA_URI} "$build_dir"/export/*_source.changes
fi
fi
}

generate_coverage_data()
{
# Upload coveralls data.
if [ x${CC} = xgcc ]; then
cd $build_dir
# If tests failed, coveralls data may not have been written
lcov --directory $build_dir --base-directory $root_dir --capture --output-file coverage.info || true
# Note: ignore rules are given by a string such as "*test* *foo*"
# lcov expects: '*test*' '*foo*'
# We use -f to prevent expansion of *
set -f
lcov --remove coverage.info '/usr*' "$install_dir*" ${LCOV_IGNORE_RULES} -o coverage.info || true
set +f
cd $root_dir
HEAD=`git rev-parse HEAD`
coveralls-lcov "$build_dir/coverage.info" || true
cd -
else
echo "skipping coveralls upload in non-gcc builds"
fi
}

# Upload coveralls data.
if [ x${CC} = xgcc ]; then
cd $build_dir
# If tests failed, coveralls data may not have been written
lcov --directory $build_dir --base-directory $root_dir --capture --output-file coverage.info || true
lcov --remove coverage.info '/usr*' "$install_dir*" -o coverage.info || true
if `! test x${LCOV_IGNORE_RULES} = x`; then
# Note: ignore rules are given by a string such as "*test* *foo*"
# lcov expects: '*test*' '*foo*'
# We use -f to prevent expansion of *
set -f
lcov --remove coverage.info ${LCOV_IGNORE_RULES} -o coverage.info || true
set +f
fi
cd $root_dir
coveralls-lcov "$build_dir/coverage.info" || true
cd -
else
echo "skipping coveralls upload in non-gcc builds"
set_push_uri()
{
# If GH_PUSH_URI has already been provided
if `test x${GH_PUSH_URI} != x`; then
export GH_PUSH_URI=${GH_PUSH_URI}
# If encrypted username/tokens were not provided
elif `test x${GH_TOKEN} = x -o x${GH_USERNAME} = x`; then
echo "missing username and/or token for GitHub push"
export GH_PUSH_URI=""
else
export GH_PUSH_URI=https://${GH_USERNAME}:${GH_TOKEN}@github.com/${GH_REPO}
fi
if `test x${GH_PUSH_URI} != x`; then
cd $root_dir
git remote set-url origin "${GH_PUSH_URI}"
fi
return 0
}

update_documentation()
{
# If we are on the master branch:
if [[ ${CI_BRANCH} = master ]]; then
# Update the documentation.
# Retrieve last commit of the gh-pages branch.
if `git fetch --depth=1 origin gh-pages:gh-pages`; then
cd $build_dir/doc && $root_dir/cmake/github/update-doxygen-doc.sh \
-r $root_dir -b $build_dir
fi
fi
}

# If it's not a fork or a pull request
if `test x${TRAVIS_REPO_SLUG} = x${GH_REPO} -a ${TRAVIS_PULL_REQUEST} = false`; then
# If encrypted username/tokens were not provided
if `test x${GH_TOKEN} = x -o x${GH_USERNAME} = x`; then
echo "missing username and/or token for GitHub push"
else
cd $root_dir
# Set the push capable URL.
#
# Add the possibility to use three variables instead of one to
# work around string maximum length limitation issue.
if `test x${GH_PUSH_URI} = x`; then
export GH_PUSH_URI=https://${GH_USERNAME}:${GH_TOKEN}@github.com/${GH_REPO}
fi
git remote set-url origin "${GH_PUSH_URI}"
push_note()
{
# Push git note indicating success
cd $root_dir
HEAD=`git rev-parse HEAD`
notes_msg="Successful build.\n----\n\nDependencies commit id:"
for package in ${GIT_DEPENDENCIES}; do
git_dependency_parsing $package
cd $build_dir/$git_dep
commitid=`git rev-parse HEAD || echo unknown`
notes_msg="${notes_msg} $git_dep : $commitid\n"
done
cd $root_dir
git fetch --quiet --force origin refs/notes/jrl-ci:refs/notes/jrl-ci || true
git notes --ref=jrl-ci add -f -m "$(echo "${notes_msg}")" $HEAD
git push origin refs/notes/jrl-ci --force
}

# If we are on the master branch:
if [[ ${TRAVIS_BRANCH} = master ]]; then
# Update the documentation.
# Retrieve last commit of the gh-pages branch.
git fetch --depth=1 origin gh-pages:gh-pages
#########################
# -- Main script -- #
#########################

cd $build_dir/doc && $root_dir/cmake/github/update-doxygen-doc.sh \
-r $root_dir -b $build_dir
fi
if [ -d debian ]; then
upload_to_ppa
elif [[ ${CI_OS_NAME} = linux ]]; then
if [ ! x${DIST} = x ]; then
echo "skipping this build"
exit 0
fi

# Push git note indicating success
cd $root_dir
notes_msg="Successful build.\n----\n\nDependencies commit id:"
for package in ${GIT_DEPENDENCIES}; do
cd $build_dir/$package
commitid=`git rev-parse HEAD || echo unknown`
notes_msg="${notes_msg} $package : $commitid\n"
done
cd $root_dir
git fetch --quiet --force origin refs/notes/travis:refs/notes/travis || true
git notes --ref=travis add -f -m "$(echo "${notes_msg}")" $HEAD
git push origin refs/notes/travis --force
fi
generate_coverage_data
# If it's not a fork or a pull request
if `test x${CI_REPO_SLUG} = x${GH_REPO} -a ${CI_PULL_REQUEST} = false`; then
set_push_uri
if `test x${GH_PUSH_URI} != x`; then
update_documentation
push_note
fi
else
echo "skipping doc/build result upload on forks and for pull requests"
echo "skipping doc/build result upload on forks and for pull requests"
fi
fi

Expand Down
51 changes: 51 additions & 0 deletions appveyor.yml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: 1.0.{build}
os: Visual Studio 2015
clone_folder: C:/devel-src/@PROJECT_NAME@
# The following lines output the connection parameters for the RDE in AppVeyor
# at the start of the build. Be advised that this may allow people to tinker
# with your build
# init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
environment:
CI_OS_NAME: win32
CI_TOOL: appveyor
# Dependencies should be a list of dependencies separated by spaces
CHOCO_DEPENDENCIES: @CHOCO_DEPENDENCIES@
GIT_DEPENDENCIES: @GIT_DEPENDENCIES@
# Should be the same as clone_folder
PROJECT_SOURCE_DIR: C:/devel-src/@PROJECT_NAME@
# Do not tinker with the variables below unless you know what you are doing
SOURCE_FOLDER: C:/devel-src
CMAKE_INSTALL_PREFIX: C:/devel
PATH: C:/devel/bin;C:\Libraries\boost_1_59_0\lib64-msvc-14.0;C:\msys64\mingw64\bin;%PATH%
PKG_CONFIG_PATH: C:/devel/lib/pkgconfig
BOOST_ROOT: C:\Libraries\boost_1_59_0
BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib64-msvc-14.0
MINGW_GFORTRAN: C:\msys64\mingw64\bin\gfortran.exe
# N.B: empty lines here and in test_script are VERY important
build_script:
- ps: >-
Set-PSDebug -Trace 1

. ./.jrl-ci/functions.ps1

setup_build

./.jrl-ci/dependencies/eigen-3.2.ps1

install_dependencies

build_project
test_script:
- cmd: >-
cd %PROJECT_SOURCE_DIR%

ctest
# Similar to the init script, this gives access to a remote desktop session
# after the build finished, the session is locked until you login to delete a
# file on the dekstop, useful for debugging
# on_finish:
# - ps: >-
# reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
#-
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
Loading

0 comments on commit ed38c7f

Please sign in to comment.