Add travis / ci build script

This commit is contained in:
Thomas Orozco 2015-03-15 16:12:45 +01:00
parent 296a29e3da
commit ec36a858db
3 changed files with 42 additions and 1 deletions

19
.travis.yml Normal file
View File

@ -0,0 +1,19 @@
language: c
compiler:
- gcc
- clang
script: ./ci/run_build.sh
sudo: false
deploy:
provider: releases
api_key:
secure: Yk90ANpSPv1iJy8QDXCPwfaSmEr/WIJ3bzhQ6X8JvZjfrwTosbh0HrUzQyeac3nyvNwj7YJRssolOFc21IBKPpCFTZqYxSkuLPU6ysG4HGHgN6YJhOMm4mG4KKJ6741q3DJendhZpalBhCEi+NcZK/PCSD97Vl4OqRjBUged0fs=
file:
- "./tini"
- "./tini-static"
on:
repo: krallin/tini
tags: true
condition: "$CC = gcc"

View File

@ -7,6 +7,6 @@ RUN apt-get update \
ADD . /tini
WORKDIR /tini
RUN cmake . && make clean && make
RUN ./ci/run_build.sh
ENTRYPOINT ["/tini/tini"]

22
ci/run_build.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Should be run from the root dir (!)
set -o errexit
set -o nounset
# Build
cmake .
make clean
make
# Smoke tests (actual tests need Docker to run; they don't run within the CI environment)
# Success
for tini in ./tini ./tini-static; do
echo "Testing $tini with: true"
$tini -vvvv true
echo "Testing $tini with: false"
if $tini -vvvv false; then
exit 1
fi
done