diff options
Diffstat (limited to 'jjb/kvmfornfv')
-rwxr-xr-x | jjb/kvmfornfv/kvmfornfv-upload-artifact.sh | 34 | ||||
-rw-r--r-- | jjb/kvmfornfv/kvmfornfv.yml | 50 |
2 files changed, 52 insertions, 32 deletions
diff --git a/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh b/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh index 6f8fff3ff..56fb4f9c1 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 60f8de8c4..a782ee0fa 100644 --- a/jjb/kvmfornfv/kvmfornfv.yml +++ b/jjb/kvmfornfv/kvmfornfv.yml @@ -19,7 +19,7 @@ - 'build': slave-label: 'opnfv-build-ubuntu' - 'test': - slave-label: 'intel-pod1' + slave-label: 'intel-pod10' ##################################### # patch verification phases ##################################### @@ -48,6 +48,7 @@ concurrent: true properties: + - logrotate-default - throttle: enabled: true max-total: 3 @@ -56,7 +57,6 @@ parameters: - project-parameter: project: '{project}' - - gerrit-parameter: branch: '{branch}' - 'opnfv-build-ubuntu-defaults' @@ -90,25 +90,25 @@ - name: 'kvmfornfv-verify-build-{stream}' current-parameters: false predefined-parameters: | - GERRIT_BRANCH=$GERRIT_BRANCH + BRANCH=$BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: true + - multijob: + name: test + condition: SUCCESSFUL + projects: + - name: 'kvmfornfv-verify-test-{stream}' + current-parameters: false + predefined-parameters: | + BRANCH=$BRANCH GERRIT_REFSPEC=$GERRIT_REFSPEC GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER node-parameters: false kill-phase-on: FAILURE abort-all-job: true -# - multijob: -# name: test -# condition: SUCCESSFUL -# projects: -# - name: 'kvmfornfv-verify-test-{stream}' -# current-parameters: false -# predefined-parameters: | -# GERRIT_BRANCH=$GERRIT_BRANCH -# GERRIT_REFSPEC=$GERRIT_REFSPEC -# GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER -# node-parameters: false -# kill-phase-on: FAILURE -# abort-all-job: true - job-template: name: 'kvmfornfv-verify-{phase}-{stream}' @@ -127,11 +127,14 @@ parameters: - project-parameter: project: '{project}' - - gerrit-parameter: branch: '{branch}' - '{slave-label}-defaults' - 'kvmfornfv-defaults': gs-pathname: '{gs-pathname}' + - string: + name: PHASE + default: '{phase}' + description: "Execution of kvmfornfv daily '{phase}' job ." builders: - description-setter: @@ -146,7 +149,6 @@ parameters: - project-parameter: project: '{project}' - - gerrit-parameter: branch: '{branch}' - 'opnfv-build-ubuntu-defaults' - 'kvmfornfv-defaults': @@ -185,7 +187,6 @@ parameters: - project-parameter: project: '{project}' - - gerrit-parameter: branch: '{branch}' - 'opnfv-build-ubuntu-defaults' - 'kvmfornfv-defaults': @@ -194,8 +195,8 @@ scm: - git-scm -# triggers: -# - timed: '@midnight' + triggers: + - timed: '@midnight' builders: - description-setter: @@ -259,7 +260,6 @@ parameters: - project-parameter: project: '{project}' - - gerrit-parameter: branch: '{branch}' - '{slave-label}-defaults' - 'kvmfornfv-defaults': @@ -268,6 +268,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: @@ -304,6 +308,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: |