Невозможно скопировать задания из старой в новую версию Jenkins - PullRequest
0 голосов
/ 02 мая 2020

Невозможно импортировать задания старой версии Jenkins: 2.224 в Jenkins. Новая версия: 2.234

. После того, как я копирую задание из старого в новое хранилище Jenkins, пользовательский интерфейс консоли Jenkins выдает эту ошибку:

**You have data stored in older format and/or unreadable data.**

Вот старая конфигурация. xml очень простого задания:

<?xml version='1.1' encoding='UTF-8'?>
<flow-definition plugin="workflow-job@2.33">
  <actions/>
  <description></description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@1.31">
      <autoRebuild>false</autoRebuild>
      <rebuildDisabled>false</rebuildDisabled>
    </com.sonyericsson.rebuild.RebuildSettings>
  </properties>
  <definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps@2.70">
    <script>node {
    agent any
    stages {
        stage(&apos;build user&apos;) {

            steps {
                     wrap([$class: &apos;BuildUser&apos;]) {
                         //echo &quot;${BUILD_USER}&quot;
                         def user = env.BUILD_USER_ID
            }
        }
    }
}

}</script>
    <sandbox>true</sandbox>
  </definition>
  <triggers/>
  <disabled>false</disabled>
</flow-definition>

Следующее - это то же задание, созданное в более новой версии Jenkins:

<?xml version='1.1' encoding='UTF-8'?>
<flow-definition plugin="workflow-job@2.39">
  <description></description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty plugin="build-failure-analyzer@1.25.1">
      <doNotScan>false</doNotScan>
    </com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty>
  </properties>
  <definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps@2.80">
    <script>node {
    agent any
    stages {
        stage(&apos;build user&apos;) {

            steps {
                     wrap([$class: &apos;BuildUser&apos;]) {
                         //echo &quot;${BUILD_USER}&quot;
                         def user = env.BUILD_USER_ID
            }
        }
    }
}

}</script>
    <sandbox>true</sandbox>
  </definition>
  <triggers/>
  <disabled>false</disabled>
</flow-definition>

Может кто-нибудь подсказать, как я могу безупречно импортировать задания старого Jenkins в новый Jenkins?

Примечание: нет зависимости от плагина, так как это просто оболочка выполнения, которая печатает сообщение "привет" ,

Когда я нажимаю на кнопку «Управление» рядом с сообщением об ошибке для имени проекта «Free_hand» для получения подробной информации, я вижу следующий вывод.

Manage Old Data
When there are changes in how data is stored on disk, Jenkins uses the following strategy: data is migrated to the new structure when it is loaded, but items/records are not resaved in the new format. This allows for downgrading Jenkins if necessary. However, it can also leave data on disk in the old format indefinitely. The table below lists items/records containing such data, and the Jenkins version(s) where the data structure was changed.

Sometimes errors occur while reading data (if a plugin adds some data and that plugin is later disabled, if migration code is not written for structure changes, or if Jenkins is downgraded after it has already written data not readable by the older version). These errors are logged, but the unreadable data is then skipped over, allowing Jenkins to start up and function properly.

Type    Name    Version
No old data was found.
Unreadable Data
It is ok to leave unreadable data in these items/records, as Jenkins will simply ignore it. To avoid the log messages at Jenkins startup you can permanently delete the unreadable data by resaving these items/records using the button below the list.

Type    Name    Error
hudson.model.FreeStyleProject   Free_hand       CannotResolveClassException: com.sonyericsson.rebuild.RebuildSettings
hudson.model.FreeStyleBuild     Free_hand #1    CannotResolveClassException: com.sonyericsson.rebuild.RebuildAction
hudson.model.FreeStyleBuild     Free_hand #2    CannotResolveClassException: com.sonyericsson.rebuild.RebuildCause, CannotResolveClassException: com.sonyericsson.rebuild.RebuildAction
hudson.model.FreeStyleBuild     Free_hand #5    CannotResolveClassException: com.sonyericsson.rebuild.RebuildAction
hudson.model.FreeStyleBuild     Free_hand #3    CannotResolveClassException: com.sonyericsson.rebuild.RebuildCause, CannotResolveClassException: com.sonyericsson.rebuild.RebuildAction
hudson.model.FreeStyleBuild     Free_hand #7    CannotResolveClassException: com.sonyericsson.rebuild.RebuildAction
hudson.model.FreeStyleBuild     Free_hand #6    CannotResolveClassException: com.sonyericsson.rebuild.RebuildAction
hudson.model.FreeStyleBuild     Free_hand #4    CannotResolveClassException: com.sonyericsson.rebuild.RebuildCause, CannotResolveClassException: com.sonyericsson.rebuild.RebuildAction

У меня около 75 сложных Jenkins задания и создание каждого вручную в новой версии Jenkins будут тривиальными и могут быть подвержены ошибкам.

Можете ли вы предложить?

...