summaryrefslogtreecommitdiffstats
path: root/jjb/functest/functest.yml
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/functest/functest.yml')
-rw-r--r--jjb/functest/functest.yml69
1 files changed, 35 insertions, 34 deletions
diff --git a/jjb/functest/functest.yml b/jjb/functest/functest.yml
index 4df779d8c..47024e20e 100644
--- a/jjb/functest/functest.yml
+++ b/jjb/functest/functest.yml
@@ -9,18 +9,19 @@
node: 'opnfv-jump-2'
installer_type: 'fuel'
installer_ip: '10.20.0.2'
- functest_repo_dir: '/home/opnfv/repos/functest'
- foreman:
node: 'opnfv-jump-2'
installer_type: 'foreman'
installer_ip: '172.30.10.73'
- functest_repo_dir: '/home/opnfv/repos/functest'
+ - apex:
+ node: 'opnfv-jump-1'
+ installer_type: 'apex'
+ installer_ip: '192.168.X.X'
pod:
- orange-build:
node: 'orange-build'
installer_type: 'foreman'
installer_ip: '172.30.10.73'
- functest_repo_dir: '/home/opnfv/repos/functest'
jobs:
- 'set-functest-env-{pod}'
@@ -199,6 +200,7 @@
parameters:
- project-parameter:
project: '{project}'
+ - functest-parameter
- string:
name: INSTALLER_TYPE
default: '{installer_type}'
@@ -207,10 +209,6 @@
name: INSTALLER_IP
default: '{installer_ip}'
description: "Installer IP."
- - string:
- name: FUNCTEST_REPO_DIR
- default: '{functest_repo_dir}'
- description: "Directory where the root functest repo is cloned in the docker."
- '{pod}'
scm:
@@ -241,6 +239,7 @@
parameters:
- project-parameter:
project: '{project}'
+ - functest-parameter
- string:
name: INSTALLER_TYPE
default: '{installer_type}'
@@ -250,10 +249,6 @@
default: '{installer_ip}'
description: "Installer IP."
- string:
- name: FUNCTEST_REPO_DIR
- default: '{functest_repo_dir}'
- description: "Directory where the root functest repo is cloned in the docker."
- - string:
name: GIT_BASE
default: ssh://gerrit.opnfv.org:29418/$PROJECT
description: "Override GIT_BASE"
@@ -286,6 +281,7 @@
parameters:
- project-parameter:
project: '{project}'
+ - functest-parameter
- string:
name: INSTALLER_TYPE
default: '{installer_type}'
@@ -295,10 +291,6 @@
default: '{installer_ip}'
description: "Installer IP."
- string:
- name: FUNCTEST_REPO_DIR
- default: '{functest_repo_dir}'
- description: "Directory where the root functest repo is cloned in the docker."
- - string:
name: GIT_BASE
default: ssh://gerrit.opnfv.org:29418/$PROJECT
description: "Override GIT_BASE"
@@ -350,10 +342,6 @@
refspec: ''
branch: '{stream}'
- wrappers:
- - ssh-agent-credentials:
- user: '{ssh-credentials}'
-
triggers:
- 'functest-{stream}'
@@ -391,10 +379,6 @@
refspec: '$GERRIT_REFSPEC'
choosing-strategy: 'gerrit'
- wrappers:
- - ssh-agent-credentials:
- user: '{ssh-credentials}'
-
triggers:
- gerrit:
trigger-on:
@@ -447,10 +431,6 @@
refspec: ''
choosing-strategy: 'default'
- wrappers:
- - ssh-agent-credentials:
- user: '{ssh-credentials}'
-
triggers:
- gerrit:
trigger-on:
@@ -478,6 +458,10 @@
name: GS_PATHNAME
default: '{gs-pathname}'
description: "Version directory where the opnfv documents will be stored in gs repository"
+ - string:
+ name: FUNCTEST_REPO_DIR
+ default: "/home/opnfv/repos/functest"
+ description: "Directory where the Functest repository is cloned"
- parameter:
name: orange-build
@@ -538,7 +522,10 @@
- shell: |
#!/bin/bash
set +e
-
+ if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
+ INSTALLER_IP=$(cat instack /var/lib/libvirt/dnsmasq/default.leases \
+ |sed 's/.*192/192/g' | sed 's/\ in.*//g')
+ fi
echo "Functest: Start Docker and prepare environment"
envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP}"
docker pull opnfv/functest:latest_stable
@@ -643,10 +630,24 @@
builders:
- shell: |
#!/bin/bash
- set +e
- # cleanup: remove any docker containers leftovers
- echo "Removing existing Functest Docker containers..."
- docker rm -f $(docker ps | grep opnfv/functest | awk '{print $1}')
- echo "Removing existing Functest Docker image..."
- docker rmi -f $(docker images | grep opnfv/functest | awk '{print $3}')
+ echo "Cleaning up docker containers/images..."
+
+ # Remove previous running containers if exist
+ if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then
+ echo "Removing existing opnfv/functest containers..."
+ docker ps | grep opnfv/functest | awk '{print $1}' | xargs docker stop
+ docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm
+ fi
+
+
+ # Remove existing images if exist
+ if [[ ! -z $(docker images | grep opnfv/functest) ]]; then
+ echo "Docker images to remove:"
+ docker images | head -1 && docker images | grep opnfv/functest
+ image_tags=($(docker images | grep opnfv/functest | awk '{print $2}'))
+ for tag in "${image_tags[@]}"; do
+ echo "Removing docker image opnfv/functest:$tag..."
+ docker rmi opnfv/functest:$tag
+ done
+ fi