Skip to content

Commit e78b7e0

Browse files
committed
Merge pull request #27 from alexcrichton/travisup
Build Linux binaries in an old CentOS 5 image
2 parents 684243c + 3163514 commit e78b7e0

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.travis.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ git:
1515
submodules: false
1616

1717
sudo: required
18+
services:
19+
- docker
1820
install:
1921
- git config --global user.email "[email protected]"
2022
- git config --global user.name "Diggory Blake (via Travis CI)"
@@ -23,15 +25,30 @@ install:
2325
- echo -e "\033[33;1mDownloading Rust\033[0m"
2426
- curl -sL http://static.rust-lang.org/dist/rust-nightly-$TARGET.tar.gz | tar --strip-components=1 -C ~/rust -xzf -
2527
- if [ "$TARGET" == "i686-unknown-linux-gnu" ]; then
28+
sudo dpkg --add-architecture i386;
2629
sudo apt-get update;
27-
sudo apt-get install libc6-dev:i386 libstdc++6:i386 zlib1g-dev:i386 libssl-dev:i386 pkg-config:i386 gcc-multilib;
30+
sudo apt-get install -y libc6-dev:i386 libstdc++6:i386 zlib1g-dev:i386 libssl-dev:i386 pkg-config:i386 gcc-multilib;
2831
fi
2932
- echo -e "\033[33;1mInstalling Rust\033[0m"
3033
- sudo ~/rust/install.sh
3134

3235
script:
33-
- export OPENSSL_STATIC=1
34-
- cargo build --release --verbose
36+
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
37+
docker run
38+
--entrypoint bash
39+
-u `id -u`:`id -g`
40+
-v /usr/local:/usr/local:ro
41+
-v `pwd`:/buildslave
42+
-v $HOME:/home/rustbuild
43+
-e HOME=/home/rustbuild
44+
-e LD_LIBRARY_PATH=/usr/local/lib
45+
-e OPENSSL_STATIC=1
46+
-e OPENSSL_LIB_DIR=/rustroot/cargo$BITS/lib
47+
-it alexcrichton/rust-slave-dist:2015-10-20b
48+
-c "cargo build --release --verbose";
49+
else
50+
cargo build --release --verbose;
51+
fi
3552
- find "target/release/" -maxdepth 1 -type f -exec sh -c 'sha256sum -b "{}" | cut -d\ -f1 > "{}.sha256"' \;
3653
- cargo test --verbose
3754
- tests/cli.sh

0 commit comments

Comments
 (0)