Summary

Article ID:360033186471
2 minute readKnowledge base
On this page

This article describes how to export a project and it’s configuration, properties, etc. and then remove a particular procedure. While example in this arcticle shows a procedure removal, similar technique could be used to remove properties, email-configurations, schedules etс.

Solution

In the following example we have project with two procedures with a step in each.

yourProject-1.png

In order to export a project use the following steps:

1.Export the project using the generateDsl command (e.g.)

ectool generateDsl /projects/yourProjectName> fileName.dsl

2.Edit a file.

Change project name and delete the procedures/steps that you don’t need (bold text):

project 'yourProject2', {
 resourceName = null
 workspaceName = null

procedure 'yourProcedureOne', {
 description = ''
 jobNameTemplate = ''
 resourceName = ''
 timeLimit = ''
 timeLimitUnits = 'minutes'
 workspaceName = ''

step 'yourStepOne', {
 description = ''
 alwaysRun = '0'
 broadcast = '0'
 command = 'echo echoStep'
 condition = ''
 errorHandling = 'failProcedure'
 exclusiveMode = 'none'
 logFileName = ''
 parallel = '0'
 postProcessor = ''
 precondition = ''
 releaseMode = 'none'
 resourceName = ''
 shell = 'ec-js'
 subprocedure = null
 subproject = null
 timeLimit = ''
 timeLimitUnits = 'minutes'
 workingDirectory = ''
 workspaceName = ''
 }
 }

procedure 'yourProcedureTwo', {
 description = ''
 jobNameTemplate = ''
 resourceName = ''
 timeLimit = ''
 timeLimitUnits = 'minutes'
 workspaceName = ''

step 'yourStepOne', {
 description = ''
 alwaysRun = '0'
 broadcast = '0'
 command = 'echo echoStep'
 condition = ''
 errorHandling = 'failProcedure'
 exclusiveMode = 'none'
 logFileName = ''
 parallel = '0'
 postProcessor = ''
 precondition = ''
 releaseMode = 'none'
 resourceName = ''
 shell = 'ec-js'
 subprocedure = null
 subproject = null
 timeLimit = ''
 timeLimitUnits = 'minutes'
 workingDirectory = ''
 workspaceName = ''
 }
 }

// Custom properties
 ec_tags = ''
}
  1. Import the edited project using the evalDsl command (e.g.)

ectool evalDsl --dslFile fileName.dsl

Now, we have a copy of the project with only one procedure:

yourProject-2.png
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.