From ec36a858dbcf782d09c2e7146b8bf211f959bd9e Mon Sep 17 00:00:00 2001 From: Thomas Orozco Date: Sun, 15 Mar 2015 16:12:45 +0100 Subject: [PATCH] Add travis / ci build script --- .travis.yml | 19 +++++++++++++++++++ Dockerfile | 2 +- ci/run_build.sh | 22 ++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100755 ci/run_build.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..02135ed --- /dev/null +++ b/.travis.yml @@ -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" diff --git a/Dockerfile b/Dockerfile index 8fd286b..c533af4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/ci/run_build.sh b/ci/run_build.sh new file mode 100755 index 0000000..0445cb1 --- /dev/null +++ b/ci/run_build.sh @@ -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