+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>1</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>false</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>(un)?lock branch$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>5</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>1</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>refs/heads/master</refspec>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>jjb-deploy (?!\*+$).+$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PIP_PACKAGES=jenkins-job-builder</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jjbini-sandbox</fileId>
- <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>5</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>JJB_VERSION</name>
- <description>Jenkins Job Builder version to download and install.</description>
- <defaultValue>1.6.2</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/*.sh</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/*.yaml</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/global-jjb</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>remerge$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jjbini</fileId>
- <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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/
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>JJB_VERSION</name>
- <description>Jenkins Job Builder version to download and install.</description>
- <defaultValue>1.6.2</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/*.sh</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/*.yaml</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/global-jjb</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <excludeDrafts>true</excludeDrafts>
- <excludeTrivialRebase>false</excludeTrivialRebase>
- <excludeNoCodeChange>false</excludeNoCodeChange>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>recheck$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jjbini</fileId>
- <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>00 10 1 * *</spec>
- </hudson.triggers.TimerTrigger>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/vars/centos.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/templates/java-builder.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/*.sh</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/java-builder.yaml</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/lib/**</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>remerge$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_PLATFORM=centos
-PACKER_TEMPLATE=java-builder
-PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>90</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>00 10 1 * *</spec>
- </hudson.triggers.TimerTrigger>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/vars/centos.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/templates/mininet.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/*.sh</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/mininet.yaml</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/lib/**</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>remerge$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_PLATFORM=centos
-PACKER_TEMPLATE=mininet
-PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>90</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>00 10 1 * *</spec>
- </hudson.triggers.TimerTrigger>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/vars/ubuntu1604.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/templates/java-builder.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/*.sh</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/java-builder.yaml</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/lib/**</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>remerge$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_PLATFORM=ubuntu1604
-PACKER_TEMPLATE=java-builder
-PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>90</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>00 10 1 * *</spec>
- </hudson.triggers.TimerTrigger>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/vars/ubuntu1604.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/templates/mininet.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/*.sh</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/mininet.yaml</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/lib/**</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>remerge$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_PLATFORM=ubuntu1604
-PACKER_TEMPLATE=mininet
-PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>90</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/vars/**.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/templates/**.json</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/**.sh</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>packer/provision/lib/**</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <excludeDrafts>true</excludeDrafts>
- <excludeTrivialRebase>false</excludeTrivialRebase>
- <excludeNoCodeChange>false</excludeNoCodeChange>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>recheck$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>30</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>H H * * 6</spec>
- </hudson.triggers.TimerTrigger>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>true</onSuccessful>
- <onFailed>true</onFailed>
- <onUnstable>true</onUnstable>
- <onNotBuilt>true</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>run-clm$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>gerrit-maven-project-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>find . -regex ".*karaf/target" | xargs rm -rf</command>
- </hudson.tasks.Shell>
- <com.sonatype.insight.ci.hudson.PreBuildScan plugin="sonatype-clm-ci">
- <applicationSelectType>
- <value>list</value>
- <applicationId>gerrit-maven</applicationId>
- </applicationSelectType>
- <pathConfig>
- <scanTargets/>
- <moduleExcludes/>
- <scanProperties/>
- </pathConfig>
- <failOnClmServerFailures>false</failOnClmServerFailures>
- <stageId>build</stageId>
- <username/>
- <password/>
- </com.sonatype.insight.ci.hudson.PreBuildScan>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>30</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>remerge$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>gerrit-maven-project-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=project-site</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>DEPLOY_PATH=org.example.project/$STREAM</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>30</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <excludeDrafts>true</excludeDrafts>
- <excludeTrivialRebase>false</excludeTrivialRebase>
- <excludeNoCodeChange>false</excludeNoCodeChange>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>recheck$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>gerrit-maven-project-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>30</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue>-Dmerge</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>H H * * 0</spec>
- </hudson.triggers.TimerTrigger>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>remerge$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>gerrit-maven-project-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=fakeproject-snapshots</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>NEXUS_CUT_DIRS=6
-NEXUS_REPO=fakeproject-snapshots
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
- <isRankActivated>false</isRankActivated>
- <includePattern/>
- <excludePattern/>
- <healthy/>
- <unHealthy/>
- <thresholdLimit>low</thresholdLimit>
- <pluginName>[FINDBUGS] </pluginName>
- <defaultEncoding/>
- <canRunOnFailed>false</canRunOnFailed>
- <useStableBuildAsReference>false</useStableBuildAsReference>
- <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
- <useDeltaValues>false</useDeltaValues>
- <thresholds>
- <unstableTotalAll/>
- <unstableTotalHigh/>
- <unstableTotalNormal/>
- <unstableTotalLow/>
- <failedTotalAll/>
- <failedTotalHigh/>
- <failedTotalNormal/>
- <failedTotalLow/>
- </thresholds>
- <shouldDetectModules>false</shouldDetectModules>
- <dontComputeNew>true</dontComputeNew>
- <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
- <pattern/>
- </hudson.plugins.findbugs.FindBugsPublisher>
- <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
- <execPattern>**/**.exec</execPattern>
- <classPattern>**/classes</classPattern>
- <sourcePattern>**/src/main/java</sourcePattern>
- <changeBuildStatus>false</changeBuildStatus>
- <inclusionPattern/>
- <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
- <maximumBranchCoverage>10</maximumBranchCoverage>
- <minimumBranchCoverage>20</minimumBranchCoverage>
- <maximumMethodCoverage>50</maximumMethodCoverage>
- <minimumMethodCoverage>40</minimumMethodCoverage>
- </hudson.plugins.jacoco.JacocoPublisher>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- <hudson.plugins.parameterizedtrigger.BuildTrigger>
- <configs/>
- </hudson.plugins.parameterizedtrigger.BuildTrigger>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>30</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec/>
- </hudson.triggers.TimerTrigger>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>build release$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>gerrit-maven-project-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=project-staging</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue>-Dstream=$STREAM</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>recheck: [0-9 ]+</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>gerrit-maven-project-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <EnvInjectBuilder>
- <info>
- <propertiesFilePath>$WORKSPACE/.dependency.properties</propertiesFilePath>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
- <isRankActivated>false</isRankActivated>
- <includePattern/>
- <excludePattern/>
- <healthy/>
- <unHealthy/>
- <thresholdLimit>low</thresholdLimit>
- <pluginName>[FINDBUGS] </pluginName>
- <defaultEncoding/>
- <canRunOnFailed>false</canRunOnFailed>
- <useStableBuildAsReference>false</useStableBuildAsReference>
- <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
- <useDeltaValues>false</useDeltaValues>
- <thresholds>
- <unstableTotalAll/>
- <unstableTotalHigh/>
- <unstableTotalNormal/>
- <unstableTotalLow/>
- <failedTotalAll/>
- <failedTotalHigh/>
- <failedTotalNormal/>
- <failedTotalLow/>
- </thresholds>
- <shouldDetectModules>false</shouldDetectModules>
- <dontComputeNew>true</dontComputeNew>
- <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
- <pattern/>
- </hudson.plugins.findbugs.FindBugsPublisher>
- <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
- <execPattern>**/**.exec</execPattern>
- <classPattern>**/classes</classPattern>
- <sourcePattern>**/src/main/java</sourcePattern>
- <changeBuildStatus>false</changeBuildStatus>
- <inclusionPattern/>
- <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
- <maximumBranchCoverage>10</maximumBranchCoverage>
- <minimumBranchCoverage>20</minimumBranchCoverage>
- <maximumMethodCoverage>50</maximumMethodCoverage>
- <minimumMethodCoverage>40</minimumMethodCoverage>
- </hudson.plugins.jacoco.JacocoPublisher>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>60</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue>-Dstream=$STREAM</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <excludeDrafts>true</excludeDrafts>
- <excludeTrivialRebase>false</excludeTrivialRebase>
- <excludeNoCodeChange>false</excludeNoCodeChange>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>recheck$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>gerrit-maven-project-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
- <isRankActivated>false</isRankActivated>
- <includePattern/>
- <excludePattern/>
- <healthy/>
- <unHealthy/>
- <thresholdLimit>low</thresholdLimit>
- <pluginName>[FINDBUGS] </pluginName>
- <defaultEncoding/>
- <canRunOnFailed>false</canRunOnFailed>
- <useStableBuildAsReference>false</useStableBuildAsReference>
- <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
- <useDeltaValues>false</useDeltaValues>
- <thresholds>
- <unstableTotalAll/>
- <unstableTotalHigh/>
- <unstableTotalNormal/>
- <unstableTotalLow/>
- <failedTotalAll/>
- <failedTotalHigh/>
- <failedTotalNormal/>
- <failedTotalLow/>
- </thresholds>
- <shouldDetectModules>false</shouldDetectModules>
- <dontComputeNew>true</dontComputeNew>
- <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
- <pattern/>
- </hudson.plugins.findbugs.FindBugsPublisher>
- <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
- <execPattern>**/**.exec</execPattern>
- <classPattern>**/classes</classPattern>
- <sourcePattern>**/src/main/java</sourcePattern>
- <changeBuildStatus>false</changeBuildStatus>
- <inclusionPattern/>
- <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
- <maximumBranchCoverage>10</maximumBranchCoverage>
- <minimumBranchCoverage>20</minimumBranchCoverage>
- <maximumMethodCoverage>50</maximumMethodCoverage>
- <minimumMethodCoverage>40</minimumMethodCoverage>
- </hudson.plugins.jacoco.JacocoPublisher>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>60</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>SONAR_MAVEN_GOAL</name>
- <description>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".
-</description>
- <defaultValue>sonar:sonar</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>H H * * 6</spec>
- </hudson.triggers.TimerTrigger>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>true</onSuccessful>
- <onFailed>true</onFailed>
- <onUnstable>true</onUnstable>
- <onNotBuilt>true</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>run-sonar$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SONAR_HOST_URL=$SONAR_URL</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>gerrit-maven-project-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
- <execPattern>**/**.exec</execPattern>
- <classPattern>**/classes</classPattern>
- <sourcePattern>**/src/main/java</sourcePattern>
- <changeBuildStatus>false</changeBuildStatus>
- <inclusionPattern/>
- <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
- <maximumBranchCoverage>10</maximumBranchCoverage>
- <minimumBranchCoverage>20</minimumBranchCoverage>
- <maximumMethodCoverage>50</maximumMethodCoverage>
- <minimumMethodCoverage>40</minimumMethodCoverage>
- </hudson.plugins.jacoco.JacocoPublisher>
- <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
- <isRankActivated>false</isRankActivated>
- <includePattern/>
- <excludePattern/>
- <healthy/>
- <unHealthy/>
- <thresholdLimit>low</thresholdLimit>
- <pluginName>[FINDBUGS] </pluginName>
- <defaultEncoding/>
- <canRunOnFailed>false</canRunOnFailed>
- <useStableBuildAsReference>false</useStableBuildAsReference>
- <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
- <useDeltaValues>false</useDeltaValues>
- <thresholds>
- <unstableTotalAll/>
- <unstableTotalHigh/>
- <unstableTotalNormal/>
- <unstableTotalLow/>
- <failedTotalAll/>
- <failedTotalHigh/>
- <failedTotalNormal/>
- <failedTotalLow/>
- </thresholds>
- <shouldDetectModules>false</shouldDetectModules>
- <dontComputeNew>true</dontComputeNew>
- <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
- <pattern/>
- </hudson.plugins.findbugs.FindBugsPublisher>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>NODE_DIR</name>
- <description>Path to a Node project directory.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>NODE_VERSION</name>
- <description>Version of NodeJS to install.</description>
- <defaultValue>6.11.4</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/origin/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>{node-dir}/**</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <excludeDrafts>false</excludeDrafts>
- <excludeTrivialRebase>false</excludeTrivialRebase>
- <excludeNoCodeChange>false</excludeNoCodeChange>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>recheck$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>TOX_DIR</name>
- <description>Path to directory containing tox.ini file.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>TOX_ENVS</name>
- <description>Tox environments to run build against.
-Example: docs,py2,py3
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>$GERRIT_REFSPEC</refspec>
- <url>$GIT_URL/$GERRIT_PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>releng/ciman</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <excludeDrafts>true</excludeDrafts>
- <excludeTrivialRebase>false</excludeTrivialRebase>
- <excludeNoCodeChange>false</excludeNoCodeChange>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>recheck$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PYTHON_VERSION=python3</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.scm.NullSCM"/>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>**</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/*.rst</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/conf.py</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>remerge$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>RTD_PROJECT=gerrit-rtd</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>15</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <jenkins.model.BuildDiscarderProperty>
- <strategy class="hudson.tasks.LogRotator">
- <daysToKeep>7</daysToKeep>
- <numToKeep>-1</numToKeep>
- <artifactDaysToKeep>-1</artifactDaysToKeep>
- <artifactNumToKeep>0</artifactNumToKeep>
- </strategy>
- </jenkins.model.BuildDiscarderProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>$GIT_URL/$PROJECT</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/$GERRIT_BRANCH</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- <spec/>
- <gerritProjects>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- <compareType>ANT</compareType>
- <pattern>**</pattern>
- <branches>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- <compareType>ANT</compareType>
- <pattern>**/master</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
- </branches>
- <filePaths>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/*.rst</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- <compareType>ANT</compareType>
- <pattern>**/conf.py</pattern>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
- </filePaths>
- <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
- </gerritProjects>
- <skipVote>
- <onSuccessful>false</onSuccessful>
- <onFailed>false</onFailed>
- <onUnstable>false</onUnstable>
- <onNotBuilt>false</onNotBuilt>
- </skipVote>
- <silentMode>false</silentMode>
- <silentStartMode>false</silentStartMode>
- <escapeQuotes>true</escapeQuotes>
- <noNameAndEmailParameters>false</noNameAndEmailParameters>
- <readableMessage>false</readableMessage>
- <dependencyJobsNames/>
- <notificationLevel/>
- <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
- <triggerConfigURL/>
- <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
- <triggerOnEvents>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <excludeDrafts>true</excludeDrafts>
- <excludeTrivialRebase>false</excludeTrivialRebase>
- <excludeNoCodeChange>false</excludeNoCodeChange>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
- <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- <commentAddedCommentContains>recheck$</commentAddedCommentContains>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
- </triggerOnEvents>
- <buildStartMessage/>
- <buildFailureMessage/>
- <buildSuccessfulMessage/>
- <buildUnstableMessage/>
- <buildNotBuiltMessage/>
- <buildUnsuccessfulFilepath/>
- <customUrl/>
- <serverName>test-server</serverName>
- </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
- </triggers>
- <builders>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>DOC_DIR=docs/_build/html</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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/
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>15</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$GERRIT_PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>$sha1</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^jjb-deploy (?!\*+$).+$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>true</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>JJB Deploy Job</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PIP_PACKAGES=jenkins-job-builder</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jjbini-sandbox</fileId>
- <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>5</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>JJB_VERSION</name>
- <description>Jenkins Job Builder version to download and install.</description>
- <defaultValue>1.6.2</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.cloudbees.jenkins.GitHubPushTrigger>
- <spec/>
- </com.cloudbees.jenkins.GitHubPushTrigger>
- <hudson.triggers.SCMTrigger>
- <spec/>
- <ignorePostCommitHooks>false</ignorePostCommitHooks>
- </hudson.triggers.SCMTrigger>
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist>tykeal</adminlist>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist>jpwku
-tykeal
-zxiiro</whitelist>
- <orgslist>example-org</orgslist>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^remerge$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>true</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>false</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>JJB Merge</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jjbini</fileId>
- <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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/
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>JJB_VERSION</name>
- <description>Jenkins Job Builder version to download and install.</description>
- <defaultValue>1.6.2</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>$sha1</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^recheck$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>JJB Verify</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jjbini</fileId>
- <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>00 10 1 * *</spec>
- </hudson.triggers.TimerTrigger>
- <com.cloudbees.jenkins.GitHubPushTrigger>
- <spec/>
- </com.cloudbees.jenkins.GitHubPushTrigger>
- <hudson.triggers.SCMTrigger>
- <spec/>
- <ignorePostCommitHooks>false</ignorePostCommitHooks>
- </hudson.triggers.SCMTrigger>
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist>tykeal</adminlist>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist>jpwku
-tykeal
-zxiiro</whitelist>
- <orgslist>example-org</orgslist>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^remerge$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>true</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>false</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Packer centos-$java-builder Merge</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_PLATFORM=centos
-PACKER_TEMPLATE=java-builder
-PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>90</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>00 10 1 * *</spec>
- </hudson.triggers.TimerTrigger>
- <com.cloudbees.jenkins.GitHubPushTrigger>
- <spec/>
- </com.cloudbees.jenkins.GitHubPushTrigger>
- <hudson.triggers.SCMTrigger>
- <spec/>
- <ignorePostCommitHooks>false</ignorePostCommitHooks>
- </hudson.triggers.SCMTrigger>
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist>tykeal</adminlist>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist>jpwku
-tykeal
-zxiiro</whitelist>
- <orgslist>example-org</orgslist>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^remerge$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>true</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>false</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Packer centos-$mininet Merge</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_PLATFORM=centos
-PACKER_TEMPLATE=mininet
-PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>90</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>00 10 1 * *</spec>
- </hudson.triggers.TimerTrigger>
- <com.cloudbees.jenkins.GitHubPushTrigger>
- <spec/>
- </com.cloudbees.jenkins.GitHubPushTrigger>
- <hudson.triggers.SCMTrigger>
- <spec/>
- <ignorePostCommitHooks>false</ignorePostCommitHooks>
- </hudson.triggers.SCMTrigger>
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist>tykeal</adminlist>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist>jpwku
-tykeal
-zxiiro</whitelist>
- <orgslist>example-org</orgslist>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^remerge$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>true</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>false</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Packer ubuntu1604-$java-builder Merge</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_PLATFORM=ubuntu1604
-PACKER_TEMPLATE=java-builder
-PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>90</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec>00 10 1 * *</spec>
- </hudson.triggers.TimerTrigger>
- <com.cloudbees.jenkins.GitHubPushTrigger>
- <spec/>
- </com.cloudbees.jenkins.GitHubPushTrigger>
- <hudson.triggers.SCMTrigger>
- <spec/>
- <ignorePostCommitHooks>false</ignorePostCommitHooks>
- </hudson.triggers.SCMTrigger>
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist>tykeal</adminlist>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist>jpwku
-tykeal
-zxiiro</whitelist>
- <orgslist>example-org</orgslist>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^remerge$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>true</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>false</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Packer ubuntu1604-$mininet Merge</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_PLATFORM=ubuntu1604
-PACKER_TEMPLATE=mininet
-PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>90</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>PACKER_VERSION</name>
- <description>Packer version to download and install.</description>
- <defaultValue>1.1.3</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>$sha1</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^recheck$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Packer Verify</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>ci-packer-cloud-env</fileId>
- <targetLocation/>
- <variable>CLOUDENV</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PACKER_VERSION=1.1.3
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>refs/heads/master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^run-clm$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>CLM</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>aproject-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>find . -regex ".*karaf/target" | xargs rm -rf</command>
- </hudson.tasks.Shell>
- <com.sonatype.insight.ci.hudson.PreBuildScan plugin="sonatype-clm-ci">
- <applicationSelectType>
- <value>list</value>
- <applicationId>github-maven</applicationId>
- </applicationSelectType>
- <pathConfig>
- <scanTargets/>
- <moduleExcludes/>
- <scanProperties/>
- </pathConfig>
- <failOnClmServerFailures>false</failOnClmServerFailures>
- <stageId>build</stageId>
- <username/>
- <password/>
- </com.sonatype.insight.ci.hudson.PreBuildScan>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec/>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <com.cloudbees.jenkins.GitHubPushTrigger>
- <spec/>
- </com.cloudbees.jenkins.GitHubPushTrigger>
- <hudson.triggers.SCMTrigger>
- <spec/>
- <ignorePostCommitHooks>false</ignorePostCommitHooks>
- </hudson.triggers.SCMTrigger>
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist>tykeal</adminlist>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist>jpwku
-tykeal
-zxiiro</whitelist>
- <orgslist>example-org</orgslist>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^remerge$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>true</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>false</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>JJB Merge</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>aproject-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=project-site</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>DEPLOY_PATH=org.example.project/$STREAM</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>$sha1</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^recheck$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>true</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Maven Javadoc</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>aproject-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue>-Dmerge</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^remerge$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Maven Merge</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>aproject-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=fakeproject-snapshots</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>NEXUS_CUT_DIRS=6
-NEXUS_REPO=fakeproject-snapshots
-</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
- <isRankActivated>false</isRankActivated>
- <includePattern/>
- <excludePattern/>
- <healthy/>
- <unHealthy/>
- <thresholdLimit>low</thresholdLimit>
- <pluginName>[FINDBUGS] </pluginName>
- <defaultEncoding/>
- <canRunOnFailed>false</canRunOnFailed>
- <useStableBuildAsReference>false</useStableBuildAsReference>
- <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
- <useDeltaValues>false</useDeltaValues>
- <thresholds>
- <unstableTotalAll/>
- <unstableTotalHigh/>
- <unstableTotalNormal/>
- <unstableTotalLow/>
- <failedTotalAll/>
- <failedTotalHigh/>
- <failedTotalNormal/>
- <failedTotalLow/>
- </thresholds>
- <shouldDetectModules>false</shouldDetectModules>
- <dontComputeNew>true</dontComputeNew>
- <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
- <pattern/>
- </hudson.plugins.findbugs.FindBugsPublisher>
- <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
- <execPattern>**/**.exec</execPattern>
- <classPattern>**/classes</classPattern>
- <sourcePattern>**/src/main/java</sourcePattern>
- <changeBuildStatus>false</changeBuildStatus>
- <inclusionPattern/>
- <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
- <maximumBranchCoverage>10</maximumBranchCoverage>
- <minimumBranchCoverage>20</minimumBranchCoverage>
- <maximumMethodCoverage>50</maximumMethodCoverage>
- <minimumMethodCoverage>40</minimumMethodCoverage>
- </hudson.plugins.jacoco.JacocoPublisher>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- <hudson.plugins.parameterizedtrigger.BuildTrigger>
- <configs/>
- </hudson.plugins.parameterizedtrigger.BuildTrigger>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>master</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <hudson.triggers.TimerTrigger>
- <spec/>
- </hudson.triggers.TimerTrigger>
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^build release$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>true</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Maven Release</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>aproject-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=project-staging</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue>-Dstream=$STREAM</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue>uuddlrlrba</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>$sha1</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^recheck$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Maven Verify</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>aproject-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
- <isRankActivated>false</isRankActivated>
- <includePattern/>
- <excludePattern/>
- <healthy/>
- <unHealthy/>
- <thresholdLimit>low</thresholdLimit>
- <pluginName>[FINDBUGS] </pluginName>
- <defaultEncoding/>
- <canRunOnFailed>false</canRunOnFailed>
- <useStableBuildAsReference>false</useStableBuildAsReference>
- <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
- <useDeltaValues>false</useDeltaValues>
- <thresholds>
- <unstableTotalAll/>
- <unstableTotalHigh/>
- <unstableTotalNormal/>
- <unstableTotalLow/>
- <failedTotalAll/>
- <failedTotalHigh/>
- <failedTotalNormal/>
- <failedTotalLow/>
- </thresholds>
- <shouldDetectModules>false</shouldDetectModules>
- <dontComputeNew>true</dontComputeNew>
- <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
- <pattern/>
- </hudson.plugins.findbugs.FindBugsPublisher>
- <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
- <execPattern>**/**.exec</execPattern>
- <classPattern>**/classes</classPattern>
- <sourcePattern>**/src/main/java</sourcePattern>
- <changeBuildStatus>false</changeBuildStatus>
- <inclusionPattern/>
- <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
- <maximumBranchCoverage>10</maximumBranchCoverage>
- <minimumBranchCoverage>20</minimumBranchCoverage>
- <maximumMethodCoverage>50</maximumMethodCoverage>
- <minimumMethodCoverage>40</minimumMethodCoverage>
- </hudson.plugins.jacoco.JacocoPublisher>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>60</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <jdk>openjdk8</jdk>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>M2_HOME</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_OPTS</name>
- <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MAVEN_PARAMS</name>
- <description>Maven parameters to pass to the mvn command.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>MVN</name>
- <description>Maven selector to be used by shell scripts</description>
- <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STAGING_PROFILE_ID</name>
- <description>Nexus staging profile ID.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>ARCHIVE_ARTIFACTS</name>
- <description>Artifacts to archive to the logs server.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>SONAR_MAVEN_GOAL</name>
- <description>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".
-</description>
- <defaultValue>sonar:sonar</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>$sha1</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^recheck$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Maven Verify</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Maven>
- <targets>--version</targets>
- <properties/>
- <mavenName>mvn33</mavenName>
- <usePrivateRepository>false</usePrivateRepository>
- <settings class="jenkins.mvn.DefaultSettingsProvider"/>
- <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
- </hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>rm "$HOME/.wgetrc"</command>
- </hudson.tasks.Shell>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SONAR_HOST_URL=$SONAR_URL</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>global-settings</fileId>
- <targetLocation/>
- <variable>GLOBAL_SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>aproject-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
- <execPattern>**/**.exec</execPattern>
- <classPattern>**/classes</classPattern>
- <sourcePattern>**/src/main/java</sourcePattern>
- <changeBuildStatus>false</changeBuildStatus>
- <inclusionPattern/>
- <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
- <maximumBranchCoverage>10</maximumBranchCoverage>
- <minimumBranchCoverage>20</minimumBranchCoverage>
- <maximumMethodCoverage>50</maximumMethodCoverage>
- <minimumMethodCoverage>40</minimumMethodCoverage>
- </hudson.plugins.jacoco.JacocoPublisher>
- <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
- <isRankActivated>false</isRankActivated>
- <includePattern/>
- <excludePattern/>
- <healthy/>
- <unHealthy/>
- <thresholdLimit>low</thresholdLimit>
- <pluginName>[FINDBUGS] </pluginName>
- <defaultEncoding/>
- <canRunOnFailed>false</canRunOnFailed>
- <useStableBuildAsReference>false</useStableBuildAsReference>
- <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
- <useDeltaValues>false</useDeltaValues>
- <thresholds>
- <unstableTotalAll/>
- <unstableTotalHigh/>
- <unstableTotalNormal/>
- <unstableTotalLow/>
- <failedTotalAll/>
- <failedTotalHigh/>
- <failedTotalNormal/>
- <failedTotalLow/>
- </thresholds>
- <shouldDetectModules>false</shouldDetectModules>
- <dontComputeNew>true</dontComputeNew>
- <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
- <pattern/>
- </hudson.plugins.findbugs.FindBugsPublisher>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>30</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$GERRIT_PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>NODE_DIR</name>
- <description>Path to a Node project directory.</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>NODE_VERSION</name>
- <description>Version of NodeJS to install.</description>
- <defaultValue>6.11.4</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>$sha1</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^recheck$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>Node Verify</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$GERRIT_PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>TOX_DIR</name>
- <description>Path to directory containing tox.ini file.
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>TOX_ENVS</name>
- <description>Tox environments to run build against.
-Example: docs,py2,py3
-</description>
- <defaultValue/>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>$sha1</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^recheck$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>JJB Verify</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>PYTHON_VERSION=python3</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>10</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>false</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.scm.NullSCM"/>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^remerge$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>RTD Merge</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <hudson.triggers.TimerTrigger>
- <spec>H H * * *</spec>
- </hudson.triggers.TimerTrigger>
- </triggers>
- <builders>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>RTD_PROJECT=github-rtd</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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"
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>15</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<project>
- <actions/>
- <description><!-- Managed by Jenkins Job Builder --></description>
- <keepDependencies>false</keepDependencies>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <concurrentBuild>true</concurrentBuild>
- <assignedNode>build-vm</assignedNode>
- <canRoam>false</canRoam>
- <properties>
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
- <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
- <displayName/>
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>PROJECT</name>
- <description>Parameter to identify a Gerrit project. This is typically the
-project repo path as exists in Gerrit.
-For example: ofextensions/circuitsw
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>STREAM</name>
- <description>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.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_PROJECT</name>
- <description>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.
-</description>
- <defaultValue>releng/ciman</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_BRANCH</name>
- <description>Parameter to identify a Gerrit branch.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>GERRIT_REFSPEC</name>
- <description>Parameter to identify a refspec when pulling from Gerrit.
-
-Note that Gerrit will override this parameter automatically if a
-job is triggered by Gerrit.
-</description>
- <defaultValue>refs/heads/master</defaultValue>
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>LFTOOLS_VERSION</name>
- <description>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'.
-</description>
- <defaultValue><1.0.0</defaultValue>
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.plugins.git.GitSCM">
- <configVersion>2</configVersion>
- <userRemoteConfigs>
- <hudson.plugins.git.UserRemoteConfig>
- <name>origin</name>
- <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
- <url>git@github.com:example-org/releng/ciman</url>
- <credentialsId>test-credential</credentialsId>
- </hudson.plugins.git.UserRemoteConfig>
- </userRemoteConfigs>
- <branches>
- <hudson.plugins.git.BranchSpec>
- <name>$sha1</name>
- </hudson.plugins.git.BranchSpec>
- </branches>
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <remotePoll>false</remotePoll>
- <gitTool>Default</gitTool>
- <submoduleCfg class="list"/>
- <reference/>
- <gitConfigName/>
- <gitConfigEmail/>
- <extensions>
- <hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
- </hudson.plugins.git.extensions.impl.BuildChooserSetting>
- <hudson.plugins.git.extensions.impl.SubmoduleOption>
- <disableSubmodules>false</disableSubmodules>
- <recursiveSubmodules>true</recursiveSubmodules>
- <trackingSubmodules>false</trackingSubmodules>
- <parentCredentials>false</parentCredentials>
- <reference/>
- <timeout>10</timeout>
- </hudson.plugins.git.extensions.impl.SubmoduleOption>
- <hudson.plugins.git.extensions.impl.WipeWorkspace/>
- </extensions>
- </scm>
- <triggers class="vector">
- <org.jenkinsci.plugins.ghprb.GhprbTrigger>
- <spec/>
- <adminlist/>
- <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
- <whitelist/>
- <orgslist/>
- <whiteListLabels/>
- <blackListLabels/>
- <cron/>
- <triggerPhrase>^recheck$</triggerPhrase>
- <skipBuildPhrase/>
- <onlyTriggerPhrase>false</onlyTriggerPhrase>
- <useGitHubHooks>true</useGitHubHooks>
- <permitAll>true</permitAll>
- <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
- <extensions>
- <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- <commitStatusContext>RTD Verify</commitStatusContext>
- </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
- </extensions>
- </org.jenkinsci.plugins.ghprb.GhprbTrigger>
- </triggers>
- <builders>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>DOC_DIR=docs/_build/html</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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/
-</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers>
- <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <buildSteps>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>jenkins-log-archives-settings</fileId>
- <targetLocation/>
- <variable>SETTINGS_FILE</variable>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
- <EnvInjectBuilder>
- <info>
- <propertiesContent>SERVER_ID=logs</propertiesContent>
- </info>
- </EnvInjectBuilder>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.tasks.Shell>
- <command>#!/bin/bash
-# SPDX-License-Identifier: EPL-1.0
-##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the 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
-</command>
- </hudson.tasks.Shell>
- <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- <regexp>^Build logs: .*</regexp>
- </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
- </buildSteps>
- <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
- <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
- <markBuildUnstable>false</markBuildUnstable>
- </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
- <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
- <patterns>
- <hudson.plugins.ws__cleanup.Pattern>
- <pattern>**/*.jenkins-trigger</pattern>
- <type>EXCLUDE</type>
- </hudson.plugins.ws__cleanup.Pattern>
- </patterns>
- <deleteDirs>false</deleteDirs>
- <cleanupMatrixParent>false</cleanupMatrixParent>
- <externalDelete/>
- <cleanWhenSuccess>true</cleanWhenSuccess>
- <cleanWhenUnstable>true</cleanWhenUnstable>
- <cleanWhenFailure>true</cleanWhenFailure>
- <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
- <cleanWhenAborted>true</cleanWhenAborted>
- <notFailBuild>true</notFailBuild>
- </hudson.plugins.ws__cleanup.WsCleanup>
- </publishers>
- <buildWrappers>
- <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
- <hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <timeoutMinutes>15</timeoutMinutes>
- <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
- <failBuild>true</failBuild>
- <writingDescription>false</writingDescription>
- <timeoutPercentage>0</timeoutPercentage>
- <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
- <timeoutType>absolute</timeoutType>
- </hudson.plugins.build__timeout.BuildTimeoutWrapper>
- <hudson.plugins.timestamper.TimestamperBuildWrapper/>
- <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <user>test-credential</user>
- </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
- <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
- <managedFiles>
- <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- <fileId>npmrc</fileId>
- <targetLocation>$HOME/.npmrc</targetLocation>
- <variable/>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
- </managedFiles>
- </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
- </buildWrappers>
-</project>
# 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
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
[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
-