<?xml version="1.0" encoding="UTF-8"?><project>
  <actions/>
  <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
  <keepDependencies>false</keepDependencies>
  <disabled>false</disabled>
  <displayName>CI job configs deployment</displayName>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <concurrentBuild>false</concurrentBuild>
  <assignedNode>triggers</assignedNode>
  <canRoam>false</canRoam>
  <properties>
    <hudson.security.AuthorizationMatrixProperty>
      <permission>hudson.model.Item.Discover:anonymous</permission>
      <permission>hudson.model.Item.Build:everyone-flat</permission>
      <permission>hudson.model.Item.Read:everyone-flat</permission>
      <permission>hudson.model.Item.ExtendedRead:everyone-flat</permission>
    </hudson.security.AuthorizationMatrixProperty>
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
        <daysToKeep>30</daysToKeep>
        <numToKeep>200</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.model.StringParameterDefinition>
          <name>PATCHSET_REVISION</name>
          <description>patchset revision</description>
          <defaultValue>origin/main</defaultValue>
        </hudson.model.StringParameterDefinition>
        <hudson.model.StringParameterDefinition>
          <name>nb_rev</name>
          <description>nb of revision to process</description>
          <defaultValue>1</defaultValue>
        </hudson.model.StringParameterDefinition>
        <hudson.model.StringParameterDefinition>
          <name>yaml_file_to_deploy</name>
          <description>If non empty, the run will deploy the given yaml file</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/heads/*:refs/remotes/origin/*</refspec>
        <url>https://gitlab.com/LinaroLtd/tcwg/ci/configs</url>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>**</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <disableSubmodules>false</disableSubmodules>
    <recursiveSubmodules>false</recursiveSubmodules>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <remotePoll>false</remotePoll>
    <gitTool>Default</gitTool>
    <submoduleCfg class="list"/>
    <reference/>
    <gitConfigName/>
    <gitConfigEmail/>
    <extensions>
      <hudson.plugins.git.extensions.impl.RelativeTargetDirectory>
        <relativeTargetDir>configs</relativeTargetDir>
      </hudson.plugins.git.extensions.impl.RelativeTargetDirectory>
      <hudson.plugins.git.extensions.impl.CleanBeforeCheckout/>
      <hudson.plugins.git.extensions.impl.WipeWorkspace/>
    </extensions>
  </scm>
  <builders>
    <hudson.tasks.Shell>
      <command>#!/bin/bash -e
echo "#${BUILD_NUMBER}-$(git rev-parse ${PATCHSET_REVISION})" &gt; ${WORKSPACE}/version.txt
</command>
    </hudson.tasks.Shell>
    <org.jenkinsci.plugins.buildnameupdater.BuildNameUpdater>
      <buildName>version.txt</buildName>
      <macroTemplate>#${BUILD_NUMBER}</macroTemplate>
      <fromFile>true</fromFile>
      <fromMacro>false</fromMacro>
      <macroFirst>false</macroFirst>
    </org.jenkinsci.plugins.buildnameupdater.BuildNameUpdater>
    <hudson.tasks.Shell>
      <command>#!/bin/bash

set -e

cd configs/

export GIT_PREVIOUS_COMMIT=$(git rev-parse ${PATCHSET_REVISION}~${nb_rev})
export GIT_COMMIT=$(git rev-parse ${PATCHSET_REVISION})
export GIT_FILE=${yaml_file_to_deploy}

echo ""
echo "########################################################################"
echo "    Environment"
echo "GIT_COMMIT=${GIT_COMMIT}"
echo "GIT_PREVIOUS_COMMIT=${GIT_PREVIOUS_COMMIT}"
echo "GIT_FILE=${yaml_file_to_deploy}"
echo "########################################################################"

set +e
KERNEL_TEST_CONFIG=$(git show --pretty="format:" --name-only | grep "kernel-testing-configs/test-params")
set -e
if [ ! -z ${KERNEL_TEST_CONFIG} ];then
  source ${KERNEL_TEST_CONFIG}
  export KERNEL_BRANCH KERNEL_REPO DUT EMAIL_ADDRESS
  cd kernel-testing-configs
  ./generate-jjb-configs.sh
  export GIT_PREVIOUS_COMMIT=$(git rev-parse ${PATCHSET_REVISION}~${nb_rev})
  export GIT_COMMIT=$(git rev-parse ${PATCHSET_REVISION})
  cd ../
fi

jenkins-jobs --version
python3 run-jjb.py
</command>
    </hudson.tasks.Shell>
  </builders>
  <publishers>
    <hudson.tasks.Mailer plugin="mailer">
      <recipients>laurent.alfonsi@linaro.org</recipients>
      <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
      <sendToIndividuals>false</sendToIndividuals>
    </hudson.tasks.Mailer>
  </publishers>
  <buildWrappers>
    <hudson.plugins.timestamper.TimestamperBuildWrapper/>
    <org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper>
      <bindings>
        <org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
          <variable>JJB_USER</variable>
          <credentialsId>JJB_USER</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
        <org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
          <variable>JJB_PASSWORD</variable>
          <credentialsId>JJB_PASSWORD</credentialsId>
        </org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
      </bindings>
    </org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper>
  </buildWrappers>
</project>