--- /dev/null
+#!/bin/sh
+
+DOCKER_CMD=docker
+if [ `which podman` ]
+then DOCKER_CMD=podman
+else
+ if [ ! `which $DOCKER_CMD` ]
+ then echo "no docker command available" >&2
+ exit 1
+ fi
+ #if "docker ps" cannot be run without error, prepend sudo
+ if ( ! $DOCKER_CMD ps >/dev/null 2>&1 );then
+ echo "docker command only usable as root, using sudo" >&2
+ DOCKER_CMD="sudo docker"
+ fi
+fi
+
+$DOCKER_CMD $@
+++ /dev/null
-version: '2'
-services:
- zookeeper:
- image: wurstmeister/zookeeper
- container_name: nbinotifications_zookeeper
- ports:
- - "2181:2181"
- kafka:
- image: wurstmeister/kafka
- container_name: nbinotifications_kafka
- ports:
- - "9092:9092"
- environment:
- KAFKA_ADVERTISED_HOST_NAME: localhost
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
\ No newline at end of file
[testenv:gnpy]
depends = buildcontroller
-whitelist_externals = sh
- sudo
+whitelist_externals = launch_tests.sh
+ dockercmd.sh
passenv = LAUNCHER USE_LIGHTY
commands =
#sudo docker pull atriki/gnpyrest:v1.2
- sudo docker run -d -p 8008:5000 --name gnpy_tpce_rest1 atriki/gnpyrest:v1.2
+ ./dockercmd.sh run -d -p 8008:5000 --name gnpy_tpce_rest1 atriki/gnpyrest:v1.2
./launch_tests.sh with_docker gnpy
- sudo docker container rm -f gnpy_tpce_rest1
+ ./dockercmd.sh container rm -f gnpy_tpce_rest1
[testenv:nbinotifications]
depends = buildcontroller,sims221
-whitelist_externals = sh
- sudo
+whitelist_externals = launch_tests.sh
+ dockercmd.sh
passenv = LAUNCHER USE_LIGHTY
commands =
- sudo docker-compose -f ./nbinotifications/docker-compose.yml up -d
+ ./dockercmd.sh run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 --name tpce_kafka1 teivah/kafka:2.0.0
./launch_tests.sh with_docker nbinotifications
- sudo docker-compose -f ./nbinotifications/docker-compose.yml down --rmi all
+ ./dockercmd.sh container rm -f tpce_kafka1
[testenv:docs]
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY