| - builder: |
| name: fetch-all-submodules |
| builders: |
| - shell: | |
| #!/bin/bash -e |
| set +x |
| cd gerrit |
| function fetch_submodules { |
| # We do need to call update even if we know it will fail: the submodules git needs |
| # to be initialised and made it pointing to the correct remote submodule URL |
| git submodule update > /dev/null 2> /dev/null || true |
| export SUBMODULES=$(git submodule status | awk '{print $2}') |
| for module in $SUBMODULES |
| do |
| echo "Fetching all changes refs for $module ..." |
| pushd $module > /dev/null |
| git fetch -q origin +refs/changes/*:refs/changes/* |
| popd > /dev/null |
| done |
| } |
| git submodule init |
| # Fetch submodules refs/changes as fallback action of a submodule update failure |
| echo "Updating all submodules ..." |
| git submodule update || ( fetch_submodules && git submodule update ) |
| |
| - job: |
| name: Gerrit-verifier |
| description: "Gerrit build of open change with BUCK\n" |
| concurrent: true |
| parameters: |
| - string: |
| name: CHANGE_URL |
| description: "Gerrit Change URL to build" |
| - string: |
| name: REFSPEC |
| description: "Git refspec to use for fetching changes" |
| - string: |
| name: BRANCH |
| description: "Git branch or SHA1 to checkout" |
| - choice: |
| name: MODE |
| choices: |
| - default |
| - notedb |
| - polygerrit |
| description: "Type of verification to execute" |
| |
| logrotate: |
| numToKeep: 256 |
| artifactNumToKeep: 1 |
| |
| properties: |
| - authorization: |
| anonymous: |
| - job-discover |
| - job-read |
| - job-extended-read |
| scm: |
| - git: |
| url: https://gerrit.googlesource.com/gerrit |
| refspec: $REFSPEC |
| branches: |
| - $BRANCH |
| disable-submodules: true |
| skip-tag: true |
| basedir: gerrit |
| |
| builders: |
| - fetch-all-submodules |
| - shell: !include-raw-escape gerrit-buck-build.sh |
| - shell: !include-raw-escape gerrit-buck-verifier-test.sh |
| - shell: !include-raw-escape gerrit-bazel-build.sh |
| - shell: !include-raw-escape gerrit-bazel-verifier-test.sh |
| |
| wrappers: |
| - xvfb: |
| installation-name: Xvfb |
| auto-display-name: true |
| parallel-build: false |
| timeout: 10 |
| screen: 1024x768x16 |
| display-name-offset: 100 |
| additional-options: -fbdir /tmp |
| debug: true |
| shutdown-with-build: false |
| - timeout: |
| timeout: 90 |
| type: absolute |
| fail: false |
| - raw: |
| xml: <jenkins.plugins.logstash.LogstashBuildWrapper plugin="logstash@1.2.0"/> |
| publishers: |
| - groovy-postbuild: |
| script: "manager.logContains('timed out') ? manager.buildAborted() : false" |
| |
| - job: |
| name: 'Gerrit-verifier-change' |
| project-type: flow |
| concurrent: true |
| parameters: |
| - string: |
| name: CHANGE_ID |
| description: Gerrit Change-ID to build and verify |
| logrotate: |
| numToKeep: 256 |
| dsl: |
| !include-raw: gerrit-verifier-change.groovy |
| |
| - job: |
| name: 'Gerrit-verifier-flow' |
| project-type: flow |
| triggers: |
| - timed: 'H/10 * * * *' |
| logrotate: |
| numToKeep: 20 |
| dsl: |
| !include-raw: gerrit-verifier-flow.groovy |