c5c0607641
Building gerrit requires nodejs so add it to the list of our system build deps. Change-Id: I77c56e5d37a94a0f4c1e8b1f1e5cdf7b61638410
142 lines
4.4 KiB
YAML
142 lines
4.4 KiB
YAML
- builder:
|
|
name: gerrit-buck-checkout
|
|
builders:
|
|
- shell: |
|
|
#!/bin/bash -xe
|
|
CLONEMAP=`mktemp`
|
|
function cleanup {
|
|
rm -f $CLONEMAP
|
|
}
|
|
trap cleanup EXIT
|
|
cat > $CLONEMAP << EOF
|
|
clonemap:
|
|
- name: openstack-infra/gerrit
|
|
dest: gerrit
|
|
EOF
|
|
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP \
|
|
--cache-dir /opt/git \
|
|
git://git.openstack.org openstack-infra/gerrit
|
|
cd gerrit
|
|
# This is necessary to build the core plugins
|
|
git submodule init
|
|
git submodule update
|
|
|
|
# Slightly hacky, but this is a workaround for removal of ant and asciidoc
|
|
# from the bindep fallback list while avoiding gratuitously adding a
|
|
# bindep.txt file to our fork of the Gerrit repo.
|
|
- builder:
|
|
name: extra-gerrit-build-deps
|
|
builders:
|
|
- shell: |
|
|
#!/bin/bash -xe
|
|
sudo bash -c "echo 'ant' >> /usr/local/jenkins/common_data/bindep-fallback.txt"
|
|
sudo bash -c "echo 'ant-optional' >> /usr/local/jenkins/common_data/bindep-fallback.txt"
|
|
sudo bash -c "echo 'default-jdk' >> /usr/local/jenkins/common_data/bindep-fallback.txt"
|
|
sudo bash -c "echo 'asciidoc' >> /usr/local/jenkins/common_data/bindep-fallback.txt"
|
|
sudo bash -c "echo 'nodejs' >> /usr/local/jenkins/common_data/bindep-fallback.txt"
|
|
|
|
- job:
|
|
name: gate-gerrit-buck
|
|
node: ubuntu-trusty
|
|
|
|
wrappers:
|
|
- build-timeout:
|
|
timeout: 40
|
|
- timestamps
|
|
|
|
builders:
|
|
- extra-gerrit-build-deps
|
|
- install-distro-packages
|
|
- revoke-sudo
|
|
- install-buck
|
|
- gerrit-buck-checkout
|
|
- shell: |
|
|
#!/bin/bash -xe
|
|
export PATH=`pwd`/buck/bin:$PATH
|
|
cd gerrit
|
|
/usr/local/jenkins/slave_scripts/version-properties.sh
|
|
source version.properties
|
|
buck clean
|
|
buck test --all --exclude slow
|
|
buck build release
|
|
cp buck-out/gen/release/release.war buck-out/gen/gerrit-$PROJECT_VER.war
|
|
|
|
publishers:
|
|
- war:
|
|
warfile: 'gerrit/buck-out/gen/gerrit-*.war'
|
|
target: 'tarballs/ci/test'
|
|
- console-log
|
|
|
|
|
|
- job:
|
|
name: gerrit-package-buck
|
|
node: ubuntu-trusty
|
|
|
|
wrappers:
|
|
- build-timeout:
|
|
timeout: 40
|
|
- timestamps
|
|
|
|
builders:
|
|
- extra-gerrit-build-deps
|
|
- install-distro-packages
|
|
- revoke-sudo
|
|
- install-buck
|
|
- gerrit-buck-checkout
|
|
- shell: |
|
|
#!/bin/bash -xe
|
|
export PATH=`pwd`/buck/bin:$PATH
|
|
cd gerrit
|
|
/usr/local/jenkins/slave_scripts/version-properties.sh
|
|
source version.properties
|
|
buck clean
|
|
buck build release
|
|
cp buck-out/gen/release/release.war buck-out/gen/gerrit-$PROJECT_VER.war
|
|
|
|
publishers:
|
|
- war:
|
|
warfile: 'gerrit/buck-out/gen/gerrit-*.war'
|
|
target: 'tarballs/ci/gerrit'
|
|
- console-log
|
|
|
|
- job-template:
|
|
name: '{plugin-name}-gerrit-plugin-{plugin-branch}'
|
|
node: ubuntu-trusty
|
|
|
|
wrappers:
|
|
- build-timeout:
|
|
timeout: 30
|
|
- timestamps
|
|
|
|
builders:
|
|
- extra-gerrit-build-deps
|
|
- install-distro-packages
|
|
- revoke-sudo
|
|
- install-buck
|
|
- shell: |
|
|
#!/bin/bash -xe
|
|
export PATH=`pwd`/buck/bin:$PATH
|
|
rm -rf gerrit
|
|
git clone -b {gerrit-branch} {gerrit-project}
|
|
PLUGIN_PARENT_PROJECT={plugin-parent-project}
|
|
if [ -n "$PLUGIN_PARENT_PROJECT" ]; then
|
|
git clone -b {plugin-parent-branch} {plugin-parent-project} gerrit/plugins/{plugin-parent-name}
|
|
fi
|
|
git clone -b {plugin-branch} {plugin-project} gerrit/plugins/{plugin-name}
|
|
cd gerrit/plugins/{plugin-name}
|
|
/usr/local/jenkins/slave_scripts/version-properties.sh
|
|
source version.properties
|
|
cd $WORKSPACE/gerrit
|
|
buck clean
|
|
if [ -n "$PLUGIN_PARENT_PROJECT" ]; then
|
|
buck build plugins/{plugin-parent-name}:{plugin-parent-name}
|
|
fi
|
|
buck build plugins/{plugin-name}:{plugin-name}
|
|
cp ./buck-out/gen/plugins/{plugin-name}/{plugin-name}.jar ./buck-out/gen/plugins/{plugin-name}/{plugin-name}-$PROJECT_VER.jar
|
|
|
|
publishers:
|
|
- war:
|
|
warfile: 'gerrit/buck-out/gen/plugins/{plugin-name}/{plugin-name}-*.jar'
|
|
target: 'tarballs/ci/gerrit/plugins/{plugin-name}'
|
|
- console-log
|