ktdreyer/jenkins-job-wrecker

yaml stucture that cannot be imported by jenkins-job-builder

Opened this issue · 0 comments

I created simple maven project in jenkins

<?xml version='1.0' encoding='UTF-8'?>
<maven2-moduleset plugin="maven-plugin@2.17">
  <actions/>
  <description></description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.4.6">
      <gitLabConnection>gitlab</gitLabConnection>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
  </properties>
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.3.2">
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>https://github.com/ktdreyer/jenkins-job-wrecker</url>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>*/master</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
  <canRoam>true</canRoam>
  <disabled>true</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <mavenName>/usr/bin/mvn</mavenName>
  <aggregatorStyleBuild>true</aggregatorStyleBuild>
  <incrementalBuild>false</incrementalBuild>
  <ignoreUpstremChanges>false</ignoreUpstremChanges>
  <ignoreUnsuccessfulUpstreams>false</ignoreUnsuccessfulUpstreams>
  <archivingDisabled>false</archivingDisabled>
  <siteArchivingDisabled>false</siteArchivingDisabled>
  <fingerprintingDisabled>false</fingerprintingDisabled>
  <resolveDependencies>false</resolveDependencies>
  <processPlugins>false</processPlugins>
  <mavenValidationLevel>-1</mavenValidationLevel>
  <runHeadless>false</runHeadless>
  <disableTriggerDownstreamProjects>false</disableTriggerDownstreamProjects>
  <blockTriggerWhenBuilding>true</blockTriggerWhenBuilding>
  <settings class="jenkins.mvn.DefaultSettingsProvider"/>
  <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
  <reporters/>
  <publishers/>
  <buildWrappers/>
  <prebuilders/>
  <postbuilders/>
  <runPostStepsIfResult>
    <name>FAILURE</name>
    <ordinal>2</ordinal>
    <color>RED</color>
    <completeBuild>true</completeBuild>
  </runPostStepsIfResult>
</maven2-moduleset>

then this project has been tranformed into yml using jjwrecker

- job:
    name: !!python/unicode 'jjw_maven_test'
    project-type: maven
    xml:
      raw:
        xml: |-
          <maven2-moduleset plugin="maven-plugin@2.17">
          <actions />
          <description />
          <keepDependencies>false</keepDependencies>
          <properties>
          <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.4.6">
          <gitLabConnection>gitlab</gitLabConnection>
          </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
          </properties>
          <scm class="hudson.plugins.git.GitSCM" plugin="git@3.3.2">
          <configVersion>2</configVersion>
          <userRemoteConfigs>
          <hudson.plugins.git.UserRemoteConfig>
          <url>https://github.com/ktdreyer/jenkins-job-wrecker</url>
          </hudson.plugins.git.UserRemoteConfig>
          </userRemoteConfigs>
          <branches>
          <hudson.plugins.git.BranchSpec>
          <name>*/master</name>
          </hudson.plugins.git.BranchSpec>
          </branches>
          <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
          <submoduleCfg class="list" />
          <extensions />
          </scm>
          <canRoam>true</canRoam>
          <disabled>true</disabled>
          <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
          <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
          <triggers />
          <concurrentBuild>false</concurrentBuild>
          <mavenName>/usr/bin/mvn</mavenName>
          <aggregatorStyleBuild>true</aggregatorStyleBuild>
          <incrementalBuild>false</incrementalBuild>
          <ignoreUpstremChanges>false</ignoreUpstremChanges>
          <ignoreUnsuccessfulUpstreams>false</ignoreUnsuccessfulUpstreams>
          <archivingDisabled>false</archivingDisabled>
          <siteArchivingDisabled>false</siteArchivingDisabled>
          <fingerprintingDisabled>false</fingerprintingDisabled>
          <resolveDependencies>false</resolveDependencies>
          <processPlugins>false</processPlugins>
          <mavenValidationLevel>-1</mavenValidationLevel>
          <runHeadless>false</runHeadless>
          <disableTriggerDownstreamProjects>false</disableTriggerDownstreamProjects>
          <blockTriggerWhenBuilding>true</blockTriggerWhenBuilding>
          <settings class="jenkins.mvn.DefaultSettingsProvider" />
          <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider" />
          <reporters />
          <publishers />
          <buildWrappers />
          <prebuilders />
          <postbuilders />
          <runPostStepsIfResult>
          <name>FAILURE</name>
          <ordinal>2</ordinal>
          <color>RED</color>
          <completeBuild>true</completeBuild>
          </runPostStepsIfResult>
          </maven2-moduleset>

jenkins-jobs --flush-cache --conf /etc/jenkins_jobs/jenkins_jobs.ini test jjw_maven_test.yml

INFO:jenkins_jobs.builder:Job name:  jjw_maven_test
<?xml version="1.0" encoding="utf-8"?>
<maven2-moduleset>
  <actions/>
  <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
  <keepDependencies>false</keepDependencies>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <concurrentBuild>false</concurrentBuild>
  <canRoam>true</canRoam>
  <properties/>
  <scm class="hudson.scm.NullSCM"/>
  <publishers/>
  <buildWrappers/>

it seems that jjwrecker generates structure

    project-type: maven
    xml:

beacuse instead of xml there should be the name of module supported by jenkins-job-builder

https://docs.openstack.org/infra/jenkins-job-builder/definition.html#modules