forked from freeipa/freeipa-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (50 loc) · 2.42 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
language: generic
sudo: required
services:
- docker
before_install:
- if test -n "$ca" ; then sudo apt-get install -y libnss3-tools ; fi
install: true
before_script:
- TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE:-$TRAVIS_COMMIT~..$TRAVIS_COMMIT} && echo "$TRAVIS_COMMIT_RANGE"
- export TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE/.../..} && echo "$TRAVIS_COMMIT_RANGE"
- export FILES_CHANGED=$( git diff --name-only $TRAVIS_COMMIT_RANGE | sort ) && echo "$FILES_CHANGED"
- export TRAVIS_DOCKERFILES=$( sed 's/^ *env. dockerfile=/Dockerfile./;s/ .*//;/^Dockerfile/p;d' .travis.yml | sort ) && echo "$TRAVIS_DOCKERFILES"
- export BUILD_DOCKERFILES=$( grep '^Dockerfile\.' <( echo "$FILES_CHANGED" ) ) ; echo "$BUILD_DOCKERFILES"
- export NONDOCKERFILES_CHANGED=$( grep -v '^Dockerfile\.' <( echo "$FILES_CHANGED" ) ) ; echo "$NONDOCKERFILES_CHANGED"
- if test -z "$FILES_CHANGED" || test -n "$NONDOCKERFILES_CHANGED" ; then export BUILD_DOCKERFILES=$TRAVIS_DOCKERFILES ; fi ; echo "$BUILD_DOCKERFILES"
- if grep -F "Dockerfile.$dockerfile" <( echo "$BUILD_DOCKERFILES" ) ; then export RUN_DOCKER_BUILD=1 ; fi
- perl -e 'print map "$_=$ENV{$_}".chr(10), sort keys %ENV'
stages:
- sanity
- build
matrix:
include:
- stage: sanity
script: if comm -23 <( echo "$FILES_CHANGED" ) <( echo "$TRAVIS_DOCKERFILES" ) | grep Dockerfile. ; then echo "Dockerfile modified but not tracked by Travis." >&2 ; exit 1 ; else echo "No unexpected Dockerfile changes, OK." ; fi
- stage: build
env: dockerfile=fedora-28 privileged=--privileged
- stage: build
env: dockerfile=fedora-28 ca=--external-ca privileged=--privileged
- stage: build
env: dockerfile=fedora-27 privileged=--privileged
- stage: build
env: dockerfile=centos-7
- stage: build
env: dockerfile=centos-7 ca=--external-ca
exclude:
- stage: build
env: dockerfile=fedora-rawhide
- stage: build
env: dockerfile=fedora-26 privileged=--privileged
- stage: build
env: dockerfile=fedora-25
- stage: build
env: dockerfile=fedora-24
- stage: build
env: dockerfile=fedora-23
- stage: build
env: dockerfile=rhel-7
script:
- if test -n "$RUN_DOCKER_BUILD" ; then sed 's/^# debug:\s*//' Dockerfile.$dockerfile > Dockerfile.$dockerfile-debug && docker build -t local/freeipa-server -f Dockerfile.$dockerfile-debug . ; fi
- if test -n "$RUN_DOCKER_BUILD" ; then tests/run-master-and-replica.sh local/freeipa-server ; fi