Files
sahara-ci-config/slave-scripts/integration-cleanup.sh
Denis Egorenko 22275a32f5 Global refactoring of CI scripts
Global refactoring is include:
* drop Icehouse support;
* improvements nodepool's slave installing script;
* remove deprecated jobs;
* create config template for old integration tests;
* create config files for PYPI;
* improve and refactor function.sh, execution tests scripts;

Change-Id: Id6b6c9dd5f3f1bf500e0b2172f8cfc82a4fc9a62
2015-03-18 19:53:56 +04:00

31 lines
1.0 KiB
Bash
Executable File

#!/bin/bash -e
cd sahara-ci-config/slave-scripts
sleep 20
source $JENKINS_HOME/credentials
set -x
job_type=$(echo $PREV_JOB | awk -F '-' '{ print $1 }')
if [[ "$HOST_NAME" =~ neutron ]]; then
export os_auth_url="http://$OPENSTACK_HOST_NEUTRON_LAB:5000/v2.0"
export os_image_endpoint="http://$OPENSTACK_HOST_NEUTRON_LAB:8004/v1/$NEUTRON_LAB_TENANT_ID"
host="c1"
else
export os_auth_url="http://$OPENSTACK_HOST_NOVA_NET_LAB:5000/v2.0"
export os_image_endpoint="http://$OPENSTACK_HOST_NOVA_NET_LAB:8004/v1/$NOVA_NET_LAB_TENANT_ID"
host="c2"
fi
if [[ $(echo $PREV_JOB | awk -F '-' '{ print $2 }') =~ ui ]]; then
python cleanup.py cleanup .*$PREV_BUILD-selenium.*
elif [ "$job_type" == "tempest" ]; then
python cleanup.py cleanup .*sahara-cluster.*
else
engine=$(echo $PREV_JOB | awk -F '-' '{ print $4 }')
if [ "$engine" == "heat" ]
then
python cleanup.py cleanup-heat .*$host-$CHANGE_NUMBER-$CLUSTER_HASH.*
else
python cleanup.py cleanup .*$host-$CHANGE_NUMBER-$CLUSTER_HASH.*
fi
fi