From 49afe0ed6fc5a89d3cdc5879216bb0aa8722f835 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Sat, 13 Jan 2018 12:05:34 -0500 Subject: [PATCH] Do not force expected-xml After using this for a few months now I'm convinced this is not the right way to achieve what we want here. XML differences should be informational and not build breaking. Pretty much every change requires XML changes so I think this has been more annoying than helpful. This new patch removes expected-xml and instead outputs XML diffs instead which can be stored in logs and reviewed. Change-Id: Ia4039489502499df1b15a4d9fe1e553af3c5bfcd Signed-off-by: Thanh Ha --- .../gerrit-ciman-gerrit-branch-lock-master | 520 ------------- .jjb-test/expected-xml/gerrit-ciman-jjb-deploy-job | 542 ------------- .jjb-test/expected-xml/gerrit-ciman-jjb-merge | 526 ------------- .jjb-test/expected-xml/gerrit-ciman-jjb-verify | 619 --------------- .../gerrit-ciman-packer-merge-centos-java-builder | 718 ----------------- .../gerrit-ciman-packer-merge-centos-mininet | 718 ----------------- ...rrit-ciman-packer-merge-ubuntu1604-java-builder | 718 ----------------- .../gerrit-ciman-packer-merge-ubuntu1604-mininet | 718 ----------------- .jjb-test/expected-xml/gerrit-ciman-packer-verify | 598 --------------- .../expected-xml/gerrit-maven-maven-clm-master | 604 --------------- .../gerrit-maven-maven-javadoc-publish-master | 742 ------------------ .../gerrit-maven-maven-javadoc-verify-master | 596 -------------- .../expected-xml/gerrit-maven-maven-merge-master | 852 --------------------- .../expected-xml/gerrit-maven-maven-release-master | 768 ------------------- ...t-maven-maven-verify-deps-master-mvn33-openjdk8 | 767 ------------------- ...gerrit-maven-maven-verify-master-mvn33-openjdk8 | 724 ----------------- .jjb-test/expected-xml/gerrit-maven-sonar | 649 ---------------- .../expected-xml/gerrit-node-node-verify-master | 525 ------------- .../expected-xml/gerrit-python-tox-verify-master | 644 ---------------- .jjb-test/expected-xml/gerrit-rtd-rtd-merge-master | 454 ----------- .../expected-xml/gerrit-rtd-rtd-verify-master | 532 ------------- .jjb-test/expected-xml/github-ciman-jjb-deploy-job | 514 ------------- .jjb-test/expected-xml/github-ciman-jjb-merge | 492 ------------ .jjb-test/expected-xml/github-ciman-jjb-verify | 571 -------------- .../github-ciman-packer-merge-centos-java-builder | 676 ---------------- .../github-ciman-packer-merge-centos-mininet | 676 ---------------- ...thub-ciman-packer-merge-ubuntu1604-java-builder | 676 ---------------- .../github-ciman-packer-merge-ubuntu1604-mininet | 676 ---------------- .jjb-test/expected-xml/github-ciman-packer-verify | 546 ------------- .../expected-xml/github-maven-maven-clm-master | 573 -------------- .../github-maven-maven-javadoc-publish-master | 722 ----------------- .../github-maven-maven-javadoc-verify-master | 562 -------------- .../expected-xml/github-maven-maven-merge-master | 814 -------------------- .../expected-xml/github-maven-maven-release-master | 740 ------------------ ...github-maven-maven-verify-master-mvn33-openjdk8 | 684 ----------------- .jjb-test/expected-xml/github-maven-sonar | 618 --------------- .../expected-xml/github-node-node-verify-master | 485 ------------ .../expected-xml/github-python-tox-verify-master | 610 --------------- .jjb-test/expected-xml/github-rtd-rtd-merge-master | 418 ---------- .../expected-xml/github-rtd-rtd-verify-master | 488 ------------ jjb-compare-xml.sh | 22 +- tox.ini | 7 - 42 files changed, 17 insertions(+), 25087 deletions(-) delete mode 100644 .jjb-test/expected-xml/gerrit-ciman-gerrit-branch-lock-master delete mode 100644 .jjb-test/expected-xml/gerrit-ciman-jjb-deploy-job delete mode 100644 .jjb-test/expected-xml/gerrit-ciman-jjb-merge delete mode 100644 .jjb-test/expected-xml/gerrit-ciman-jjb-verify delete mode 100644 .jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-java-builder delete mode 100644 .jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-mininet delete mode 100644 .jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-java-builder delete mode 100644 .jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet delete mode 100644 .jjb-test/expected-xml/gerrit-ciman-packer-verify delete mode 100644 .jjb-test/expected-xml/gerrit-maven-maven-clm-master delete mode 100644 .jjb-test/expected-xml/gerrit-maven-maven-javadoc-publish-master delete mode 100644 .jjb-test/expected-xml/gerrit-maven-maven-javadoc-verify-master delete mode 100644 .jjb-test/expected-xml/gerrit-maven-maven-merge-master delete mode 100644 .jjb-test/expected-xml/gerrit-maven-maven-release-master delete mode 100644 .jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8 delete mode 100644 .jjb-test/expected-xml/gerrit-maven-maven-verify-master-mvn33-openjdk8 delete mode 100644 .jjb-test/expected-xml/gerrit-maven-sonar delete mode 100644 .jjb-test/expected-xml/gerrit-node-node-verify-master delete mode 100644 .jjb-test/expected-xml/gerrit-python-tox-verify-master delete mode 100644 .jjb-test/expected-xml/gerrit-rtd-rtd-merge-master delete mode 100644 .jjb-test/expected-xml/gerrit-rtd-rtd-verify-master delete mode 100644 .jjb-test/expected-xml/github-ciman-jjb-deploy-job delete mode 100644 .jjb-test/expected-xml/github-ciman-jjb-merge delete mode 100644 .jjb-test/expected-xml/github-ciman-jjb-verify delete mode 100644 .jjb-test/expected-xml/github-ciman-packer-merge-centos-java-builder delete mode 100644 .jjb-test/expected-xml/github-ciman-packer-merge-centos-mininet delete mode 100644 .jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-java-builder delete mode 100644 .jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-mininet delete mode 100644 .jjb-test/expected-xml/github-ciman-packer-verify delete mode 100644 .jjb-test/expected-xml/github-maven-maven-clm-master delete mode 100644 .jjb-test/expected-xml/github-maven-maven-javadoc-publish-master delete mode 100644 .jjb-test/expected-xml/github-maven-maven-javadoc-verify-master delete mode 100644 .jjb-test/expected-xml/github-maven-maven-merge-master delete mode 100644 .jjb-test/expected-xml/github-maven-maven-release-master delete mode 100644 .jjb-test/expected-xml/github-maven-maven-verify-master-mvn33-openjdk8 delete mode 100644 .jjb-test/expected-xml/github-maven-sonar delete mode 100644 .jjb-test/expected-xml/github-node-node-verify-master delete mode 100644 .jjb-test/expected-xml/github-python-tox-verify-master delete mode 100644 .jjb-test/expected-xml/github-rtd-rtd-merge-master delete mode 100644 .jjb-test/expected-xml/github-rtd-rtd-verify-master diff --git a/.jjb-test/expected-xml/gerrit-ciman-gerrit-branch-lock-master b/.jjb-test/expected-xml/gerrit-ciman-gerrit-branch-lock-master deleted file mode 100644 index 1c5b305c..00000000 --- a/.jjb-test/expected-xml/gerrit-ciman-gerrit-branch-lock-master +++ /dev/null @@ -1,520 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 1 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - - - - 2 - - - origin - - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - false - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - (un)?lock branch$ - - - - - - - - - - test-server - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -# Generates a patch to lock|unlock a branch in Gerrit -# -# Assumes that the project repository was cloned via ssh and thus uses ssh to -# install the git commit hook. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -git fetch origin refs/meta/config:config -git checkout config - -install_gerrit_hook() { - ssh_url=$(git remote show origin | grep Fetch | grep 'ssh://' \ - | awk -F'/' '{print $3}' | awk -F':' '{print $1}') - ssh_port=$(git remote show origin | grep Fetch | grep 'ssh://' \ - | awk -F'/' '{print $3}' | awk -F':' '{print $2}') - - if [ -z $ssh_url ]; then - echo "ERROR: Gerrit SSH URL not found." - exit 1 - fi - - scp -p -P "$ssh_port" "$ssh_url":hooks/commit-msg .git/hooks/ - chmod u+x .git/hooks/commit-msg -} -install_gerrit_hook - -# Groups must be mapped in the groups file before they can be used -if ! grep 'Registered Users'; then - echo -e "global:Registered-Users\tRegistered Users" >> groups -fi - -mode=$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep branch | awk '{print $1}') -case $mode in - lock) - echo "Locking branch: $GERRIT_BRANCH" - git config -f project.config "access.refs/heads/${GERRIT_BRANCH}.exclusiveGroupPermissions" "submit" - git config -f project.config "access.refs/heads/${GERRIT_BRANCH}.submit" "block group Registered Users" - git commit -asm "Lock branch $GERRIT_BRANCH" - ;; - - unlock) - echo "Unlocking branch: $GERRIT_BRANCH" - git config -f project.config --remove-section "access.refs/heads/${GERRIT_BRANCH}" || true - git commit -asm "Unlock branch $GERRIT_BRANCH" - ;; - - *) - echo "ERROR: Unknown mode selected '$mode'." - exit 1 - ;; -esac - -git diff HEAD~1 -git push origin HEAD:refs/for/refs/meta/config - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 5 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-ciman-jjb-deploy-job b/.jjb-test/expected-xml/gerrit-ciman-jjb-deploy-job deleted file mode 100644 index 1c335981..00000000 --- a/.jjb-test/expected-xml/gerrit-ciman-jjb-deploy-job +++ /dev/null @@ -1,542 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - - 1 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - - - - 2 - - - origin - refs/heads/master - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - jjb-deploy (?!\*+$).+$ - - - - - - - - - - test-server - - - - - - PIP_PACKAGES=jenkins-job-builder - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -# pip install packages into a virtualenv using the first listed package as venv name -# -# PIP_PACKAGES is a space separated list of pypi packages to install. The first -# listed package is used as the virtualenv directory name. -echo "---> pip-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -# Install git-review using virtualenv to the latest version that supports -# --reviewers option, available through pip install. Existing minion image has a -# version that does not have it. -virtualenv "/tmp/v/${PIP_PACKAGES%% *}" -# shellcheck source=/tmp/v/venv/bin/activate disable=SC1091 -source "/tmp/v/${PIP_PACKAGES%% *}/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree - -# PIP_PACKAGES needs to be passed through as a space separated list of packages -# shellcheck disable=SC2086 -pip install --upgrade $PIP_PACKAGES - -echo "----> Pip Dependency Tree" -pipdeptree - - - - - - jjbini-sandbox - $HOME/.config/jenkins_jobs/jenkins_jobs.ini - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -# Push a job to jenkins-sandbox via Gerrit / GitHub comment -# Comment Pattern: jjb-deploy JOB_NAME -# JOB_NAME: Can also include * wildcards too. Additional parameters are ignored. -echo "---> jjb-deploy-job.sh" - -# Ensure we fail the job if any steps fail. -set -e -o pipefail - -# shellcheck source=/tmp/v/jenkins-job-builder/bin/activate disable=SC1091 -source "/tmp/v/jenkins-job-builder/bin/activate" - -echo "-----> Fetching project" -git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD - -# If not Gerrit Trigger than assume GitHub -COMMENT="${GERRIT_EVENT_COMMENT_TEXT:-$ghprbCommentBody}" -JOB_NAME=$(echo "$COMMENT" | grep jjb-deploy | awk '{print $2}') - -# Strip all * characters to prevent pushing all jobs to Jenkins -if [ -z "${JOB_NAME//\*/}" ]; then - echo "ERROR: JOB_NAME cannot be empty or '*'." - exit 1 -fi - -jenkins-jobs update --recursive --workers 4 jjb/ "$JOB_NAME" - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 5 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-ciman-jjb-merge b/.jjb-test/expected-xml/gerrit-ciman-jjb-merge deleted file mode 100644 index be6ac423..00000000 --- a/.jjb-test/expected-xml/gerrit-ciman-jjb-merge +++ /dev/null @@ -1,526 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - JJB_VERSION - Jenkins Job Builder version to download and install. - 1.6.2 - - - - - - 2 - - - origin - - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - **/*.sh - - - ANT - **/*.yaml - - - ANT - **/global-jjb - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - - remerge$ - - - - - - - - - - test-server - - - - - - - jjbini - $HOME/.config/jenkins_jobs/jenkins_jobs.ini - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> jjb-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv "/tmp/v/jjb" -# shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091 -source "/tmp/v/jjb/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION" - -echo "----> Pip Dependency Tree" -pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> jjb-merge-job.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -jenkins-jobs update --recursive --delete-old --workers 4 jjb/ - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-ciman-jjb-verify b/.jjb-test/expected-xml/gerrit-ciman-jjb-verify deleted file mode 100644 index 75f7dbc2..00000000 --- a/.jjb-test/expected-xml/gerrit-ciman-jjb-verify +++ /dev/null @@ -1,619 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - JJB_VERSION - Jenkins Job Builder version to download and install. - 1.6.2 - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - **/*.sh - - - ANT - **/*.yaml - - - ANT - **/global-jjb - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - true - false - false - - - - recheck$ - - - - - - - - - - test-server - - - - - - - jjbini - $HOME/.config/jenkins_jobs/jenkins_jobs.ini - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script will make sure that there are no JIRA URLs in the commit -# message. JIRA URLs will break the its-jira plugin - -# Ensure we fail the job if any steps fail. -# Do not treat undefined variables as errors as in this case we are allowed -# to have JIRA_URL undefined -set -e -o pipefail -set +u - -if [ -n "${JIRA_URL}" ]; -then - BASE_URL=$(echo $JIRA_URL | awk -F'/' '{print $3}') - JIRA_LINK=$(git rev-list --format=%B --max-count=1 HEAD | grep -io "http[s]*://$BASE_URL/" || true) - if [[ ! -z "$JIRA_LINK" ]] - then - echo 'Remove JIRA URLs from commit message' - echo 'Add jira references as: Issue: <JIRAKEY>-<ISSUE#>, instead of URLs' - exit 1 - fi -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> jjb-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv "/tmp/v/jjb" -# shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091 -source "/tmp/v/jjb/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION" - -echo "----> Pip Dependency Tree" -pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> jjb-verify-job.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -jenkins-jobs -l DEBUG test --recursive -o archives/job-configs jjb/ - -# Sort job output into sub-directories. On large Jenkins systems that have -# many jobs archiving so many files into the same directory makes NGINX return -# the directory list slow. -pushd archives/job-configs -for letter in {a..z} -do - if [[ $(ls "$letter"* > /dev/null 2>&1) -eq 0 ]] - then - mkdir "$letter" - find . -maxdepth 1 -type f -name "$letter*" -exec mv {} "$letter" \; - fi -done -popd - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2015 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 -############################################################################## -echo "---> jjb-check-unicode.sh" - -if LC_ALL=C grep -I -r '[^[:print:][:space:]]' jjb/; then - echo "Found files containing non-ascii characters." - exit 1 -fi - -echo "All files are ASCII only" - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2016 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 -############################################################################## -echo "---> gpg-verify-git-signature.sh" - -if git log --show-signature -1 | grep -E -q 'gpg: Signature made.*key ID'; then - echo "Git commit is GPG signed." -else - echo "WARNING: GPG signature missing for the commit." -fi - -# Do NOT fail the job for unsigned commits -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-java-builder b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-java-builder deleted file mode 100644 index 3569d83e..00000000 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-java-builder +++ /dev/null @@ -1,718 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - 00 10 1 * * - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - packer/vars/centos.json - - - ANT - packer/templates/java-builder.json - - - ANT - packer/provision/*.sh - - - ANT - packer/provision/java-builder.yaml - - - ANT - packer/provision/lib/** - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - - remerge$ - - - - - - - - - - test-server - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_PLATFORM=centos -PACKER_TEMPLATE=java-builder -PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-build.sh" -# The script builds an image using packer -# $CLOUDENV : Provides the cloud credential file. -# $PACKER_PLATFORM : Provides the packer platform. -# $PACKER_TEMPLATE : Provides the packer temnplate. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -# Prioritize the project's own version of vars if available -platform_file="common-packer/vars/$PACKER_PLATFORM.json" -if [ -f "$PACKER_PLATFORM" ]; then - platform_file="vars/$PACKER_PLATFORM.json" -fi - -cd packer -export PACKER_LOG="yes" -export PACKER_LOG_PATH="$PACKER_BUILD_LOG" -packer.io build -color=false \ - -var-file="$CLOUDENV" \ - -var-file="$platform_file" \ - "templates/$PACKER_TEMPLATE.json" - -# Retrive the list of cloud providers -mapfile -t clouds < <(jq -r '.builders[].name' "templates/$PACKER_TEMPLATE.json") - -# Split public/private clouds logs -for cloud in "${clouds[@]}"; do - grep -e "$cloud" "$PACKER_BUILD_LOG" > "$PACKER_LOGS_DIR/packer-build_$cloud.log" 2>&1 -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 90 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-mininet b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-mininet deleted file mode 100644 index a759c4b1..00000000 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-mininet +++ /dev/null @@ -1,718 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - 00 10 1 * * - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - packer/vars/centos.json - - - ANT - packer/templates/mininet.json - - - ANT - packer/provision/*.sh - - - ANT - packer/provision/mininet.yaml - - - ANT - packer/provision/lib/** - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - - remerge$ - - - - - - - - - - test-server - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_PLATFORM=centos -PACKER_TEMPLATE=mininet -PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-build.sh" -# The script builds an image using packer -# $CLOUDENV : Provides the cloud credential file. -# $PACKER_PLATFORM : Provides the packer platform. -# $PACKER_TEMPLATE : Provides the packer temnplate. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -# Prioritize the project's own version of vars if available -platform_file="common-packer/vars/$PACKER_PLATFORM.json" -if [ -f "$PACKER_PLATFORM" ]; then - platform_file="vars/$PACKER_PLATFORM.json" -fi - -cd packer -export PACKER_LOG="yes" -export PACKER_LOG_PATH="$PACKER_BUILD_LOG" -packer.io build -color=false \ - -var-file="$CLOUDENV" \ - -var-file="$platform_file" \ - "templates/$PACKER_TEMPLATE.json" - -# Retrive the list of cloud providers -mapfile -t clouds < <(jq -r '.builders[].name' "templates/$PACKER_TEMPLATE.json") - -# Split public/private clouds logs -for cloud in "${clouds[@]}"; do - grep -e "$cloud" "$PACKER_BUILD_LOG" > "$PACKER_LOGS_DIR/packer-build_$cloud.log" 2>&1 -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 90 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-java-builder b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-java-builder deleted file mode 100644 index ebcd8ae4..00000000 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-java-builder +++ /dev/null @@ -1,718 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - 00 10 1 * * - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - packer/vars/ubuntu1604.json - - - ANT - packer/templates/java-builder.json - - - ANT - packer/provision/*.sh - - - ANT - packer/provision/java-builder.yaml - - - ANT - packer/provision/lib/** - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - - remerge$ - - - - - - - - - - test-server - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_PLATFORM=ubuntu1604 -PACKER_TEMPLATE=java-builder -PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-build.sh" -# The script builds an image using packer -# $CLOUDENV : Provides the cloud credential file. -# $PACKER_PLATFORM : Provides the packer platform. -# $PACKER_TEMPLATE : Provides the packer temnplate. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -# Prioritize the project's own version of vars if available -platform_file="common-packer/vars/$PACKER_PLATFORM.json" -if [ -f "$PACKER_PLATFORM" ]; then - platform_file="vars/$PACKER_PLATFORM.json" -fi - -cd packer -export PACKER_LOG="yes" -export PACKER_LOG_PATH="$PACKER_BUILD_LOG" -packer.io build -color=false \ - -var-file="$CLOUDENV" \ - -var-file="$platform_file" \ - "templates/$PACKER_TEMPLATE.json" - -# Retrive the list of cloud providers -mapfile -t clouds < <(jq -r '.builders[].name' "templates/$PACKER_TEMPLATE.json") - -# Split public/private clouds logs -for cloud in "${clouds[@]}"; do - grep -e "$cloud" "$PACKER_BUILD_LOG" > "$PACKER_LOGS_DIR/packer-build_$cloud.log" 2>&1 -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 90 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet deleted file mode 100644 index 052561cb..00000000 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet +++ /dev/null @@ -1,718 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - 00 10 1 * * - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - packer/vars/ubuntu1604.json - - - ANT - packer/templates/mininet.json - - - ANT - packer/provision/*.sh - - - ANT - packer/provision/mininet.yaml - - - ANT - packer/provision/lib/** - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - - remerge$ - - - - - - - - - - test-server - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_PLATFORM=ubuntu1604 -PACKER_TEMPLATE=mininet -PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-build.sh" -# The script builds an image using packer -# $CLOUDENV : Provides the cloud credential file. -# $PACKER_PLATFORM : Provides the packer platform. -# $PACKER_TEMPLATE : Provides the packer temnplate. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -# Prioritize the project's own version of vars if available -platform_file="common-packer/vars/$PACKER_PLATFORM.json" -if [ -f "$PACKER_PLATFORM" ]; then - platform_file="vars/$PACKER_PLATFORM.json" -fi - -cd packer -export PACKER_LOG="yes" -export PACKER_LOG_PATH="$PACKER_BUILD_LOG" -packer.io build -color=false \ - -var-file="$CLOUDENV" \ - -var-file="$platform_file" \ - "templates/$PACKER_TEMPLATE.json" - -# Retrive the list of cloud providers -mapfile -t clouds < <(jq -r '.builders[].name' "templates/$PACKER_TEMPLATE.json") - -# Split public/private clouds logs -for cloud in "${clouds[@]}"; do - grep -e "$cloud" "$PACKER_BUILD_LOG" > "$PACKER_LOGS_DIR/packer-build_$cloud.log" 2>&1 -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 90 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-verify b/.jjb-test/expected-xml/gerrit-ciman-packer-verify deleted file mode 100644 index bb6ead14..00000000 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-verify +++ /dev/null @@ -1,598 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - packer/vars/**.json - - - ANT - packer/templates/**.json - - - ANT - packer/provision/**.sh - - - ANT - packer/provision/lib/** - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - true - false - false - - - - recheck$ - - - - - - - - - - test-server - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-maven-maven-clm-master b/.jjb-test/expected-xml/gerrit-maven-maven-clm-master deleted file mode 100644 index 94560692..00000000 --- a/.jjb-test/expected-xml/gerrit-maven-maven-clm-master +++ /dev/null @@ -1,604 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 30 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - H H * * 6 - - - - - - ANT - releng/ciman - - - ANT - **/master - - - false - - - - true - true - true - true - - false - false - true - false - false - - - False - - false - - - run-clm$ - - - - - - - - - - test-server - - - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - gerrit-maven-project-settings - - SETTINGS_FILE - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - find . -regex ".*karaf/target" | xargs rm -rf - - - - list - gerrit-maven - - - - - - - false - build - - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-maven-maven-javadoc-publish-master b/.jjb-test/expected-xml/gerrit-maven-maven-javadoc-publish-master deleted file mode 100644 index 6281f823..00000000 --- a/.jjb-test/expected-xml/gerrit-maven-maven-javadoc-publish-master +++ /dev/null @@ -1,742 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 30 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - - remerge$ - - - - - - - - - - test-server - - - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - gerrit-maven-project-settings - - SETTINGS_FILE - - - - - - SERVER_ID=project-site - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - - DEPLOY_PATH=org.example.project/$STREAM - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Generates javadoc in a Maven project. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -JAVADOC_DIR="$WORKSPACE/archives/javadoc" -mkdir -p "$WORKSPACE/archives" - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean install javadoc:aggregate \ - -Pq -Dmaven.javadoc.skip=false \ - -DskipTests=true \ - -Dcheckstyle.skip=true \ - -Dfindbugs.skip=true \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -mv "$WORKSPACE/target/site/apidocs" "$JAVADOC_DIR" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Publishes javadoc to a Maven project. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -JAVADOC_DIR="$WORKSPACE/archives/javadoc" - -pushd "$JAVADOC_DIR" -zip -r "$WORKSPACE/javadoc.zip" . -popd - -lftools deploy nexus-zip "$NEXUS_URL" "javadoc" "$DEPLOY_PATH" "$WORKSPACE/javadoc.zip" - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-maven-maven-javadoc-verify-master b/.jjb-test/expected-xml/gerrit-maven-maven-javadoc-verify-master deleted file mode 100644 index 0f9e56bb..00000000 --- a/.jjb-test/expected-xml/gerrit-maven-maven-javadoc-verify-master +++ /dev/null @@ -1,596 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - - 30 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - true - false - false - - - - recheck$ - - - - - - - - - - test-server - - - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - gerrit-maven-project-settings - - SETTINGS_FILE - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Generates javadoc in a Maven project. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -JAVADOC_DIR="$WORKSPACE/archives/javadoc" -mkdir -p "$WORKSPACE/archives" - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean install javadoc:aggregate \ - -Pq -Dmaven.javadoc.skip=false \ - -DskipTests=true \ - -Dcheckstyle.skip=true \ - -Dfindbugs.skip=true \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -mv "$WORKSPACE/target/site/apidocs" "$JAVADOC_DIR" - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-maven-maven-merge-master b/.jjb-test/expected-xml/gerrit-maven-maven-merge-master deleted file mode 100644 index da858a5c..00000000 --- a/.jjb-test/expected-xml/gerrit-maven-maven-merge-master +++ /dev/null @@ -1,852 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 30 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - -Dmerge - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - H H * * 0 - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - ** - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - - remerge$ - - - - - - - - - - test-server - - - - - mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - gerrit-maven-project-settings - - SETTINGS_FILE - - - - - - SERVER_ID=fakeproject-snapshots - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - - NEXUS_CUT_DIRS=6 -NEXUS_REPO=fakeproject-snapshots - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Uses wget to fetch a project's maven-metadata.xml files from a Maven repository. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -project=$(xmlstarlet sel \ - -N "x=http://maven.apache.org/POM/4.0.0" -t \ - --if "/x:project/x:groupId" \ - -v "/x:project/x:groupId" \ - --elif "/x:project/x:parent/x:groupId" \ - -v "/x:project/x:parent/x:groupId" \ - --else -o "" pom.xml) -project_path="${project//.//}" - -mkdir -p "$WORKSPACE/m2repo/$project_path" -pushd "$WORKSPACE/m2repo/$project_path" - # Temporarily disable failing for wget - # If 404 happens we don't care because it might be a new project. - set +e - wget -nv --recursive \ - --accept maven-metadata.xml \ - -R "index.html*" \ - --execute robots=off \ - --no-parent \ - --no-host-directories \ - --cut-dirs="$NEXUS_CUT_DIRS" \ - "$NEXUS_URL/content/repositories/$NEXUS_REPO/$project_path/" - set -e # Re-enable. -popd - -# Backup metadata - Used later to find metadata files that have not been modified -mkdir -p "$WORKSPACE/m2repo-backup" -cp -a "$WORKSPACE/m2repo/"* "$WORKSPACE/m2repo-backup" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean deploy \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -# Upload the snapshot files to a snapshot repo. -# -# Requires the existance of $WORKSPACE/m2repo and $WORKSPACE/m2repo-backup to -# compare if maven metadata files have changed. Unchanged files are then -# removed from $WORKSPACE/m2repo before uploading to the snapshot repo. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -m2repo_dir="$WORKSPACE/m2repo" -nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO" - -# Remove metadata files that were not updated. -set +e # Temporarily disable to run diff command. -IFS=" " read -r -a metadata_files <<< "$(diff -s -r "$m2repo_dir" "$WORKSPACE/m2repo-backup" \ - | grep 'Files .* and .* are identical' \ - | awk '{print $2}')" -set -e # Re-enable. - -set +u # $metadata_files could be unbound if project is new. -if [ -n "${metadata_files[*]}" ]; then - for i in "${metadata_files[@]}"; do - rm "$i"* - done -fi -set -u # Re-enable. - -find "$m2repo_dir" -type d -empty -delete - -lftools deploy nexus -s "$nexus_repo_url" "$m2repo_dir" - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - false - - - - - low - [FINDBUGS] - - false - false - false - false - - - - - - - - - - - false - true - false - - - - **/**.exec - **/classes - **/src/main/java - false - - **/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/** - 10 - 20 - 50 - 40 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-maven-maven-release-master b/.jjb-test/expected-xml/gerrit-maven-maven-release-master deleted file mode 100644 index 6db96c80..00000000 --- a/.jjb-test/expected-xml/gerrit-maven-maven-release-master +++ /dev/null @@ -1,768 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 30 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - build release$ - - - - - - - - - - test-server - - - - - mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - gerrit-maven-project-settings - - SETTINGS_FILE - - - - - - SERVER_ID=project-staging - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script removes the -SNAPSHOT from a project to prepare it for release. - -PATCH_DIR="$WORKSPACE/archives/patches" -mkdir -p "$PATCH_DIR" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -echo "$PROJECT" "$(git rev-parse --verify HEAD)" | tee -a "$PATCH_DIR/taglist.log" - -# Strip -SNAPSHOT from version to prepare release. -find . -name "*.xml" -print0 | xargs -0 sed -i 's/-SNAPSHOT//g' - -git commit -am "Release $PROJECT" -git format-patch --stdout "origin/$GERRIT_BRANCH" > "$PATCH_DIR/${PROJECT//\//-}.patch" -git bundle create "$PATCH_DIR/${PROJECT//\//-}.bundle" "origin/${GERRIT_BRANCH}..HEAD" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean deploy \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script publishes artifacts to a staging repo in Nexus. -# -# $WORKSPACE/m2repo : Exists and used to deploy the staging repository. -# $NEXUS_URL : Jenkins global variable should be defined. -# $STAGING_PROFILE_ID : Provided by a job parameter. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -TMP_FILE="$(mktemp)" -lftools deploy nexus-stage "$NEXUS_URL" "$STAGING_PROFILE_ID" "$WORKSPACE/m2repo" | tee "$TMP_FILE" -staging_repo=$(sed -n -e 's/Staging repository \(.*\) created\./\1/p' "$TMP_FILE") - -# Store repo info to a file in archives -mkdir -p "$WORKSPACE/archives" -echo "$staging_repo" > "$WORKSPACE/archives/staging-repo.txt" - -# Cleanup -rm "$TMP_FILE" - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8 b/.jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8 deleted file mode 100644 index 1db41869..00000000 --- a/.jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8 +++ /dev/null @@ -1,767 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - -Dstream=$STREAM - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - ** - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - recheck: [0-9 ]+ - - - - - - - - - - test-server - - - - - mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - gerrit-maven-project-settings - - SETTINGS_FILE - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -# Fetches patches all projects provided by comment trigger -# -# Takes a list of Gerrit patches and fetches all projects and cherry-pick -# patches for projects. The trigger is -# 'recheck: SPACE_SEPERATED_LIST_OF_PATCHES' -# -# NOTE: This script assumes the user will provide the correct dependency order -# via the PATCHES list. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -REPOS_DIR="$WORKSPACE/.repos" - -IFS=" " read -r -a PATCHES <<< "$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'recheck:' | awk -F: '{print $2}')" - -# Workaround for git-review bug in v1.24 -# https://storyboard.openstack.org/#!/story/2001081 -set +u # Allow unbound variables for virtualenv -virtualenv --quiet "/tmp/v/git-review" -# shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091 -source "/tmp/v/git-review/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade git-review -set -u -# End git-review workaround - -projects=() -for patch in $(echo "${PATCHES[@]}"); do - json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//") - project=$(echo "$json" | jq -r '.project') - branch=$(echo "$json" | jq -r '.branch') - - if [ ! -d "$REPOS_DIR/$project" ]; then - git clone -q --depth 1 -b "$branch" "$GIT_URL/$project" "$REPOS_DIR/$project" - - # This array will be used later to determine project build order. - projects+=("$project") - fi - - pushd "$REPOS_DIR/$project" - # If remote gerrit already exists just make sure path is expected - if ! git remote add gerrit "$GERRIT_URL/$project" > /dev/null 2>&1; then - git remote set-url gerrit "$GERRIT_URL/$project" - fi - git review --cherrypick="$patch" - popd -done - -# This script should be a macro which re-inject's the projects variable back -# into the build so a script later on can use it. -echo "DEPENDENCY_BUILD_ORDER=${projects[*]}" > "$WORKSPACE/.dependency.properties" - - - - - $WORKSPACE/.dependency.properties - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Builds projects provided via $DEPENDENCY_BUILD_ORDER list -# -# This runs a `mvn clean install` against all projects provided by a list. This -# script is a companion script for the gerrit-fetch-dependencies script which -# clones project repos to "$WORKSPACE/.repos". - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -IFS=" " read -r -a PROJECTS <<< "$DEPENDENCY_BUILD_ORDER" -REPOS_DIR="$WORKSPACE/.repos" - -export MAVEN_OPTS - -for project in "${PROJECTS[@]}"; do - pushd "$REPOS_DIR/$project" - # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. - # shellcheck disable=SC2086 - $MVN clean install \ - -Pq \ - -DskipTests=true \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - $MAVEN_OPTIONS $MAVEN_PARAMS - popd -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean deploy \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - false - - - - - low - [FINDBUGS] - - false - false - false - false - - - - - - - - - - - false - true - false - - - - **/**.exec - **/classes - **/src/main/java - false - - **/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/** - 10 - 20 - 50 - 40 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 60 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-maven-maven-verify-master-mvn33-openjdk8 b/.jjb-test/expected-xml/gerrit-maven-maven-verify-master-mvn33-openjdk8 deleted file mode 100644 index b469e52b..00000000 --- a/.jjb-test/expected-xml/gerrit-maven-maven-verify-master-mvn33-openjdk8 +++ /dev/null @@ -1,724 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - -Dstream=$STREAM - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - ** - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - true - false - false - - - - recheck$ - - - - - - - - - - test-server - - - - - mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - gerrit-maven-project-settings - - SETTINGS_FILE - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean deploy \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - false - - - - - low - [FINDBUGS] - - false - false - false - false - - - - - - - - - - - false - true - false - - - - **/**.exec - **/classes - **/src/main/java - false - - **/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/** - 10 - 20 - 50 - 40 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 60 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-maven-sonar b/.jjb-test/expected-xml/gerrit-maven-sonar deleted file mode 100644 index 98ae3baa..00000000 --- a/.jjb-test/expected-xml/gerrit-maven-sonar +++ /dev/null @@ -1,649 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - SONAR_MAVEN_GOAL - Maven goals to pass to the Sonar call. Typically sonar:sonar -however to use a specific version of the sonar-maven-plugin we -can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar". - - sonar:sonar - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - H H * * 6 - - - - - - ANT - releng/ciman - - - ANT - **/master - - - false - - - - true - true - true - true - - false - false - true - false - false - - - False - - false - - - run-sonar$ - - - - - - - - - - test-server - - - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - SONAR_HOST_URL=$SONAR_URL - - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - gerrit-maven-project-settings - - SETTINGS_FILE - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean deploy \ - -Dsonar \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN $SONAR_MAVEN_GOAL \ - -Dsonar -Dsonar.host.url="$SONAR_HOST_URL" \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - **/**.exec - **/classes - **/src/main/java - false - - **/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/** - 10 - 20 - 50 - 40 - - - false - - - - - low - [FINDBUGS] - - false - false - false - false - - - - - - - - - - - false - true - false - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-node-node-verify-master b/.jjb-test/expected-xml/gerrit-node-node-verify-master deleted file mode 100644 index e9ebb3bf..00000000 --- a/.jjb-test/expected-xml/gerrit-node-node-verify-master +++ /dev/null @@ -1,525 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - NODE_DIR - Path to a Node project directory. - - - - NODE_VERSION - Version of NodeJS to install. - 6.11.4 - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/origin/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - - - ANT - {node-dir}/** - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - false - false - false - - - - recheck$ - - - - - - - - - - test-server - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> node-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/python" -# shellcheck source=/tmp/v/node/bin/activate disable=SC1091 -source "/tmp/v/python/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade nodeenv - -echo "----> Pip Dependency Tree" -pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> node-run.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -# Prepare node -nodeenv --node="$NODE_VERSION" --prebuilt "/tmp/v/node" -source /tmp/v/node/bin/activate -cd "$WORKSPACE/$NODE_DIR" -npm install -npm test - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-python-tox-verify-master b/.jjb-test/expected-xml/gerrit-python-tox-verify-master deleted file mode 100644 index 7505dce0..00000000 --- a/.jjb-test/expected-xml/gerrit-python-tox-verify-master +++ /dev/null @@ -1,644 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - TOX_DIR - Path to directory containing tox.ini file. - - - - - TOX_ENVS - Tox environments to run build against. -Example: docs,py2,py3 - - - - - - - - 2 - - - origin - $GERRIT_REFSPEC - $GIT_URL/$GERRIT_PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - releng/ciman - - - ANT - **/master - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - true - false - false - - - - recheck$ - - - - - - - - - - test-server - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - - - - - PYTHON_VERSION=python3 - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> tox-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox" -# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 -source "/tmp/v/tox/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade argparse detox tox tox-pyenv - -echo "----> Pip Dependency Tree" -pipdeptree - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> tox-run.sh" - -# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 -source "/tmp/v/tox/bin/activate" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -ARCHIVE_TOX_DIR="$WORKSPACE/archives/tox" -mkdir -p "$ARCHIVE_TOX_DIR" -cd "$WORKSPACE/$TOX_DIR" - -if [ -d "/opt/pyenv" ]; then - echo "---> Setting up pyenv" - export PYENV_ROOT="/opt/pyenv" - export PATH="$PYENV_ROOT/bin:$PATH" -fi - -set +e # Allow detox to fail so that we can collect the logs in the next step -if [ ! -z "$TOX_ENVS" ]; then - detox -e "$TOX_ENVS" | tee -a "$ARCHIVE_TOX_DIR/detox.log" - detox_status="${PIPESTATUS[0]}" -else - detox | tee -a "$ARCHIVE_TOX_DIR/detox.log" - detox_status="${PIPESTATUS[0]}" -fi - -# Disable SC2116 as we want to echo a space separated list of TOX_ENVS -# shellcheck disable=SC2116 -for i in .tox/*/log; do - tox_env=$(echo $i | awk -F'/' '{print $2}') - cp -r "$i" "$ARCHIVE_TOX_DIR/$tox_env" -done -set -e # Logs collected so re-enable - -echo "Completed tox runs." - -test "$detox_status" -eq 0 || exit "$detox_status" - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-rtd-rtd-merge-master b/.jjb-test/expected-xml/gerrit-rtd-rtd-merge-master deleted file mode 100644 index a61fff8a..00000000 --- a/.jjb-test/expected-xml/gerrit-rtd-rtd-merge-master +++ /dev/null @@ -1,454 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - - - - - - - - - ANT - ** - - - ANT - **/master - - - - - ANT - **/*.rst - - - ANT - **/conf.py - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - - remerge$ - - - - - - - - - - test-server - - - - - - RTD_PROJECT=gerrit-rtd - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> rtd-trigger-build.sh" - -if [ "$GERRIT_BRANCH" == "master" ]; then - RTD_BUILD_VERSION=latest -else - RTD_BUILD_VERSION="${GERRIT_BRANCH/\//-}" -fi - -curl -X POST --data "version_slug=$RTD_BUILD_VERSION" "https://readthedocs.org/build/$RTD_PROJECT" - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 15 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/gerrit-rtd-rtd-verify-master b/.jjb-test/expected-xml/gerrit-rtd-rtd-verify-master deleted file mode 100644 index b800fefc..00000000 --- a/.jjb-test/expected-xml/gerrit-rtd-rtd-verify-master +++ /dev/null @@ -1,532 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - - 7 - -1 - -1 - 0 - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - - - - 2 - - - origin - - $GIT_URL/$PROJECT - test-credential - - - - - refs/heads/$GERRIT_BRANCH - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - ANT - ** - - - ANT - **/master - - - - - ANT - **/*.rst - - - ANT - **/conf.py - - - false - - - - false - false - false - false - - false - false - true - false - false - - - False - - false - - - true - false - false - - - - recheck$ - - - - - - - - - - test-server - - - - - - DOC_DIR=docs/_build/html - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> tox-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox" -# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 -source "/tmp/v/tox/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade argparse detox tox tox-pyenv - -echo "----> Pip Dependency Tree" -pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> rtd-verify.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -echo "---> Fetching project" -if [ "$GERRIT_PROJECT" != "$PROJECT" ]; then - cd "docs/submodules/$GERRIT_PROJECT" -fi - -git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD - -echo "---> Generating docs" -cd "$WORKSPACE" -tox -edocs - -echo "---> Archiving generated docs" -mkdir -p "$WORKSPACE/archives" -mv "$DOC_DIR" archives/ - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 15 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-ciman-jjb-deploy-job b/.jjb-test/expected-xml/github-ciman-jjb-deploy-job deleted file mode 100644 index 984d3631..00000000 --- a/.jjb-test/expected-xml/github-ciman-jjb-deploy-job +++ /dev/null @@ -1,514 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - $GIT_URL/$GERRIT_PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - $sha1 - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^jjb-deploy (?!\*+$).+$ - - true - true - true - false - - - JJB Deploy Job - - - - - - - - PIP_PACKAGES=jenkins-job-builder - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -# pip install packages into a virtualenv using the first listed package as venv name -# -# PIP_PACKAGES is a space separated list of pypi packages to install. The first -# listed package is used as the virtualenv directory name. -echo "---> pip-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -# Install git-review using virtualenv to the latest version that supports -# --reviewers option, available through pip install. Existing minion image has a -# version that does not have it. -virtualenv "/tmp/v/${PIP_PACKAGES%% *}" -# shellcheck source=/tmp/v/venv/bin/activate disable=SC1091 -source "/tmp/v/${PIP_PACKAGES%% *}/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree - -# PIP_PACKAGES needs to be passed through as a space separated list of packages -# shellcheck disable=SC2086 -pip install --upgrade $PIP_PACKAGES - -echo "----> Pip Dependency Tree" -pipdeptree - - - - - - jjbini-sandbox - $HOME/.config/jenkins_jobs/jenkins_jobs.ini - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -# Push a job to jenkins-sandbox via Gerrit / GitHub comment -# Comment Pattern: jjb-deploy JOB_NAME -# JOB_NAME: Can also include * wildcards too. Additional parameters are ignored. -echo "---> jjb-deploy-job.sh" - -# Ensure we fail the job if any steps fail. -set -e -o pipefail - -# shellcheck source=/tmp/v/jenkins-job-builder/bin/activate disable=SC1091 -source "/tmp/v/jenkins-job-builder/bin/activate" - -echo "-----> Fetching project" -git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD - -# If not Gerrit Trigger than assume GitHub -COMMENT="${GERRIT_EVENT_COMMENT_TEXT:-$ghprbCommentBody}" -JOB_NAME=$(echo "$COMMENT" | grep jjb-deploy | awk '{print $2}') - -# Strip all * characters to prevent pushing all jobs to Jenkins -if [ -z "${JOB_NAME//\*/}" ]; then - echo "ERROR: JOB_NAME cannot be empty or '*'." - exit 1 -fi - -jenkins-jobs update --recursive --workers 4 jjb/ "$JOB_NAME" - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 5 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-ciman-jjb-merge b/.jjb-test/expected-xml/github-ciman-jjb-merge deleted file mode 100644 index 9e899d3c..00000000 --- a/.jjb-test/expected-xml/github-ciman-jjb-merge +++ /dev/null @@ -1,492 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - https://github.com/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - JJB_VERSION - Jenkins Job Builder version to download and install. - 1.6.2 - - - - - - 2 - - - origin - - git@github.com:example-org/releng/ciman - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - - false - - - - tykeal - false - jpwku -tykeal -zxiiro - example-org - - - - ^remerge$ - - true - true - false - false - - - JJB Merge - - - - - - - - - jjbini - $HOME/.config/jenkins_jobs/jenkins_jobs.ini - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> jjb-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv "/tmp/v/jjb" -# shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091 -source "/tmp/v/jjb/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION" - -echo "----> Pip Dependency Tree" -pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> jjb-merge-job.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -jenkins-jobs update --recursive --delete-old --workers 4 jjb/ - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-ciman-jjb-verify b/.jjb-test/expected-xml/github-ciman-jjb-verify deleted file mode 100644 index 63cf4bdc..00000000 --- a/.jjb-test/expected-xml/github-ciman-jjb-verify +++ /dev/null @@ -1,571 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - https://github.com/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - JJB_VERSION - Jenkins Job Builder version to download and install. - 1.6.2 - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - $sha1 - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^recheck$ - - false - true - true - false - - - JJB Verify - - - - - - - - - jjbini - $HOME/.config/jenkins_jobs/jenkins_jobs.ini - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script will make sure that there are no JIRA URLs in the commit -# message. JIRA URLs will break the its-jira plugin - -# Ensure we fail the job if any steps fail. -# Do not treat undefined variables as errors as in this case we are allowed -# to have JIRA_URL undefined -set -e -o pipefail -set +u - -if [ -n "${JIRA_URL}" ]; -then - BASE_URL=$(echo $JIRA_URL | awk -F'/' '{print $3}') - JIRA_LINK=$(git rev-list --format=%B --max-count=1 HEAD | grep -io "http[s]*://$BASE_URL/" || true) - if [[ ! -z "$JIRA_LINK" ]] - then - echo 'Remove JIRA URLs from commit message' - echo 'Add jira references as: Issue: <JIRAKEY>-<ISSUE#>, instead of URLs' - exit 1 - fi -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> jjb-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv "/tmp/v/jjb" -# shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091 -source "/tmp/v/jjb/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION" - -echo "----> Pip Dependency Tree" -pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> jjb-verify-job.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -jenkins-jobs -l DEBUG test --recursive -o archives/job-configs jjb/ - -# Sort job output into sub-directories. On large Jenkins systems that have -# many jobs archiving so many files into the same directory makes NGINX return -# the directory list slow. -pushd archives/job-configs -for letter in {a..z} -do - if [[ $(ls "$letter"* > /dev/null 2>&1) -eq 0 ]] - then - mkdir "$letter" - find . -maxdepth 1 -type f -name "$letter*" -exec mv {} "$letter" \; - fi -done -popd - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2015 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 -############################################################################## -echo "---> jjb-check-unicode.sh" - -if LC_ALL=C grep -I -r '[^[:print:][:space:]]' jjb/; then - echo "Found files containing non-ascii characters." - exit 1 -fi - -echo "All files are ASCII only" - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2016 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 -############################################################################## -echo "---> gpg-verify-git-signature.sh" - -if git log --show-signature -1 | grep -E -q 'gpg: Signature made.*key ID'; then - echo "Git commit is GPG signed." -else - echo "WARNING: GPG signature missing for the commit." -fi - -# Do NOT fail the job for unsigned commits -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-ciman-packer-merge-centos-java-builder b/.jjb-test/expected-xml/github-ciman-packer-merge-centos-java-builder deleted file mode 100644 index 29ded269..00000000 --- a/.jjb-test/expected-xml/github-ciman-packer-merge-centos-java-builder +++ /dev/null @@ -1,676 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - https://github.com/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - - git@github.com:example-org/releng/ciman - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - 00 10 1 * * - - - - - - - false - - - - tykeal - false - jpwku -tykeal -zxiiro - example-org - - - - ^remerge$ - - true - true - false - false - - - Packer centos-$java-builder Merge - - - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_PLATFORM=centos -PACKER_TEMPLATE=java-builder -PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-build.sh" -# The script builds an image using packer -# $CLOUDENV : Provides the cloud credential file. -# $PACKER_PLATFORM : Provides the packer platform. -# $PACKER_TEMPLATE : Provides the packer temnplate. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -# Prioritize the project's own version of vars if available -platform_file="common-packer/vars/$PACKER_PLATFORM.json" -if [ -f "$PACKER_PLATFORM" ]; then - platform_file="vars/$PACKER_PLATFORM.json" -fi - -cd packer -export PACKER_LOG="yes" -export PACKER_LOG_PATH="$PACKER_BUILD_LOG" -packer.io build -color=false \ - -var-file="$CLOUDENV" \ - -var-file="$platform_file" \ - "templates/$PACKER_TEMPLATE.json" - -# Retrive the list of cloud providers -mapfile -t clouds < <(jq -r '.builders[].name' "templates/$PACKER_TEMPLATE.json") - -# Split public/private clouds logs -for cloud in "${clouds[@]}"; do - grep -e "$cloud" "$PACKER_BUILD_LOG" > "$PACKER_LOGS_DIR/packer-build_$cloud.log" 2>&1 -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 90 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-ciman-packer-merge-centos-mininet b/.jjb-test/expected-xml/github-ciman-packer-merge-centos-mininet deleted file mode 100644 index a6da5f95..00000000 --- a/.jjb-test/expected-xml/github-ciman-packer-merge-centos-mininet +++ /dev/null @@ -1,676 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - https://github.com/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - - git@github.com:example-org/releng/ciman - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - 00 10 1 * * - - - - - - - false - - - - tykeal - false - jpwku -tykeal -zxiiro - example-org - - - - ^remerge$ - - true - true - false - false - - - Packer centos-$mininet Merge - - - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_PLATFORM=centos -PACKER_TEMPLATE=mininet -PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-build.sh" -# The script builds an image using packer -# $CLOUDENV : Provides the cloud credential file. -# $PACKER_PLATFORM : Provides the packer platform. -# $PACKER_TEMPLATE : Provides the packer temnplate. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -# Prioritize the project's own version of vars if available -platform_file="common-packer/vars/$PACKER_PLATFORM.json" -if [ -f "$PACKER_PLATFORM" ]; then - platform_file="vars/$PACKER_PLATFORM.json" -fi - -cd packer -export PACKER_LOG="yes" -export PACKER_LOG_PATH="$PACKER_BUILD_LOG" -packer.io build -color=false \ - -var-file="$CLOUDENV" \ - -var-file="$platform_file" \ - "templates/$PACKER_TEMPLATE.json" - -# Retrive the list of cloud providers -mapfile -t clouds < <(jq -r '.builders[].name' "templates/$PACKER_TEMPLATE.json") - -# Split public/private clouds logs -for cloud in "${clouds[@]}"; do - grep -e "$cloud" "$PACKER_BUILD_LOG" > "$PACKER_LOGS_DIR/packer-build_$cloud.log" 2>&1 -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 90 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-java-builder b/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-java-builder deleted file mode 100644 index 12f74aab..00000000 --- a/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-java-builder +++ /dev/null @@ -1,676 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - https://github.com/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - - git@github.com:example-org/releng/ciman - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - 00 10 1 * * - - - - - - - false - - - - tykeal - false - jpwku -tykeal -zxiiro - example-org - - - - ^remerge$ - - true - true - false - false - - - Packer ubuntu1604-$java-builder Merge - - - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_PLATFORM=ubuntu1604 -PACKER_TEMPLATE=java-builder -PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-build.sh" -# The script builds an image using packer -# $CLOUDENV : Provides the cloud credential file. -# $PACKER_PLATFORM : Provides the packer platform. -# $PACKER_TEMPLATE : Provides the packer temnplate. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -# Prioritize the project's own version of vars if available -platform_file="common-packer/vars/$PACKER_PLATFORM.json" -if [ -f "$PACKER_PLATFORM" ]; then - platform_file="vars/$PACKER_PLATFORM.json" -fi - -cd packer -export PACKER_LOG="yes" -export PACKER_LOG_PATH="$PACKER_BUILD_LOG" -packer.io build -color=false \ - -var-file="$CLOUDENV" \ - -var-file="$platform_file" \ - "templates/$PACKER_TEMPLATE.json" - -# Retrive the list of cloud providers -mapfile -t clouds < <(jq -r '.builders[].name' "templates/$PACKER_TEMPLATE.json") - -# Split public/private clouds logs -for cloud in "${clouds[@]}"; do - grep -e "$cloud" "$PACKER_BUILD_LOG" > "$PACKER_LOGS_DIR/packer-build_$cloud.log" 2>&1 -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 90 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-mininet b/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-mininet deleted file mode 100644 index 8bf29131..00000000 --- a/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-mininet +++ /dev/null @@ -1,676 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - https://github.com/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - - git@github.com:example-org/releng/ciman - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - 00 10 1 * * - - - - - - - false - - - - tykeal - false - jpwku -tykeal -zxiiro - example-org - - - - ^remerge$ - - true - true - false - false - - - Packer ubuntu1604-$mininet Merge - - - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_PLATFORM=ubuntu1604 -PACKER_TEMPLATE=mininet -PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-build.sh" -# The script builds an image using packer -# $CLOUDENV : Provides the cloud credential file. -# $PACKER_PLATFORM : Provides the packer platform. -# $PACKER_TEMPLATE : Provides the packer temnplate. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -# Prioritize the project's own version of vars if available -platform_file="common-packer/vars/$PACKER_PLATFORM.json" -if [ -f "$PACKER_PLATFORM" ]; then - platform_file="vars/$PACKER_PLATFORM.json" -fi - -cd packer -export PACKER_LOG="yes" -export PACKER_LOG_PATH="$PACKER_BUILD_LOG" -packer.io build -color=false \ - -var-file="$CLOUDENV" \ - -var-file="$platform_file" \ - "templates/$PACKER_TEMPLATE.json" - -# Retrive the list of cloud providers -mapfile -t clouds < <(jq -r '.builders[].name' "templates/$PACKER_TEMPLATE.json") - -# Split public/private clouds logs -for cloud in "${clouds[@]}"; do - grep -e "$cloud" "$PACKER_BUILD_LOG" > "$PACKER_LOGS_DIR/packer-build_$cloud.log" 2>&1 -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 90 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-ciman-packer-verify b/.jjb-test/expected-xml/github-ciman-packer-verify deleted file mode 100644 index 67b3ab64..00000000 --- a/.jjb-test/expected-xml/github-ciman-packer-verify +++ /dev/null @@ -1,546 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - https://github.com/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - PACKER_VERSION - Packer version to download and install. - 1.1.3 - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - $sha1 - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^recheck$ - - false - true - true - false - - - Packer Verify - - - - - - - - - ci-packer-cloud-env - - CLOUDENV - - - - - - PACKER_VERSION=1.1.3 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-install.sh" -# The script checks for the packer binaries and installs the binary -# if its not available - -# $PACKER_VERSION : Define a packer version passed as job paramter - -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -if hash packer.io 2>/dev/null; then - echo "packer.io command is available." -else - echo "packer.io command not is available. Installing packer ..." - # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd "${WORKSPACE}" - wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" - mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" - # rename packer to avoid conflict with binary in cracklib - mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" - popd -fi - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-validate.sh" -# The script validates an packers files. - -# $CLOUDENV : Provides the cloud credential file. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -PACKER_LOGS_DIR="$WORKSPACE/archives/packer" -mkdir -p "$PACKER_LOGS_DIR" -export PATH="${WORKSPACE}/bin:$PATH" - -cd packer -varfiles=(vars/*.json common-packer/vars/*.json) -templates=(templates/*.json) - -for varfile in "${varfiles[@]}"; do - # cloud-env.json is a file containing credentials which is pulled in via - # CLOUDENV variable so skip it here. Also handle the case where a project - # has not vars/*.json file. - if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then - continue - fi - - echo "-----> Testing varfile: $varfile" - for template in "${templates[@]}"; do - export PACKER_LOG="yes" - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" - if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then - echo "$template: $output" - else - echo "$template: $output" - exit 1 - fi - done -done - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> packer-clear-credentials.sh" - -set +e # DO NOT cause build failure if any of the rm calls fail. -rm "$CLOUDENV" -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-maven-maven-clm-master b/.jjb-test/expected-xml/github-maven-maven-clm-master deleted file mode 100644 index 1fa9c11f..00000000 --- a/.jjb-test/expected-xml/github-maven-maven-clm-master +++ /dev/null @@ -1,573 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - $GIT_URL/$PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - - git@github.com:example-org/releng/ciman - test-credential - - - - - refs/heads/master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^run-clm$ - - false - true - true - false - - - CLM - - - - - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - aproject-settings - - SETTINGS_FILE - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - find . -regex ".*karaf/target" | xargs rm -rf - - - - list - github-maven - - - - - - - false - build - - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-maven-maven-javadoc-publish-master b/.jjb-test/expected-xml/github-maven-maven-javadoc-publish-master deleted file mode 100644 index cceb368e..00000000 --- a/.jjb-test/expected-xml/github-maven-maven-javadoc-publish-master +++ /dev/null @@ -1,722 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - $GIT_URL/$PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - - git@github.com:example-org/releng/ciman - test-credential - - - - - master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - - false - - - - tykeal - false - jpwku -tykeal -zxiiro - example-org - - - - ^remerge$ - - true - true - false - false - - - JJB Merge - - - - - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - aproject-settings - - SETTINGS_FILE - - - - - - SERVER_ID=project-site - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - - DEPLOY_PATH=org.example.project/$STREAM - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Generates javadoc in a Maven project. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -JAVADOC_DIR="$WORKSPACE/archives/javadoc" -mkdir -p "$WORKSPACE/archives" - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean install javadoc:aggregate \ - -Pq -Dmaven.javadoc.skip=false \ - -DskipTests=true \ - -Dcheckstyle.skip=true \ - -Dfindbugs.skip=true \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -mv "$WORKSPACE/target/site/apidocs" "$JAVADOC_DIR" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Publishes javadoc to a Maven project. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -JAVADOC_DIR="$WORKSPACE/archives/javadoc" - -pushd "$JAVADOC_DIR" -zip -r "$WORKSPACE/javadoc.zip" . -popd - -lftools deploy nexus-zip "$NEXUS_URL" "javadoc" "$DEPLOY_PATH" "$WORKSPACE/javadoc.zip" - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-maven-maven-javadoc-verify-master b/.jjb-test/expected-xml/github-maven-maven-javadoc-verify-master deleted file mode 100644 index d9b3d895..00000000 --- a/.jjb-test/expected-xml/github-maven-maven-javadoc-verify-master +++ /dev/null @@ -1,562 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - $GIT_URL/$PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - $sha1 - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^recheck$ - - true - true - true - false - - - Maven Javadoc - - - - - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - aproject-settings - - SETTINGS_FILE - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Generates javadoc in a Maven project. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -JAVADOC_DIR="$WORKSPACE/archives/javadoc" -mkdir -p "$WORKSPACE/archives" - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean install javadoc:aggregate \ - -Pq -Dmaven.javadoc.skip=false \ - -DskipTests=true \ - -Dcheckstyle.skip=true \ - -Dfindbugs.skip=true \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -mv "$WORKSPACE/target/site/apidocs" "$JAVADOC_DIR" - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-maven-maven-merge-master b/.jjb-test/expected-xml/github-maven-maven-merge-master deleted file mode 100644 index 5fafbace..00000000 --- a/.jjb-test/expected-xml/github-maven-maven-merge-master +++ /dev/null @@ -1,814 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - $GIT_URL/$PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - -Dmerge - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^remerge$ - - false - true - true - false - - - Maven Merge - - - - - - - mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - aproject-settings - - SETTINGS_FILE - - - - - - SERVER_ID=fakeproject-snapshots - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - - NEXUS_CUT_DIRS=6 -NEXUS_REPO=fakeproject-snapshots - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Uses wget to fetch a project's maven-metadata.xml files from a Maven repository. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -project=$(xmlstarlet sel \ - -N "x=http://maven.apache.org/POM/4.0.0" -t \ - --if "/x:project/x:groupId" \ - -v "/x:project/x:groupId" \ - --elif "/x:project/x:parent/x:groupId" \ - -v "/x:project/x:parent/x:groupId" \ - --else -o "" pom.xml) -project_path="${project//.//}" - -mkdir -p "$WORKSPACE/m2repo/$project_path" -pushd "$WORKSPACE/m2repo/$project_path" - # Temporarily disable failing for wget - # If 404 happens we don't care because it might be a new project. - set +e - wget -nv --recursive \ - --accept maven-metadata.xml \ - -R "index.html*" \ - --execute robots=off \ - --no-parent \ - --no-host-directories \ - --cut-dirs="$NEXUS_CUT_DIRS" \ - "$NEXUS_URL/content/repositories/$NEXUS_REPO/$project_path/" - set -e # Re-enable. -popd - -# Backup metadata - Used later to find metadata files that have not been modified -mkdir -p "$WORKSPACE/m2repo-backup" -cp -a "$WORKSPACE/m2repo/"* "$WORKSPACE/m2repo-backup" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean deploy \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -# Upload the snapshot files to a snapshot repo. -# -# Requires the existance of $WORKSPACE/m2repo and $WORKSPACE/m2repo-backup to -# compare if maven metadata files have changed. Unchanged files are then -# removed from $WORKSPACE/m2repo before uploading to the snapshot repo. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -m2repo_dir="$WORKSPACE/m2repo" -nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO" - -# Remove metadata files that were not updated. -set +e # Temporarily disable to run diff command. -IFS=" " read -r -a metadata_files <<< "$(diff -s -r "$m2repo_dir" "$WORKSPACE/m2repo-backup" \ - | grep 'Files .* and .* are identical' \ - | awk '{print $2}')" -set -e # Re-enable. - -set +u # $metadata_files could be unbound if project is new. -if [ -n "${metadata_files[*]}" ]; then - for i in "${metadata_files[@]}"; do - rm "$i"* - done -fi -set -u # Re-enable. - -find "$m2repo_dir" -type d -empty -delete - -lftools deploy nexus -s "$nexus_repo_url" "$m2repo_dir" - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - false - - - - - low - [FINDBUGS] - - false - false - false - false - - - - - - - - - - - false - true - false - - - - **/**.exec - **/classes - **/src/main/java - false - - **/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/** - 10 - 20 - 50 - 40 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-maven-maven-release-master b/.jjb-test/expected-xml/github-maven-maven-release-master deleted file mode 100644 index 42487ad8..00000000 --- a/.jjb-test/expected-xml/github-maven-maven-release-master +++ /dev/null @@ -1,740 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - $GIT_URL/$PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - master - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - - - - false - - - - - - ^build release$ - - true - true - true - false - - - Maven Release - - - - - - - mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - aproject-settings - - SETTINGS_FILE - - - - - - SERVER_ID=project-staging - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script removes the -SNAPSHOT from a project to prepare it for release. - -PATCH_DIR="$WORKSPACE/archives/patches" -mkdir -p "$PATCH_DIR" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -echo "$PROJECT" "$(git rev-parse --verify HEAD)" | tee -a "$PATCH_DIR/taglist.log" - -# Strip -SNAPSHOT from version to prepare release. -find . -name "*.xml" -print0 | xargs -0 sed -i 's/-SNAPSHOT//g' - -git commit -am "Release $PROJECT" -git format-patch --stdout "origin/$GERRIT_BRANCH" > "$PATCH_DIR/${PROJECT//\//-}.patch" -git bundle create "$PATCH_DIR/${PROJECT//\//-}.bundle" "origin/${GERRIT_BRANCH}..HEAD" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean deploy \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script publishes artifacts to a staging repo in Nexus. -# -# $WORKSPACE/m2repo : Exists and used to deploy the staging repository. -# $NEXUS_URL : Jenkins global variable should be defined. -# $STAGING_PROFILE_ID : Provided by a job parameter. - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -TMP_FILE="$(mktemp)" -lftools deploy nexus-stage "$NEXUS_URL" "$STAGING_PROFILE_ID" "$WORKSPACE/m2repo" | tee "$TMP_FILE" -staging_repo=$(sed -n -e 's/Staging repository \(.*\) created\./\1/p' "$TMP_FILE") - -# Store repo info to a file in archives -mkdir -p "$WORKSPACE/archives" -echo "$staging_repo" > "$WORKSPACE/archives/staging-repo.txt" - -# Cleanup -rm "$TMP_FILE" - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-maven-maven-verify-master-mvn33-openjdk8 b/.jjb-test/expected-xml/github-maven-maven-verify-master-mvn33-openjdk8 deleted file mode 100644 index 33d083fb..00000000 --- a/.jjb-test/expected-xml/github-maven-maven-verify-master-mvn33-openjdk8 +++ /dev/null @@ -1,684 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - $GIT_URL/$PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - -Dstream=$STREAM - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - uuddlrlrba - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - $sha1 - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^recheck$ - - false - true - true - false - - - Maven Verify - - - - - - - mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - aproject-settings - - SETTINGS_FILE - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean deploy \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - false - - - - - low - [FINDBUGS] - - false - false - false - false - - - - - - - - - - - false - true - false - - - - **/**.exec - **/classes - **/src/main/java - false - - **/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/** - 10 - 20 - 50 - 40 - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 60 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-maven-sonar b/.jjb-test/expected-xml/github-maven-sonar deleted file mode 100644 index c0c8c2a9..00000000 --- a/.jjb-test/expected-xml/github-maven-sonar +++ /dev/null @@ -1,618 +0,0 @@ - - - openjdk8 - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - $GIT_URL/$PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - M2_HOME - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33 - - - MAVEN_OPTS - Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m - - - - - MAVEN_PARAMS - Maven parameters to pass to the mvn command. - - - - - MVN - Maven selector to be used by shell scripts - /w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn - - - STAGING_PROFILE_ID - Nexus staging profile ID. - - - - - ARCHIVE_ARTIFACTS - Artifacts to archive to the logs server. - - - - SONAR_MAVEN_GOAL - Maven goals to pass to the Sonar call. Typically sonar:sonar -however to use a specific version of the sonar-maven-plugin we -can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar". - - sonar:sonar - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - $sha1 - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^recheck$ - - false - true - true - false - - - Maven Verify - - - - - - - echo "quiet=on" > "$HOME/.wgetrc" - - - --version - - mvn33 - false - - - - - rm "$HOME/.wgetrc" - - - - SONAR_HOST_URL=$SONAR_URL - - - - - - global-settings - - GLOBAL_SETTINGS_FILE - - - aproject-settings - - SETTINGS_FILE - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This file contains a list of variables that are generally useful in many -# scripts. It is meant to be sourced in other scripts so that the variables can -# be called. - -MAVEN_OPTIONS="$(echo --show-version \ - --batch-mode \ - -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" -echo "$MAVEN_OPTIONS" - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# This script builds a Maven project and deploys it into a staging repo which -# can be used to deploy elsewhere later eg. Nexus staging / snapshot repos. - -# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. -# Ensure we fail the job if any steps fail. -set -e -o pipefail -set +u - -export MAVEN_OPTS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN clean deploy \ - -Dsonar \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - -# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. -# shellcheck disable=SC2086 -$MVN $SONAR_MAVEN_GOAL \ - -Dsonar -Dsonar.host.url="$SONAR_HOST_URL" \ - --global-settings "$GLOBAL_SETTINGS_FILE" \ - --settings "$SETTINGS_FILE" \ - -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \ - $MAVEN_OPTIONS $MAVEN_PARAMS - - - - #!/bin/bash -set +e # DO NOT cause build failure if any of the rm calls fail. - -rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" - -# In some cases we use the lf-provide-maven-settings macro to produce -# a "$HOME/.netrc" file containing credentials. Remove that file here -# too if it exists. -rm "$HOME/.netrc" - -# DO NOT fail build if any of the above lines fail. -exit 0 - - - - - - **/**.exec - **/classes - **/src/main/java - false - - **/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/** - 10 - 20 - 50 - 40 - - - false - - - - - low - [FINDBUGS] - - false - false - false - false - - - - - - - - - - - false - true - false - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 30 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-node-node-verify-master b/.jjb-test/expected-xml/github-node-node-verify-master deleted file mode 100644 index 02d3563e..00000000 --- a/.jjb-test/expected-xml/github-node-node-verify-master +++ /dev/null @@ -1,485 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - $GIT_URL/$GERRIT_PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - NODE_DIR - Path to a Node project directory. - - - - NODE_VERSION - Version of NodeJS to install. - 6.11.4 - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - $sha1 - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^recheck$ - - false - true - true - false - - - Node Verify - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> node-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/python" -# shellcheck source=/tmp/v/node/bin/activate disable=SC1091 -source "/tmp/v/python/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade nodeenv - -echo "----> Pip Dependency Tree" -pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> node-run.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -# Prepare node -nodeenv --node="$NODE_VERSION" --prebuilt "/tmp/v/node" -source /tmp/v/node/bin/activate -cd "$WORKSPACE/$NODE_DIR" -npm install -npm test - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-python-tox-verify-master b/.jjb-test/expected-xml/github-python-tox-verify-master deleted file mode 100644 index cbdff165..00000000 --- a/.jjb-test/expected-xml/github-python-tox-verify-master +++ /dev/null @@ -1,610 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - $GIT_URL/$GERRIT_PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - TOX_DIR - Path to directory containing tox.ini file. - - - - - TOX_ENVS - Tox environments to run build against. -Example: docs,py2,py3 - - - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - $sha1 - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^recheck$ - - false - true - true - false - - - JJB Verify - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - - - - - PYTHON_VERSION=python3 - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> tox-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox" -# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 -source "/tmp/v/tox/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade argparse detox tox tox-pyenv - -echo "----> Pip Dependency Tree" -pipdeptree - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> tox-run.sh" - -# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 -source "/tmp/v/tox/bin/activate" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -ARCHIVE_TOX_DIR="$WORKSPACE/archives/tox" -mkdir -p "$ARCHIVE_TOX_DIR" -cd "$WORKSPACE/$TOX_DIR" - -if [ -d "/opt/pyenv" ]; then - echo "---> Setting up pyenv" - export PYENV_ROOT="/opt/pyenv" - export PATH="$PYENV_ROOT/bin:$PATH" -fi - -set +e # Allow detox to fail so that we can collect the logs in the next step -if [ ! -z "$TOX_ENVS" ]; then - detox -e "$TOX_ENVS" | tee -a "$ARCHIVE_TOX_DIR/detox.log" - detox_status="${PIPESTATUS[0]}" -else - detox | tee -a "$ARCHIVE_TOX_DIR/detox.log" - detox_status="${PIPESTATUS[0]}" -fi - -# Disable SC2116 as we want to echo a space separated list of TOX_ENVS -# shellcheck disable=SC2116 -for i in .tox/*/log; do - tox_env=$(echo $i | awk -F'/' '{print $2}') - cp -r "$i" "$ARCHIVE_TOX_DIR/$tox_env" -done -set -e # Logs collected so re-enable - -echo "Completed tox runs." - -test "$detox_status" -eq 0 || exit "$detox_status" - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 10 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-rtd-rtd-merge-master b/.jjb-test/expected-xml/github-rtd-rtd-merge-master deleted file mode 100644 index 943ab357..00000000 --- a/.jjb-test/expected-xml/github-rtd-rtd-merge-master +++ /dev/null @@ -1,418 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - false - build-vm - false - - - https://github.com/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - - - - - - - - false - - - - - - ^remerge$ - - false - true - true - false - - - RTD Merge - - - - - H H * * * - - - - - - RTD_PROJECT=github-rtd - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> rtd-trigger-build.sh" - -if [ "$GERRIT_BRANCH" == "master" ]; then - RTD_BUILD_VERSION=latest -else - RTD_BUILD_VERSION="${GERRIT_BRANCH/\//-}" -fi - -curl -X POST --data "version_slug=$RTD_BUILD_VERSION" "https://readthedocs.org/build/$RTD_PROJECT" - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 15 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/.jjb-test/expected-xml/github-rtd-rtd-verify-master b/.jjb-test/expected-xml/github-rtd-rtd-verify-master deleted file mode 100644 index bc03947e..00000000 --- a/.jjb-test/expected-xml/github-rtd-rtd-verify-master +++ /dev/null @@ -1,488 +0,0 @@ - - - - <!-- Managed by Jenkins Job Builder --> - false - false - false - true - build-vm - false - - - $GIT_URL/$PROJECT/example-org/releng/ciman - - - - - - PROJECT - Parameter to identify a Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - - releng/ciman - - - STREAM - Stream is often set to the same name as 'branch' but can -sometimes be used as a name representing a project's release code -name. - - master - - - GERRIT_PROJECT - Parameter to identify Gerrit project. This is typically the -project repo path as exists in Gerrit. -For example: ofextensions/circuitsw - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - releng/ciman - - - GERRIT_BRANCH - Parameter to identify a Gerrit branch. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - master - - - GERRIT_REFSPEC - Parameter to identify a refspec when pulling from Gerrit. - -Note that Gerrit will override this parameter automatically if a -job is triggered by Gerrit. - - refs/heads/master - - - LFTOOLS_VERSION - Version of lftools to install. Can be a specific version like -'0.6.0' or a PEP-440 definition. -https://www.python.org/dev/peps/pep-0440/ -For example '<1.0.0' or '>=1.0.0,<2.0.0'. - - <1.0.0 - - - - - - 2 - - - origin - +refs/pull/*:refs/remotes/origin/pr/* - git@github.com:example-org/releng/ciman - test-credential - - - - - $sha1 - - - false - false - Default - - - - - - - - - - false - true - false - false - - 10 - - - - - - - - - false - - - - - - ^recheck$ - - false - true - true - false - - - RTD Verify - - - - - - - - DOC_DIR=docs/_build/html - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> tox-install.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox" -# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 -source "/tmp/v/tox/bin/activate" -pip install --quiet --upgrade pip -pip install --quiet --upgrade pipdeptree -pip install --quiet --upgrade argparse detox tox tox-pyenv - -echo "----> Pip Dependency Tree" -pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> rtd-verify.sh" - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -echo "---> Fetching project" -if [ "$GERRIT_PROJECT" != "$PROJECT" ]; then - cd "docs/submodules/$GERRIT_PROJECT" -fi - -git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD - -echo "---> Generating docs" -cd "$WORKSPACE" -tox -edocs - -echo "---> Archiving generated docs" -mkdir -p "$WORKSPACE/archives" -mv "$DOC_DIR" archives/ - - - - - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> sysstat.sh" -set +e # DON'T fail build if script fails. - -OS=$(facter operatingsystem) -case "$OS" in - Ubuntu) - SYSSTAT_PATH="/var/log/sysstat" - - # Dont run the script when systat is not enabled by default - if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then - exit 0 - fi - ;; - CentOS|RedHat) - SYSSTAT_PATH="/var/log/sa" - ;; - *) - # nothing to do - exit 0 - ;; -esac - -SAR_DIR="$WORKSPACE/archives/sar-reports" -mkdir -p "$SAR_DIR" -cp "$SYSSTAT_PATH/"* "$_" -# convert sar data to ascii format -while IFS="" read -r sarfilenum -do - [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" -done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) - -# DON'T fail build if script fails. -exit 0 - - - - - - jenkins-log-archives-settings - - SETTINGS_FILE - - - - - - SERVER_ID=logs - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> create-netrc.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" -CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ - -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \ - -v x:username -o ":" -v x:password \ - "$SETTINGS_FILE") - -machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') -user=$(echo "$CREDENTIAL" | cut -f1 -d:) -pass=$(echo "$CREDENTIAL" | cut -f2 -d:) - -echo "machine ${machine%:*} login $user password $pass" > ~/.netrc - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> lftools-install.sh" - -# Script to install lftools via a version passed in via lf-infra-parameters -# -# Required parameters: -# -# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be -# set to a strict version number like '1.2.3' or using -# PEP-440 definitions. -# -# Examples: -# <1.0.0 -# >=1.0.0,<2.0.0 -# -# By default a released version of lftools should always be used. -# The purpose of the 2 variables below is so that lftools devs can test -# unreleased versions of lftools. There are 2 methods to install a dev version -# of lftools: -# -# 1) gerrit patch: Used to test a patch that has not yet been merged. -# To do this set something like this: -# LFTOOLS_MODE=gerrit -# LFTOOLS_REFSPEC=refs/changes/96/5296/7 -# -# 2) git branch: Used to install an lftools version from a specific branch. -# To use this set the variables as follows: -# LFTOOLS_MODE=git -# LFTOOLS_REFSPEC=master -# -# 3) release : The intended use case and default setting. -# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. - -LFTOOLS_MODE=release # release | git | gerrit -LFTOOLS_REFSPEC=master - -# Ensure we fail the job if any steps fail. -# DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail - -virtualenv --quiet "/tmp/v/lftools" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip - -case $LFTOOLS_MODE in - gerrit) - git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools - pushd /tmp/lftools - git fetch origin "$LFTOOLS_REFSPEC" - git checkout FETCH_HEAD - pip install --quiet --upgrade -r requirements.txt - pip install --quiet --upgrade -e . - popd - ;; - - git) - pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" - ;; - - release) - if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then - LFTOOLS_VERSION="==$LFTOOLS_VERSION" - fi - - pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" - ;; -esac - -lftools --version - -# pipdeptree prints out a lot of information because lftools pulls in many -# dependencies. Let's only print it if we want to debug. -# echo "----> Pip Dependency Tree" -# pip install --quiet --upgrade pipdeptree -# pipdeptree - -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## -echo "---> logs-deploy.sh" - -# Ensure we fail the job if any steps fail. -set -eu -o pipefail - -set -x # Trace commands for this script to make debugging easier. - -ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}" -LOGS_SERVER="${LOGS_SERVER:-None}" - -if [ "${LOGS_SERVER}" == 'None' ] -then - set +x # Disable trace since we no longer need it - - echo "WARNING: Logging server not set" -else - NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" - NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" - BUILD_URL="${BUILD_URL}" - - lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE" - lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL" - - set +x # Disable trace since we no longer need it. - - echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>" -fi - - - - #!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -# Clear log credential files -rm "$SETTINGS_FILE" -rm ~/.netrc - - - - ^Build logs: .* - - - false - false - false - - - - - **/*.jenkins-trigger - EXCLUDE - - - false - false - - true - true - true - true - true - true - - - - - - 15 - BUILD_TIMEOUT - true - false - 0 - 3 - absolute - - - - test-credential - - - - - - npmrc - $HOME/.npmrc - - - - - - diff --git a/jjb-compare-xml.sh b/jjb-compare-xml.sh index d1ed43ca..e29c1fa3 100755 --- a/jjb-compare-xml.sh +++ b/jjb-compare-xml.sh @@ -9,15 +9,27 @@ # http://www.eclipse.org/legal/epl-v10.html ############################################################################## -# This script tests jjb templates by comparing the result with expected output. +# This script tests jjb templates by comparing the result with expected output +# from global-jjb's origin/master branch. test_dir=$(mktemp -d) script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -expected_xml_dir="$script_dir/.jjb-test/expected-xml" +expected_xml_dir="$(mktemp -d -t gjjb-XXXXXXXX)" echo "Script Directory: $script_dir" echo "Test Directory: $test_dir" +echo "Expected XML Directory: $expected_xml_dir" +git fetch origin +gittmp="$(mktemp -d)" +git worktree add --detach "$gittmp" origin/master +pushd "$gittmp" || exit +echo "Generating expected XML." +jenkins-jobs test --recursive -o "$expected_xml_dir" "$gittmp":.jjb-test > /dev/null 2>&1 +popd || exit +rm -r "$gittmp" + +echo "Generating test XML." jenkins-jobs test --recursive -o "$test_dir" "$script_dir":.jjb-test fail=false @@ -31,9 +43,9 @@ for xml in "$test_dir"/*; do done # Cleanup -rm -rf "$test_dir" +rm -rf "$test_dir" "$expected_xml_dir" if $fail; then - echo "Differences detected. Check above for jobs that have been changed." - exit 1 + echo "WARN: Differences detected. Check above for jobs that have been changed." + exit 0 fi diff --git a/tox.ini b/tox.ini index 34e762c8..ed345811 100644 --- a/tox.ini +++ b/tox.ini @@ -42,10 +42,3 @@ commands = [testenv:license] deps = lftools commands = lftools license check-dir -r '.+' shell - -[testenv:update-expected-xml] -deps = - jenkins-job-builder -commands = - jenkins-jobs test --recursive -o {toxinidir}/.jjb-test/expected-xml {toxinidir}/jjb:{toxinidir}/.jjb-test - -- 2.16.6