Merge "INFO.yaml check vote for global-jjb"
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 3 Apr 2019 16:26:30 +0000 (16:26 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Wed, 3 Apr 2019 16:26:30 +0000 (16:26 +0000)
docs/jjb/lf-ci-jobs.rst
docs/jjb/lf-macros.rst
jjb/lf-ci-jobs.yaml
jjb/lf-macros.yaml
jjb/lf-maven-jobs.yaml
releasenotes/notes/jjb-workers-9459a54a5ecb91e8.yaml [new file with mode: 0644]
releasenotes/notes/mvn-verify-skip-source-39f1e748f5505d4c.yaml [new file with mode: 0644]
shell/comment-to-gerrit.sh [new file with mode: 0644]
shell/jjb-merge-job.sh
shell/python-tools-install.sh

index 6184284..5ad9b6a 100644 (file)
@@ -424,6 +424,8 @@ Runs `jenkins-jobs update` to update production job configuration
     :build-timeout: Timeout in minutes before aborting build. (default: 10)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
     :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs)
+    :jjb-workers: Number of threads to run **update** with. Set to 0 by default
+        which is equivalent to the number of available CPU cores. (default: 0)
     :jjb-version: JJB version to install. (default: see job-template)
     :stream: Keyword that can be used to represent a release code-name.
         Often the same as the branch. (default: master)
index d1efe47..133795e 100644 (file)
@@ -5,6 +5,14 @@ Global Macros
 Builders
 ========
 
+comment-to-gerrit
+-----------------
+
+This macro will post a comment to the gerrit patchset if the build
+creates a file named gerrit_comment.txt
+To use this macro add it to the list of builders.
+
+
 lf-fetch-dependent-patches
 --------------------------
 
index 8a49d03..ebf637f 100644 (file)
     # Default parameters #
     ######################
 
+    jjb-workers: 0
+
     gerrit_merge_triggers:
       - change-merged-event
       - comment-added-contains-event:
     builders:
       - lf-infra-pre-build
       - lf-infra-jjbini
+      - inject:
+          properties-content: JJB_WORKERS={jjb-workers}
       - shell: !include-raw-escape:
           - ../shell/jjb-install.sh
           - ../shell/jjb-merge-job.sh
index 58c5c50..134ef13 100644 (file)
@@ -3,6 +3,14 @@
 # BUILDERS #
 ############
 
+# To take advantage of this macro, have your build write
+# out the file 'gerrit_comment.txt' with information to post
+# back to gerrit and include this macro in the list of builders.
+- builder:
+    name: comment-to-gerrit
+    builders:
+      - shell: !include-raw ../shell/comment-to-gerrit.sh
+
 - builder:
     name: lf-fetch-dependent-patches
     builders:
index eec378a..dea836b 100644 (file)
     mvn-global-settings: global-settings
     mvn-goals: clean deploy
     mvn-opts: ''
-    mvn-params: '-Dstream=$STREAM'
+    mvn-params: '-Dstream=$STREAM -Dmaven.source.skip=true'
     mvn-version: mvn35
     stream: master
     submodule-recursive: true
diff --git a/releasenotes/notes/jjb-workers-9459a54a5ecb91e8.yaml b/releasenotes/notes/jjb-workers-9459a54a5ecb91e8.yaml
new file mode 100644 (file)
index 0000000..fc11d25
--- /dev/null
@@ -0,0 +1,6 @@
+---
+features:
+  - |
+    The **jjb-merge** job now has a new parameter ``jjb-workers`` to allow
+    configuration of the number of threads to run update with. Default is *0*
+    which is equivalent to the number of CPU cores available on the system.
diff --git a/releasenotes/notes/mvn-verify-skip-source-39f1e748f5505d4c.yaml b/releasenotes/notes/mvn-verify-skip-source-39f1e748f5505d4c.yaml
new file mode 100644 (file)
index 0000000..36470ae
--- /dev/null
@@ -0,0 +1,6 @@
+---
+other:
+  - |
+    The Maven Verify job will now call ``-Dmaven.source.skip`` to skip source
+    jar generation in the verify job. This saves us some time in the verify
+    build as the source artifacts are not useful in a verify job.
diff --git a/shell/comment-to-gerrit.sh b/shell/comment-to-gerrit.sh
new file mode 100644 (file)
index 0000000..b4d3d66
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash -l
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2019 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+
+set -xe -o pipefail
+
+if [[ -e gerrit_comment.txt ]] ; then
+  echo
+  echo "posting review comment to gerrit..."
+  echo
+  cat gerrit_comment.txt
+  echo
+  ssh -p 29418 "$GERRIT_HOST" \
+      "gerrit review -p $GERRIT_PROJECT \
+       -m '$(cat gerrit_comment.txt)' \
+       $GERRIT_PATCHSET_REVISION \
+       --notify NONE"
+fi
index 090e915..0a05c4f 100644 (file)
@@ -10,7 +10,9 @@
 ##############################################################################
 echo "---> jjb-merge-job.sh"
 
+workers="${JJB_WORKERS:-0}"
+
 # Ensure we fail the job if any steps fail.
 set -eu -o pipefail
 
-jenkins-jobs update --recursive --delete-old --workers 4 jjb/
+jenkins-jobs update --recursive --delete-old --workers "$workers" jjb/
index 2e514d5..58fb269 100644 (file)
@@ -18,7 +18,7 @@ REQUIREMENTS_FILE=$(mktemp /tmp/requirements-XXXX.txt)
 #       git+https://github.com/lfit/releng-lftools.git#egg=lftools[openstack]
 
 cat << EOF > "$REQUIREMENTS_FILE"
-lftools[openstack]~=0.22.0
+lftools[openstack]~=0.22.1
 python-heatclient~=1.16.1
 python-openstackclient~=3.16.0
 dogpile.cache~=0.6.8  # Version 0.7.[01] seems to break openstackclient