blob: 5138b9b4009c4e2591b92eea729d733c7874215f [file] [log] [blame]
- 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 )
- defaults:
name: verifier-defaults
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:
- reviewdb
- notedbReadWrite
- 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
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-buck
description: "Gerrit build of open change with BUCK\n"
defaults: verifier-defaults
builders:
- fetch-all-submodules
- shell:
!include-raw-escape: gerrit-buck-build.sh
- shell:
!include-raw-escape: gerrit-buck-verifier-test.sh
- job:
name: Gerrit-verifier-bazel
description: "Gerrit build of open change with BUCK\n"
defaults: verifier-defaults
node: bazel
builders:
- fetch-all-submodules
- shell:
!include-raw-escape: gerrit-bazel-build.sh
- shell:
!include-raw-escape: gerrit-bazel-verifier-test.sh
- 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