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 #--------------------------------
28 auto-trigger-name: 'qtip-daily-dell-pod1-trigger'
32 auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
34 #--------------------------------
36 #--------------------------------
40 auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
41 # - zte-pod1: #would be confirmed with the ZTE lab by tomorrow
45 #--------------------------------
47 - 'qtip-{installer}-{pod}-daily-{stream}'
49 ################################
51 ################################
53 name: 'qtip-{installer}-{pod}-daily-{stream}'
61 - '{installer}-defaults'
64 default: 'os-nosdn-nofeature-ha'
68 credentials-id: '{ssh-credentials}'
73 - '{auto-trigger-name}'
83 recipients: nauman.ahad@xflowresearch.com, mofassir.arif@xflowresearch.com, vikram@nvirters.com
85 ###########################
87 ###########################
93 echo "Qtip: Start Docker and prepare environment"
94 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME}"
96 docker pull opnfv/qtip:latest
97 cmd=" docker run -id -e $envs -e $suite opnfv/qtip:latest /bin/bash"
98 echo "Qtip: Running docker run command: ${cmd}"
101 container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
102 if [ $(docker ps | grep 'opnfv/qtip' | wc -l) == 0 ]; then
103 echo "The container opnfv/qtip with ID=${container_id} has not been properly started. Exiting..."
111 container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
112 if [[ ! -z ${container_id} ]]; then
113 echo "The container ID is: ${container_id}"
114 QTIP_REPO=/home/opnfv/repos/qtip
115 docker exec -t ${container_id} $QTIP_REPO/docker/run_qtip.sh
117 echo "Container ID not available"
126 echo "Pushing available results to DB"
127 echo "The container id is:"
128 container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
129 if [[ ! -z ${container_id} ]]; then
130 echo "The condiner ID is: ${container_id}"
131 QTIP_REPO=/home/opnfv/repos/qtip
132 docker exec -t ${container_id} $QTIP_REPO/docker/push_db.sh
134 echo "Container ID not available"
143 echo "Cleaning up QTIP docker containers/images..."
144 # Remove previous running containers if exist
145 if [[ ! -z $(docker ps -a | grep opnfv/qtip) ]]; then
146 echo "Removing existing opnfv/qtip containers..."
147 running_containers=$(docker ps | grep opnfv/qtip | awk '{print $1}')
148 docker stop ${running_containers}
149 all_containers=$(docker ps -a | grep opnfv/qtip | awk '{print $1}')
150 docker rm ${all_containers}
153 # Remove existing images if exist
154 if [[ ! -z $(docker images | grep opnfv/qtip) ]]; then
155 echo "Docker images to remove:"
156 docker images | head -1 && docker images | grep opnfv/qtip
157 image_tags=($(docker images | grep opnfv/qtip | awk '{print $2}'))
158 for tag in "${image_tags[@]}"; do
159 echo "Removing docker image opnfv/qtip:$tag..."
160 docker rmi opnfv/qtip:$tag
169 name: 'qtip-daily-dell-pod1-trigger'
174 # name: 'qtip-daily-juniper-pod1-trigger'
176 # - timed : '0 0 * * *'
179 # name: 'qtip-dailty-orange-pod2-trigger'
181 # - timed : ' 0 0 * * *'