forked from fgci-org/ansible-role-slurm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (49 loc) · 2.58 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
language: python
sudo: required
dist: trusty
group: edge
services:
- docker
matrix:
fast_finish: true
env:
- IMAGE_BUILD_PLATFORM=ansible-pip-centos7
- IMAGE_BUILD_PLATFORM=ansible-master-github-centos7
- IMAGE_BUILD_PLATFORM=fgcislurm1711
- IMAGE_BUILD_PLATFORM=fgcislurm1702
install:
- npm install -g validate-dockerfile
before_script:
# TESTDIR = Where the stable-centos/Dockerfile is located
- export TESTDIR=tests
# ROLETOTEST = The name of this repo
- export ROLETOTEST=$(basename $(pwd))
- export COMMIT=${TRAVIS_COMMIT::8}
# The tag we assign the docker image we build with the Dockerfile
- export REPO=csc/ansible
# https://www.npmjs.com/package/validate-dockerfile - validate the Dockerfile
- docklint ${TESTDIR}/${IMAGE_BUILD_PLATFORM}/Dockerfile
# Build the image
- docker build -t ${REPO}:${IMAGE_BUILD_PLATFORM} ${TESTDIR}/${IMAGE_BUILD_PLATFORM}/
# Launch the container
- docker run --privileged -d -ti -e "container=docker" -v `pwd`:/$ROLETOTEST -v /sys/fs/cgroup:/sys/fs/cgroup ${REPO}:${IMAGE_BUILD_PLATFORM} /usr/sbin/init
- DOCKER_CONTAINER_ID=$(docker ps | grep ${IMAGE_BUILD_PLATFORM} | awk '{print $1}')
- docker logs $DOCKER_CONTAINER_ID
script:
# Testing of this ansible-role:
- docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c "/$ROLETOTEST/tests/test-in-docker-image.sh $IMAGE_BUILD_PLATFORM"
after_script:
- >
docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'echo -ne "------\nEND ANSIBLE TESTS\n------\nSystemD Units:\n------\n";
systemctl --no-pager --all --full status ;
echo -ne "------\nJournalD Logs:\n------\n" ;
sudo journalctl --catalog --all --full --no-pager'
- docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'tree /ansible*'
- docker ps -a
- docker stop $DOCKER_CONTAINER_ID
- docker rm -v $DOCKER_CONTAINER_ID
notifications:
email: false
flowdock:
secure: "nG5GdTXR9jPDwKvzi9yyBUQHqkaq+cA2Vmh5hX2yUhonn0fxpGf7XzmynHGdyEDSIxkf+7MZ4ZiBSzSsu3VU0fTWgGfwIADqHjrvsIAODhDgwKreaWFKSv8X/hePhFvdK97CEN5b32mwF2HRIi6O028scNcfTfcWk4OKkBjX54gZXHnWWmpnx+lmI6TSXZKTKA+QoCs6NlH4LfOh9LJRwjhSIuFw7XOe7Sijdp9vTQPRoCMeltYQIghmaWrI9/nUGES78qKxwssSF4sXEvPGC1ECTZhI/V7EKxbu50Y2FAmspPKPJ4Uu2gvhPDIHLGJxy3c+LeHuTWEgRcpA/8Mtl2oNB0hYDufnkzjlZQvdLGczUY7ngb/eek8ej41SARokN+FOognyTmxvnQt4HIaHCWNS2VPTa582cqJBjCURaYxjcd/MZOJrLy/795DnwfRnQfWMP1o0CQ7ii3S+y9cH18GPXxh35iLRYnKk95oB0KzyUUFD1++O0QsjPxgkMZwqgT4DqEsdz88wBEB93ArO7RjYcWxS6rSYgLUHSz37Jqcm+MFemh370Yw8QWiCI3fUvZ7YmaVYDSXy8ePUwyAPA5Y5kGOvgOlwxFDFKfvNIcnduEd9b8c4RZw5lXtU4Colm3PBqdK2I/Z+Ke4UN54K3bGO3BRctZJ5DE4gCtosgAg="
webhooks: https://galaxy.ansible.com/api/v1/notifications/