Brian Freeman | 48d3054 | 2019-08-20 13:13:58 -0500 | [diff] [blame] | 1 | --- |
| 2 | - scm: |
| 3 | name: git-integration |
| 4 | scm: |
| 5 | - git: |
| 6 | url: 'http://gerrit.onap.org/r/integration' |
| 7 | branches: |
| 8 | - 'origin/{branch}' |
| 9 | wipe-workspace: false |
| 10 | skip-tag: true |
| 11 | timeout: 30 |
| 12 | |
| 13 | - scm: |
| 14 | name: gerrit-trigger-scm |
| 15 | scm: |
| 16 | - git: |
| 17 | url: 'http://gerrit.onap.org/r/$GERRIT_PROJECT' |
| 18 | refspec: '$GERRIT_REFSPEC' |
| 19 | branches: |
| 20 | - 'origin/$GERRIT_BRANCH' |
| 21 | skip-tag: true |
| 22 | choosing-strategy: 'gerrit' |
| 23 | submodule: |
| 24 | recursive: true |
| 25 | |
| 26 | - publisher: |
| 27 | name: integration-robot |
| 28 | publishers: |
| 29 | - robot: |
| 30 | output-path: 'archives' |
| 31 | other-files: '' |
| 32 | unstable-threshold: 60 |
| 33 | pass-threshold: 100 |
| 34 | only-critical: false |
| 35 | - postbuildscript: |
| 36 | builders: |
| 37 | - role: BOTH |
| 38 | build-on: |
| 39 | - ABORTED |
| 40 | - FAILURE |
| 41 | - NOT_BUILT |
| 42 | - SUCCESS |
| 43 | - UNSTABLE |
| 44 | build-steps: |
| 45 | - robot-influxdb |
| 46 | mark-unstable-if-failed: true |
| 47 | |
| 48 | - publisher: |
| 49 | name: pods-influxdb |
| 50 | publishers: |
| 51 | - postbuildscript: |
| 52 | builders: |
| 53 | - role: BOTH |
| 54 | build-on: |
| 55 | - ABORTED |
| 56 | - FAILURE |
| 57 | - NOT_BUILT |
| 58 | - SUCCESS |
| 59 | - UNSTABLE |
| 60 | build-steps: |
| 61 | - pods-influxdb |
| 62 | mark-unstable-if-failed: true |
| 63 | |
| 64 | - publisher: |
| 65 | name: archive-logs |
| 66 | publishers: |
| 67 | - postbuildscript: |
| 68 | builders: |
| 69 | - role: BOTH |
| 70 | build-on: |
| 71 | - ABORTED |
| 72 | - FAILURE |
| 73 | - NOT_BUILT |
| 74 | - SUCCESS |
| 75 | - UNSTABLE |
| 76 | build-steps: |
| 77 | - archive-logs |
| 78 | mark-unstable-if-failed: true |
| 79 | |
| 80 | - builder: |
| 81 | name: archive-logs |
| 82 | builders: |
| 83 | - shell: | |
| 84 | #!/bin/bash -x |
| 85 | mkdir -p /var/www/html/logs/$JOB_NAME/$BUILD_NUMBER |
| 86 | curl -s -f "http://localhost:8080/jenkins/job/$JOB_NAME/$BUILD_NUMBER/consoleText" > $WORKSPACE/archives/console.log |
| 87 | curl -s -f "http://localhost:8080/jenkins/job/$JOB_NAME/$BUILD_NUMBER/timestamps/?time=HH:mm:ssZ&appendLog" > $WORKSPACE/archives/console-source-timestamp.log |
| 88 | rsync -avt $WORKSPACE/archives/ /var/www/html/logs/$JOB_NAME/$BUILD_NUMBER |
| 89 | echo |
| 90 | echo "Browse logs at http://onapci.org/logs/$JOB_NAME/$BUILD_NUMBER/" |
| 91 | echo |
| 92 | |
| 93 | - builder: |
| 94 | name: robot-influxdb |
| 95 | builders: |
| 96 | - shell: | |
| 97 | #!/bin/bash -x |
| 98 | # $JENKINS_HOME/onap-lab-ci/scripts/process-robot.sh $WORKSPACE/archives/output.xml $JOB_NAME $BUILD_NUMBER |
| 99 | |
| 100 | - builder: |
| 101 | name: pods-influxdb |
| 102 | builders: |
| 103 | - shell: | |
| 104 | #!/bin/bash -x |
| 105 | # $JENKINS_HOME/onap-lab-ci/scripts/process-pods.sh $WORKSPACE/archives/onap-pods.json $JOB_NAME $BUILD_NUMBER |
| 106 | |
| 107 | - publisher: |
| 108 | name: trigger-lf-lab-job |
| 109 | publishers: |
| 110 | - postbuildscript: |
| 111 | builders: |
| 112 | - role: BOTH |
| 113 | build-on: |
| 114 | - ABORTED |
| 115 | - FAILURE |
| 116 | - NOT_BUILT |
| 117 | - SUCCESS |
| 118 | - UNSTABLE |
| 119 | build-steps: |
| 120 | - trigger-lf-lab-job: |
| 121 | lab-name: '{lab-name}' |
| 122 | mark-unstable-if-failed: false |
| 123 | |
| 124 | - builder: |
| 125 | name: trigger-lf-lab-job |
| 126 | builders: |
| 127 | - shell: | |
| 128 | #!/bin/bash |
| 129 | set +x |
| 130 | LF_JOBS="tlab-oom-daily tlab-oom-staging-daily windriver-oom-daily windriver-oom-staging-daily" |
| 131 | echo $LF_JOBS | grep -q $JOB_NAME |
| 132 | if [ $? -ne 0 ]; then |
| 133 | exit 0 |
| 134 | fi |
| 135 | |
| 136 | . $JENKINS_HOME/onap-lab-ci/labs/{lab-name}-openrc |
| 137 | |
| 138 | set -v |
| 139 | CRUMB=$(curl -s -u "$LF_USERNAME:$LF_PASSWORD" 'https://jenkins.onap.org/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)') |
| 140 | curl -s -u "$LF_USERNAME:$LF_PASSWORD" -H "$CRUMB" -X POST "https://jenkins.onap.org/job/lab-$JOB_NAME/buildWithParameters?SRC_BUILD_URL=$BUILD_URL&LOG_DIR_URL=http://onapci.org/logs/$JOB_NAME/$BUILD_NUMBER/" |
| 141 | |
| 142 | - trigger: |
| 143 | name: gerrit-trigger-patch-submitted |
| 144 | triggers: |
| 145 | - gerrit: |
| 146 | server-name: 'gerrit.onap.org' |
| 147 | trigger-on: |
| 148 | - patchset-created-event: |
| 149 | exclude-drafts: 'false' |
| 150 | exclude-trivial-rebase: 'false' |
| 151 | exclude-no-code-change: 'false' |
| 152 | - draft-published-event |
| 153 | - comment-added-contains-event: |
| 154 | comment-contains-value: 'recheck' |
| 155 | projects: |
| 156 | - project-compare-type: 'ANT' |
| 157 | project-pattern: '{project}' |
| 158 | branches: |
| 159 | - branch-compare-type: 'ANT' |
| 160 | branch-pattern: '**/{branch}' |
| 161 | file-paths: |
| 162 | - compare-type: 'ANT' |
| 163 | pattern: '{files}' |