summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
Diffstat (limited to 'jjb')
-rw-r--r--jjb/opnfv/opnfv-docker.sh17
-rw-r--r--jjb/qtip/qtip.yml28
-rw-r--r--jjb/yardstick/yardstick-ci-jobs.yml7
3 files changed, 36 insertions, 16 deletions
diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh
index 108485d0b..bf355973c 100644
--- a/jjb/opnfv/opnfv-docker.sh
+++ b/jjb/opnfv/opnfv-docker.sh
@@ -10,17 +10,12 @@ echo
# Remove previous running containers if exist
-if [[ ! -z $(docker ps -a | grep $DOCKER_REPO_NAME) ]]; then
+if [[ -n "$(docker ps -a | grep $DOCKER_REPO_NAME)" ]]; then
echo "Removing existing $DOCKER_REPO_NAME containers..."
- #docker ps | grep $DOCKER_REPO_NAME | awk '{print $1}' | xargs docker stop
docker ps -a | grep $DOCKER_REPO_NAME | awk '{print $1}' | xargs docker rm -f
t=60
# Wait max 60 sec for containers to be removed
- while [[ $t -gt 0 ]]; do
- ids=$(docker ps | grep $DOCKER_REPO_NAME |awk '{print $1}')
- if [[ -z $ids ]]; then
- break
- fi
+ while [[ $t -gt 0 ]] && [[ -n "$(docker ps| grep $DOCKER_REPO_NAME)" ]]; do
sleep 1
let t=t-1
done
@@ -28,13 +23,15 @@ fi
# Remove existing images if exist
-if [[ ! -z $(docker images | grep $DOCKER_REPO_NAME) ]]; then
+if [[ -n "$(docker images | grep $DOCKER_REPO_NAME)" ]]; then
echo "Docker images to remove:"
docker images | head -1 && docker images | grep $DOCKER_REPO_NAME
image_tags=($(docker images | grep $DOCKER_REPO_NAME | awk '{print $2}'))
for tag in "${image_tags[@]}"; do
- echo "Removing docker image $DOCKER_REPO_NAME:$tag..."
- docker rmi -f $DOCKER_REPO_NAME:$tag
+ if [[ -n "$(docker images|grep $DOCKER_REPO_NAME|grep $tag)" ]]; then
+ echo "Removing docker image $DOCKER_REPO_NAME:$tag..."
+ docker rmi -f $DOCKER_REPO_NAME:$tag
+ fi
done
fi
diff --git a/jjb/qtip/qtip.yml b/jjb/qtip/qtip.yml
index 9c627b8af..450ba938e 100644
--- a/jjb/qtip/qtip.yml
+++ b/jjb/qtip/qtip.yml
@@ -105,6 +105,7 @@
- 'qtip-cleanup'
- 'qtip-set-env'
- 'qtip-run-suite'
+ - 'qtip-pushtoDB'
triggers:
- timed: '0 0,13,15,20 * * *'
@@ -137,12 +138,31 @@
builders:
- shell: |
#!/bin/bash
- echo "The container id is:"
container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
- echo $container_id
- QTIP_REPO=/home/opnfv/repos/qtip
- docker exec -t ${container_id} $QTIP_REPO/docker/run_qtip.sh
+ if [[ ! -z ${container_id} ]]; then
+ echo "The container ID is: ${container_id}"
+ QTIP_REPO=/home/opnfv/repos/qtip
+ docker exec -t ${container_id} $QTIP_REPO/docker/run_qtip.sh
+ else
+ echo "Container ID not available"
+ fi
+
+- builder:
+ name: qtip-pushtoDB
+ builders:
+ - shell: |
+ #!/bin/bash
+ echo "Pushing available results to DB"
+ echo "The container id is:"
+ container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
+ if [[ ! -z ${container_id} ]]; then
+ echo "The condiner ID is: ${container_id}"
+ QTIP_REPO=/home/opnfv/repos/qtip
+ docker exec -t ${container_id} $QTIP_REPO/docker/push_db.sh
+ else
+ echo "Container ID not available"
+ fi
- builder:
name: qtip-cleanup
diff --git a/jjb/yardstick/yardstick-ci-jobs.yml b/jjb/yardstick/yardstick-ci-jobs.yml
index 6283e5da1..31243ff4e 100644
--- a/jjb/yardstick/yardstick-ci-jobs.yml
+++ b/jjb/yardstick/yardstick-ci-jobs.yml
@@ -141,13 +141,16 @@
fi
opts="--privileged=true --rm"
- envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NETWORK=${EXTERNAL_NETWORK} -e YARDSTICK_BRANCH=${GIT_BRANCH##origin/}"
+ envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \
+ -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NETWORK=${EXTERNAL_NETWORK} \
+ -e YARDSTICK_BRANCH=${GIT_BRANCH##origin/} -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO}"
# Pull the latest image
docker pull opnfv/yardstick >$redirect
# Run docker
- cmd="sudo docker run ${opts} ${envs} ${labconfig} ${sshkey} opnfv/yardstick run_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SUITE_NAME}"
+ cmd="sudo docker run ${opts} ${envs} ${labconfig} ${sshkey} opnfv/yardstick \
+ run_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SUITE_NAME}"
echo "Yardstick: Running docker cmd: ${cmd}"
${cmd}