summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
Diffstat (limited to 'jjb')
-rw-r--r--jjb/apex/apex-snapshot-create.sh6
-rw-r--r--jjb/apex/apex.yml32
-rw-r--r--jjb/bottlenecks/bottlenecks-ci-jobs.yml1
-rw-r--r--jjb/bottlenecks/bottlenecks-project-jobs.yml1
-rw-r--r--jjb/compass4nfv/compass-ci-jobs.yml6
-rw-r--r--jjb/compass4nfv/compass-deploy.sh3
-rw-r--r--jjb/compass4nfv/compass-dovetail-jobs.yml15
-rw-r--r--jjb/compass4nfv/compass-verify-jobs.yml5
-rw-r--r--jjb/fuel/fuel-daily-jobs.yml42
-rwxr-xr-xjjb/kvmfornfv/kvmfornfv-upload-artifact.sh34
-rw-r--r--jjb/kvmfornfv/kvmfornfv.yml6
-rw-r--r--jjb/opera/opera-daily-jobs.yml2
-rw-r--r--jjb/releng/testapi-automate.yml131
-rw-r--r--jjb/releng/testapi-docker-deploy.sh81
-rw-r--r--jjb/yardstick/yardstick-project-jobs.yml17
15 files changed, 322 insertions, 60 deletions
diff --git a/jjb/apex/apex-snapshot-create.sh b/jjb/apex/apex-snapshot-create.sh
index 09c6a1197..5725ac641 100644
--- a/jjb/apex/apex-snapshot-create.sh
+++ b/jjb/apex/apex-snapshot-create.sh
@@ -26,10 +26,10 @@ mkdir -p ${tmp_dir}
pushd ${tmp_dir} > /dev/null
echo "Copying overcloudrc and ssh key from Undercloud..."
# Store overcloudrc
-UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]')
-scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:overcloudrc ./
+UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
+sudo scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:overcloudrc ./
# Copy out ssh key of stack from undercloud
-scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:.ssh/id_rsa ./
+sudo scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:.ssh/id_rsa ./
popd > /dev/null
echo "Gathering introspection information"
diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml
index fcf08ed86..512112e42 100644
--- a/jjb/apex/apex.yml
+++ b/jjb/apex/apex.yml
@@ -560,8 +560,36 @@
build-step-failure-threshold: 'never'
failure-threshold: 'never'
unstable-threshold: 'FAILURE'
-
-
+ - trigger-builds:
+ - project: 'apex-deploy-baremetal-os-odl-bgpvpn-ha-{stream}'
+ predefined-parameters: |
+ BUILD_DIRECTORY=apex-build-{stream}/.build
+ OPNFV_CLEAN=yes
+ git-revision: true
+ same-node: true
+ block-thresholds:
+ build-step-failure-threshold: 'never'
+ block: true
+ - trigger-builds:
+ - project: 'functest-apex-{daily-slave}-daily-{stream}'
+ predefined-parameters:
+ DEPLOY_SCENARIO=os-odl-bgpvpn-ha
+ block: true
+ same-node: true
+ block-thresholds:
+ build-step-failure-threshold: 'never'
+ failure-threshold: 'never'
+ unstable-threshold: 'FAILURE'
+ - trigger-builds:
+ - project: 'yardstick-apex-{slave}-daily-{stream}'
+ predefined-parameters:
+ DEPLOY_SCENARIO=os-odl-bgpvpn-ha
+ block: true
+ same-node: true
+ block-thresholds:
+ build-step-failure-threshold: 'never'
+ failure-threshold: 'never'
+ unstable-threshold: 'FAILURE'
# Colorado Build
- job-template:
name: 'apex-build-colorado'
diff --git a/jjb/bottlenecks/bottlenecks-ci-jobs.yml b/jjb/bottlenecks/bottlenecks-ci-jobs.yml
index 582f40c31..a9ccd6977 100644
--- a/jjb/bottlenecks/bottlenecks-ci-jobs.yml
+++ b/jjb/bottlenecks/bottlenecks-ci-jobs.yml
@@ -72,6 +72,7 @@
suite:
- 'rubbos'
- 'vstf'
+ - 'posca'
jobs:
- 'bottlenecks-{installer}-{suite}-{pod}-daily-{stream}'
diff --git a/jjb/bottlenecks/bottlenecks-project-jobs.yml b/jjb/bottlenecks/bottlenecks-project-jobs.yml
index 535edafc2..12ea31b13 100644
--- a/jjb/bottlenecks/bottlenecks-project-jobs.yml
+++ b/jjb/bottlenecks/bottlenecks-project-jobs.yml
@@ -29,6 +29,7 @@
suite:
- 'rubbos'
- 'vstf'
+ - 'posca'
################################
# job templates
diff --git a/jjb/compass4nfv/compass-ci-jobs.yml b/jjb/compass4nfv/compass-ci-jobs.yml
index 6c9686a1d..b749ea6ff 100644
--- a/jjb/compass4nfv/compass-ci-jobs.yml
+++ b/jjb/compass4nfv/compass-ci-jobs.yml
@@ -220,12 +220,6 @@
- shell:
!include-raw-escape: ./compass-deploy.sh
- publishers:
- - archive:
- artifacts: 'ansible.log'
- allow-empty: 'true'
- fingerprint: true
-
########################
# parameter macros
########################
diff --git a/jjb/compass4nfv/compass-deploy.sh b/jjb/compass4nfv/compass-deploy.sh
index f89d04e6d..6696e4b3d 100644
--- a/jjb/compass4nfv/compass-deploy.sh
+++ b/jjb/compass4nfv/compass-deploy.sh
@@ -65,7 +65,4 @@ echo
echo "--------------------------------------------------------"
echo "Done!"
-ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
-sshpass -p root scp 2>/dev/null $ssh_options root@${INSTALLER_IP}:/var/ansible/run/openstack_${OPENSTACK_VERSION}-opnfv2/ansible.log ./ &> /dev/null
-
exit $deploy_ret
diff --git a/jjb/compass4nfv/compass-dovetail-jobs.yml b/jjb/compass4nfv/compass-dovetail-jobs.yml
index 3337cd0ca..6c50d01f5 100644
--- a/jjb/compass4nfv/compass-dovetail-jobs.yml
+++ b/jjb/compass4nfv/compass-dovetail-jobs.yml
@@ -28,7 +28,7 @@
scenario:
- 'os-nosdn-nofeature-ha':
disabled: false
- auto-trigger-name: 'weekly-trigger-disabled'
+ auto-trigger-name: 'compass-{scenario}-{pod}-weekly-{stream}-trigger'
jobs:
- 'compass-{scenario}-{pod}-weekly-{stream}'
@@ -175,12 +175,6 @@
- shell:
!include-raw-escape: ./compass-deploy.sh
- publishers:
- - archive:
- artifacts: 'ansible.log'
- allow-empty: 'true'
- fingerprint: true
-
########################
# parameter macros
########################
@@ -206,4 +200,9 @@
- trigger:
name: 'compass-os-nosdn-nofeature-ha-baremetal-weekly-colorado-trigger'
triggers:
- - timed: ''
+ - timed: 'H H * * 0'
+
+- trigger:
+ name: 'dovetail-weekly-trigger'
+ triggers:
+ - timed: 'H H * * 0'
diff --git a/jjb/compass4nfv/compass-verify-jobs.yml b/jjb/compass4nfv/compass-verify-jobs.yml
index f4df6709d..d58138088 100644
--- a/jjb/compass4nfv/compass-verify-jobs.yml
+++ b/jjb/compass4nfv/compass-verify-jobs.yml
@@ -190,11 +190,6 @@
description: "Built on $NODE_NAME"
- '{project}-verify-{phase}-macro'
- publishers:
- - archive:
- artifacts: 'ansible.log'
- allow-empty: 'true'
- fingerprint: true
#####################################
# builder macros
#####################################
diff --git a/jjb/fuel/fuel-daily-jobs.yml b/jjb/fuel/fuel-daily-jobs.yml
index a9af1bcba..02267bdf9 100644
--- a/jjb/fuel/fuel-daily-jobs.yml
+++ b/jjb/fuel/fuel-daily-jobs.yml
@@ -83,6 +83,8 @@
auto-trigger-name: 'daily-trigger-disabled'
- 'os-nosdn-kvm_ovs_dpdk-ha':
auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger'
+ - 'os-nosdn-kvm_ovs_dpdk_bar-ha':
+ auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger'
# NOHA scenarios
- 'os-nosdn-nofeature-noha':
auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger'
@@ -311,6 +313,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-baremetal-daily-master-trigger'
triggers:
- timed: '30 12 * * *'
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-baremetal-daily-master-trigger'
+ triggers:
+ - timed: '30 8 * * *'
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-baremetal-daily-master-trigger'
@@ -396,6 +402,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-baremetal-daily-danube-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-baremetal-daily-danube-trigger'
+ triggers:
+ - timed: ''
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-baremetal-daily-danube-trigger'
@@ -480,6 +490,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-virtual-daily-master-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-virtual-daily-master-trigger'
+ triggers:
+ - timed: ''
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-virtual-daily-master-trigger'
@@ -564,6 +578,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-virtual-daily-danube-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-virtual-daily-danube-trigger'
+ triggers:
+ - timed: ''
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-virtual-daily-danube-trigger'
@@ -648,6 +666,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod1-daily-master-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod1-daily-master-trigger'
+ triggers:
+ - timed: ''
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-zte-pod1-daily-master-trigger'
@@ -733,6 +755,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod2-daily-master-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod2-daily-master-trigger'
+ triggers:
+ - timed: ''
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-zte-pod2-daily-master-trigger'
@@ -817,6 +843,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod3-daily-master-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod3-daily-master-trigger'
+ triggers:
+ - timed: ''
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-zte-pod3-daily-master-trigger'
@@ -901,6 +931,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod1-daily-danube-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod1-daily-danube-trigger'
+ triggers:
+ - timed: ''
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-zte-pod1-daily-danube-trigger'
@@ -986,6 +1020,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod2-daily-danube-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod2-daily-danube-trigger'
+ triggers:
+ - timed: ''
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-zte-pod2-daily-danube-trigger'
@@ -1070,6 +1108,10 @@
name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod3-daily-danube-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod3-daily-danube-trigger'
+ triggers:
+ - timed: ''
# NOHA Scenarios
- trigger:
name: 'fuel-os-nosdn-nofeature-noha-zte-pod3-daily-danube-trigger'
diff --git a/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh b/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh
index 6f8fff3ff..c6b8005c3 100755
--- a/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh
+++ b/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh
@@ -11,16 +11,17 @@ fi
case "$JOB_TYPE" in
verify)
- OPNFV_ARTIFACT_VERSION="gerrit-$GERRIT_CHANGE_NUMBER"
- GS_UPLOAD_LOCATION="gs://artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
- echo "Removing outdated artifacts produced for the previous patch for the change $GERRIT_CHANGE_NUMBER"
- gsutil ls $GS_UPLOAD_LOCATION > /dev/null 2>&1 && gsutil rm -r $GS_UPLOAD_LOCATION
- echo "Uploading artifacts for the change $GERRIT_CHANGE_NUMBER. This could take some time..."
- ;;
+ OPNFV_ARTIFACT_VERSION="gerrit-$GERRIT_CHANGE_NUMBER"
+ GS_UPLOAD_LOCATION="gs://artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
+ echo "Removing outdated artifacts produced for the previous patch for the change $GERRIT_CHANGE_NUMBER"
+ gsutil ls $GS_UPLOAD_LOCATION > /dev/null 2>&1 && gsutil rm -r $GS_UPLOAD_LOCATION
+ echo "Uploading artifacts for the change $GERRIT_CHANGE_NUMBER. This could take some time..."
+ ;;
daily)
echo "Uploading daily artifacts This could take some time..."
OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
GS_UPLOAD_LOCATION="gs://$GS_URL/$OPNFV_ARTIFACT_VERSION"
+ GS_LOG_LOCATION="gs://$GS_URL/logs-$(date -u +"%Y-%m-%d")/
;;
*)
echo "Artifact upload is not enabled for $JOB_TYPE jobs"
@@ -38,10 +39,23 @@ esac
source $WORKSPACE/opnfv.properties
# upload artifacts
-gsutil cp -r $WORKSPACE/build_output/* $GS_UPLOAD_LOCATION > $WORKSPACE/gsutil.log 2>&1
-gsutil -m setmeta -r \
- -h "Cache-Control:private, max-age=0, no-transform" \
- $GS_UPLOAD_LOCATION > /dev/null 2>&1
+if [[ "$PHASE" == "build" ]]; then
+ gsutil cp -r $WORKSPACE/build_output/* $GS_UPLOAD_LOCATION > $WORKSPACE/gsutil.log 2>&1
+ gsutil -m setmeta -r \
+ -h "Cache-Control:private, max-age=0, no-transform" \
+ $GS_UPLOAD_LOCATION > /dev/null 2>&1
+else
+ if [[ "$JOB_TYPE" == "daily" ]]; then
+ log_dir=$WORKSPACE/build_output/log
+ if [[ -d "$log_dir" ]]; then
+ #Uploading logs to artifacts
+ echo "Uploading artifacts for future debugging needs...."
+ gsutil cp -r $WORKSPACE/build_output/log-*.tar.gz $GS_LOG_LOCATION > $WORKSPACE/gsutil.log 2>&1
+ else
+ echo "No test logs/artifacts available for uploading"
+ fi
+ fi
+fi
# upload metadata file for the artifacts built by daily job
if [[ "$JOB_TYPE" == "daily" ]]; then
diff --git a/jjb/kvmfornfv/kvmfornfv.yml b/jjb/kvmfornfv/kvmfornfv.yml
index 157f2dcc4..522e9716b 100644
--- a/jjb/kvmfornfv/kvmfornfv.yml
+++ b/jjb/kvmfornfv/kvmfornfv.yml
@@ -264,6 +264,10 @@
name: TEST_NAME
default: '{testname}'
description: "Daily job to execute kvmfornfv '{testname}' testcase."
+ - string:
+ name: PHASE
+ default: '{phase}'
+ description: "Execution of kvmfornfv daily '{phase}' job ."
builders:
- description-setter:
@@ -300,6 +304,8 @@
!include-raw: ./kvmfornfv-download-artifact.sh
- shell:
!include-raw: ./kvmfornfv-test.sh
+ - shell:
+ !include-raw: ./kvmfornfv-upload-artifact.sh
- builder:
name: 'kvmfornfv-packet_forward-daily-build-macro'
builders:
diff --git a/jjb/opera/opera-daily-jobs.yml b/jjb/opera/opera-daily-jobs.yml
index fa67d5cec..f1ea1aa74 100644
--- a/jjb/opera/opera-daily-jobs.yml
+++ b/jjb/opera/opera-daily-jobs.yml
@@ -82,7 +82,7 @@
projects:
- name: 'compass-deploy-virtual-daily-{stream}'
current-parameters: false
- predefined-parameters:
+ predefined-parameters: |
DEPLOY_SCENARIO=os-nosdn-openo-noha
COMPASS_OS_VERSION=xenial
node-parameters: true
diff --git a/jjb/releng/testapi-automate.yml b/jjb/releng/testapi-automate.yml
index 47d217e51..8cb4acb05 100644
--- a/jjb/releng/testapi-automate.yml
+++ b/jjb/releng/testapi-automate.yml
@@ -4,8 +4,16 @@
- master:
branch: '{stream}'
gs-pathname: ''
+
+ phase:
+ - 'docker-update'
+ - 'docker-deploy':
+ slave-label: 'testresults'
+ - 'generate-doc'
+
jobs:
- 'testapi-automate-{stream}'
+ - 'testapi-automate-{phase}-{stream}'
- 'testapi-verify-{stream}'
project: 'releng'
@@ -15,6 +23,11 @@
slave-label: 'testresults'
+ parameters:
+ - project-parameter:
+ project: '{project}'
+ branch: '{branch}'
+
scm:
- git-scm
@@ -80,10 +93,20 @@
healthy: 50
unhealthy: 40
failing: 30
+ - 'email-publisher'
- job-template:
name: 'testapi-automate-{stream}'
+ project-type: multijob
+
+ properties:
+ - throttle:
+ enabled: true
+ max-total: 1
+ max-per-node: 1
+ option: 'project'
+
parameters:
- project-parameter:
project: '{project}'
@@ -97,6 +120,12 @@
scm:
- git-scm
+ wrappers:
+ - ssh-agent-wrapper
+ - timeout:
+ timeout: 360
+ fail: true
+
triggers:
- gerrit:
server-name: 'gerrit.opnfv.org'
@@ -112,12 +141,74 @@
branch-pattern: '**/{branch}'
file-paths:
- compare-type: 'ANT'
- pattern: 'utils/**'
+ pattern: 'utils/test/testapi/**'
+
+ builders:
+ - description-setter:
+ description: "Built on $NODE_NAME"
+ - multijob:
+ name: docker-update
+ condition: SUCCESSFUL
+ projects:
+ - name: 'testapi-automate-docker-update-{stream}'
+ current-parameters: true
+ kill-phase-on: FAILURE
+ abort-all-job: true
+ - multijob:
+ name: docker-deploy
+ condition: SUCCESSFUL
+ projects:
+ - name: 'testapi-automate-docker-deploy-{stream}'
+ current-parameters: false
+ predefined-parameters: |
+ GIT_BASE=$GIT_BASE
+ node-label-name: SLAVE_LABEL
+ node-label: testresults
+ kill-phase-on: FAILURE
+ abort-all-job: true
+ - multijob:
+ name: generate-doc
+ condition: SUCCESSFUL
+ projects:
+ - name: 'testapi-automate-generate-doc-{stream}'
+ current-parameters: true
+ kill-phase-on: FAILURE
+ abort-all-job: true
+
+ publishers:
+ - 'email-publisher'
+
+- job-template:
+ name: 'testapi-automate-{phase}-{stream}'
+
+ properties:
+ - throttle:
+ enabled: true
+ max-per-node: 1
+ option: 'project'
+
+ parameters:
+ - project-parameter:
+ project: '{project}'
+ branch: '{branch}'
+ - string:
+ name: DOCKER_TAG
+ default: "latest"
+ description: "Tag name for testapi docker image"
+
+ wrappers:
+ - ssh-agent-wrapper
+ - timeout:
+ timeout: 120
+ fail: true
+
+ scm:
+ - git-scm
builders:
- - docker-update
- - testapi-doc-build
- - upload-doc-artifact
+ - description-setter:
+ description: "Built on $NODE_NAME"
+ - 'testapi-automate-{phase}-macro'
################################
# job builders
@@ -129,25 +220,49 @@
bash ./jjb/releng/testapi-backup-mongodb.sh
- builder:
- name: run-unit-tests
+ name: 'run-unit-tests'
builders:
- shell: |
bash ./utils/test/testapi/run_test.sh
- builder:
- name: docker-update
+ name: 'testapi-automate-docker-update-macro'
builders:
- shell: |
bash ./jjb/releng/testapi-docker-update.sh
- builder:
- name: testapi-doc-build
+ name: 'testapi-automate-generate-doc-macro'
+ builders:
+ - 'testapi-doc-build'
+ - 'upload-doc-artifact'
+
+- builder:
+ name: 'testapi-doc-build'
builders:
- shell: |
bash ./utils/test/testapi/htmlize/doc-build.sh
- builder:
- name: upload-doc-artifact
+ name: 'upload-doc-artifact'
builders:
- shell: |
bash ./utils/test/testapi/htmlize/push-doc-artifact.sh
+
+- builder:
+ name: 'testapi-automate-docker-deploy-macro'
+ builders:
+ - shell: |
+ bash ./jjb/releng/testapi-docker-deploy.sh
+
+################################
+# job publishers
+################################
+
+- publisher:
+ name: 'email-publisher'
+ publishers:
+ - email:
+ recipients: rohitsakala@gmail.com serena.feng.711@gmail.com
+ notify-every-unstable-build: false
+ send-to-individuals: true
diff --git a/jjb/releng/testapi-docker-deploy.sh b/jjb/releng/testapi-docker-deploy.sh
new file mode 100644
index 000000000..04d71f76e
--- /dev/null
+++ b/jjb/releng/testapi-docker-deploy.sh
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+function check() {
+
+ # Verify hosted
+ sleep 5
+ cmd=`curl -s --head --request GET http://testresults.opnfv.org/auto/swagger/spec | grep '200 OK' > /dev/null`
+ rc=$?
+ echo $rc
+
+ if [[ $rc == 0 ]]
+ then
+ return 0
+ else
+ return 1
+ fi
+
+}
+
+echo "Getting contianer Id of the currently running one"
+contId=$(sudo docker ps | grep "opnfv/testapi:latest" | awk '{print $1}')
+
+echo "Pulling the latest image"
+sudo docker pull opnfv/testapi:latest
+
+echo "Deleting old containers of opnfv/testapi:old"
+sudo docker ps -a | grep "opnfv/testapi" | grep "old" | awk '{print $1}' | xargs -r sudo docker rm -f
+
+echo "Deleting old images of opnfv/testapi:latest"
+sudo docker images | grep "opnfv/testapi" | grep "old" | awk '{print $3}' | xargs -r sudo docker rmi -f
+
+
+if [[ -z "$contId" ]]
+then
+ echo "No running testapi container"
+
+ echo "Removing stopped testapi containers in the previous iterations"
+ sudo docker ps -f status=exited | grep "opnfv_testapi" | awk '{print $1}' | xargs -r sudo docker rm -f
+else
+ echo $contId
+
+ echo "Get the image id of the currently running conatiner"
+ currImgId=$(sudo docker ps | grep "$contId" | awk '{print $2}')
+ echo $currImgId
+
+ if [[ -z "$currImgId" ]]
+ then
+ echo "No image id found for the container id"
+ exit 1
+ fi
+
+ echo "Changing current image tag to old"
+ sudo docker tag "$currImgId" opnfv/testapi:old
+
+ echo "Removing stopped testapi containers in the previous iteration"
+ sudo docker ps -f status=exited | grep "opnfv_testapi" | awk '{print $1}' | xargs -r sudo docker rm -f
+
+ echo "Renaming the running container name to opnfv_testapi as to identify it."
+ sudo docker rename $contId opnfv_testapi
+
+ echo "Stop the currently running container"
+ sudo docker stop $contId
+fi
+
+echo "Running a container with the new image"
+sudo docker run -dti -p "8711:8000" -e "mongodb_url=mongodb://172.17.0.1:27017" -e "swagger_url=http://testresults.opnfv.org/auto" opnfv/testapi:latest
+
+if check; then
+ echo "TestResults Hosted."
+else
+ echo "TestResults Hosting Failed"
+ if [[ $(sudo docker images | grep "opnfv/testapi" | grep "old" | awk '{print $3}') ]]; then
+ echo "Running old Image"
+ sudo docker run -dti -p "8711:8000" -e "mongodb_url=mongodb://172.17.0.1:27017" -e "swagger_url=http://testresults.opnfv.org/auto" opnfv/testapi:old
+ exit 1
+ fi
+fi
+
+# Echo Images and Containers
+sudo docker images
+sudo docker ps -a
diff --git a/jjb/yardstick/yardstick-project-jobs.yml b/jjb/yardstick/yardstick-project-jobs.yml
index 4b7ff6faf..bbfa152a2 100644
--- a/jjb/yardstick/yardstick-project-jobs.yml
+++ b/jjb/yardstick/yardstick-project-jobs.yml
@@ -108,19 +108,8 @@
set -o errexit
set -o pipefail
+ sudo apt-get install -y build-essential python-dev python3-dev
+
echo "Running unit tests..."
cd $WORKSPACE
- virtualenv $WORKSPACE/yardstick_venv
- source $WORKSPACE/yardstick_venv/bin/activate
-
- # install python packages
- sudo apt-get install -y build-essential python-dev python-pip python-pkg-resources
- easy_install -U setuptools==33.1.1
- easy_install -U pip
- pip install -r requirements.txt || pip install -r tests/ci/requirements.txt
- pip install -e .
-
- # unit tests
- ./run_tests.sh
-
- deactivate
+ tox