1 ####################################
2 # job configuration for qtip
3 ####################################
9 #--------------------------------
11 #--------------------------------
16 brahmaputra: &brahmaputra
18 branch: 'stable/{stream}'
19 gs-pathname: '{stream}'
20 #--------------------------------
21 # POD, INSTALLER, AND BRANCH MAPPING
22 #--------------------------------
24 #--------------------------------
26 - dell-us-testing-bm-1:
32 - dell-us-deploying-bm3:
36 #--------------------------------
38 #--------------------------------
42 # - zte-build-1: #would be confirmed with the ZTE lab by tomorrow
46 #--------------------------------
48 - 'qtip-{installer}-{pod}-daily-{stream}'
50 ################################
52 ################################
54 name: 'qtip-{installer}-{pod}-daily-{stream}'
62 - '{installer}-defaults'
65 default: 'os-nosdn-nofeature-ha'
69 credentials-id: '{ssh-credentials}'
81 recipients: nauman.ahad@xflowresearch.com, mofassir.arif@xflowresearch.com, vikram@nvirters.com
83 ###########################
85 ###########################
91 echo "Qtip: Start Docker and prepare environment"
92 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME}"
94 docker pull opnfv/qtip:latest
95 cmd=" docker run -id -e $envs -e $suite opnfv/qtip:latest /bin/bash"
96 echo "Qtip: Running docker run command: ${cmd}"
99 container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
100 if [ $(docker ps | grep 'opnfv/qtip' | wc -l) == 0 ]; then
101 echo "The container opnfv/qtip with ID=${container_id} has not been properly started. Exiting..."
109 container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
110 if [[ ! -z ${container_id} ]]; then
111 echo "The container ID is: ${container_id}"
112 QTIP_REPO=/home/opnfv/repos/qtip
113 docker exec -t ${container_id} $QTIP_REPO/docker/run_qtip.sh
115 echo "Container ID not available"
124 echo "Pushing available results to DB"
125 echo "The container id is:"
126 container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
127 if [[ ! -z ${container_id} ]]; then
128 echo "The condiner ID is: ${container_id}"
129 QTIP_REPO=/home/opnfv/repos/qtip
130 docker exec -t ${container_id} $QTIP_REPO/docker/push_db.sh
132 echo "Container ID not available"
141 echo "Cleaning up QTIP docker containers/images..."
142 # Remove previous running containers if exist
143 if [[ ! -z $(docker ps -a | grep opnfv/qtip) ]]; then
144 echo "Removing existing opnfv/qtip containers..."
145 running_containers=$(docker ps | grep opnfv/qtip | awk '{print $1}')
146 docker stop ${running_containers}
147 all_containers=$(docker ps -a | grep opnfv/qtip | awk '{print $1}')
148 docker rm ${all_containers}
151 # Remove existing images if exist
152 if [[ ! -z $(docker images | grep opnfv/qtip) ]]; then
153 echo "Docker images to remove:"
154 docker images | head -1 && docker images | grep opnfv/qtip
155 image_tags=($(docker images | grep opnfv/qtip | awk '{print $2}'))
156 for tag in "${image_tags[@]}"; do
157 echo "Removing docker image opnfv/qtip:$tag..."
158 docker rmi opnfv/qtip:$tag