mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2026-02-13 02:20:57 +01:00
Compare commits
11 Commits
xroad-chec
...
travis_ci_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c344fe7e8 | ||
|
|
090c4ed475 | ||
|
|
3733ab15ed | ||
|
|
a50eb30511 | ||
|
|
662532ff1f | ||
|
|
ef4b65a81b | ||
|
|
484e5c3c71 | ||
|
|
d661046464 | ||
|
|
2a2c3f7dff | ||
|
|
802a8a138e | ||
|
|
365576221a |
47
.travis.yml
Normal file
47
.travis.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
#sudo: required
|
||||
#env:
|
||||
# matrix:
|
||||
# - OS_TYPE=centos OS_VERSION=6
|
||||
# - OS_TYPE=centos OS_VERSION=7
|
||||
#
|
||||
#services:
|
||||
# - docker
|
||||
#
|
||||
#before_install:
|
||||
# - sudo apt-get update
|
||||
# - echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s devicemapper"' | sudo tee /etc/default/docker > /dev/null
|
||||
# - sudo service docker restart
|
||||
# - sleep 5
|
||||
# - sudo docker pull centos:centos${OS_VERSION}
|
||||
#
|
||||
#
|
||||
#script:
|
||||
# # Run tests in Container
|
||||
# - tests/setup_tests.sh ${OS_VERSION}
|
||||
#
|
||||
sudo: required
|
||||
language: python
|
||||
|
||||
env:
|
||||
global:
|
||||
- DOCKER_IMAGE=alectolytic/rpmbuilder
|
||||
- COPR_REPOSITORY=opinkerfi/nagios-plugins
|
||||
- OS_ARCH=x86_64
|
||||
matrix:
|
||||
# - OS_TYPE=fedora OS_DIST=fedora OS_VERSION=24
|
||||
- OS_TYPE=centos OS_DIST=epel OS_VERSION=7
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
install: true
|
||||
|
||||
script:
|
||||
- docker run -v ${PWD}/check_firewall_active:/sources -v ${PWD}:/output:Z -e "SRPM_ONLY=1" ${DOCKER_IMAGE}:${OS_TYPE}-${OS_VERSION}
|
||||
# - docker run -v ${PWD}/check_firewall_active:/sources:ro -v ${PWD}:/output:rw -v ${PWD}/workspace:/workspace:rw -v ${PWD}/rpmbuild:/rpmbuild:rw -e "SRPM_ONLY=1" ${DOCKER_IMAGE}:${OS_TYPE}-${OS_VERSION}
|
||||
|
||||
after_success:
|
||||
- pip install copr-cli simplejson
|
||||
- openssl aes-256-cbc -K $encrypted_f965aefb5778_key -iv $encrypted_f965aefb5778_iv -in .copr.enc -out .copr -d
|
||||
- if [ ! -z "${TRAVIS_TAG}" ]; then copr-cli --config .copr build -r ${OS_DIST}-${OS_VERSION}-${OS_ARCH} ${COPR_REPOSITORY} *.src.rpm; fi
|
||||
|
||||
0
output/.gitkeep
Normal file
0
output/.gitkeep
Normal file
0
rpmbuild/.gitkeep
Normal file
0
rpmbuild/.gitkeep
Normal file
24
tests/setup_tests.sh
Executable file
24
tests/setup_tests.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh -xe
|
||||
|
||||
# This script starts docker and systemd (if el7)
|
||||
|
||||
# Version of CentOS/RHEL
|
||||
el_version=$1
|
||||
|
||||
# Run tests in Container
|
||||
if [ "$el_version" = "6" ]; then
|
||||
|
||||
sudo docker run --rm=true -v `pwd`:/nagios-plugins:rw centos:centos${OS_VERSION} /bin/bash -c "bash -xe /nagios-plugins/tests/test_inside_docker.sh ${OS_VERSION}"
|
||||
|
||||
elif [ "$el_version" = "7" ]; then
|
||||
|
||||
docker run --privileged -d -ti -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup -v `pwd`:/nagios-plugins:rw centos:centos${OS_VERSION} /usr/sbin/init
|
||||
DOCKER_CONTAINER_ID=$(docker ps | grep centos | awk '{print $1}')
|
||||
docker logs $DOCKER_CONTAINER_ID
|
||||
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "bash -xe /nagios-plugins/tests/test_inside_docker.sh ${OS_VERSION};
|
||||
echo -ne \"------\nEND NAGIOS-PLUGINS TESTS\n\";"
|
||||
docker ps -a
|
||||
docker stop $DOCKER_CONTAINER_ID
|
||||
docker rm -v $DOCKER_CONTAINER_ID
|
||||
|
||||
fi
|
||||
2
tests/test_inside_docker.sh
Executable file
2
tests/test_inside_docker.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
echo "Keyrsla fyrir CentOS $1"
|
||||
ls -l /
|
||||
0
workspace/.gitkeep
Normal file
0
workspace/.gitkeep
Normal file
Reference in New Issue
Block a user