-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
49 lines (41 loc) · 1.36 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
language: minimal # Use minimalistic image just with docker and basic tools.
services:
- docker
addons:
apt:
packages:
- shellcheck # For checking bash syntax.
- unzip # For unpacking Bats master.
git:
depth: 1
jobs:
include:
- stage: "Lint"
script:
- echo -e "CI_PROJECT_DIR = $TRAVIS_BUILD_DIR"
- bash -x -e run_shellcheck.sh
name: "Shellcheck"
- stage: "Tests"
name: "CentOS 5.11"
env:
- CENTOS_VER=5.11
script: &script-run-tests
- echo -e "CentOS ${CENTOS_VER} script section."
# Download and unzip BATS for running Bash unit tests.
- wget https://github.com/sstephenson/bats/archive/master.zip
- unzip master.zip
# Start container in background.
- docker pull centos:${CENTOS_VER}
- docker run -it --detach --name cont_tests --volume ${TRAVIS_BUILD_DIR}:/tmp/tests:z --workdir /tmp/tests centos:${CENTOS_VER} /bin/bash
# Install BATS and run tests.
- docker exec -it cont_tests ls
- docker exec -it cont_tests /bin/bash -c "cd bats-master; ./install.sh /usr/local"
- docker exec -it cont_tests /bin/bash -c "./run_tests.sh"
- script: *script-run-tests
name: "CentOS 6"
env:
- CENTOS_VER=6
- script: *script-run-tests
name: "CentOS 7"
env:
- CENTOS_VER=7