All Implemented Interfaces:
Configurable, KeyVal.Mixin, UtilsMixin

public class Stage extends HasEnvironmentVariables<Stage>
Represents a stage.

/*
 * Copyright 2022 Thoughtworks, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


  stage('build') {
    jobs {
      job('backend') {
        // job definition
      }
      job('frontend') {
        // job definiton
      }
    }
  }

  • Constructor Details

  • Method Details

    • jobs

    • approval

    • getFetchMaterials

      public Boolean getFetchMaterials()
      If set, performs material updates or checkouts on the agent. Defaults to true.
    • getCleanWorkingDir

      public Boolean getCleanWorkingDir()
      If set, this flag will remove all files/directories in the working directory on the agent, before the job starts. Defaults to false.
    • getArtifactCleanupProhibited

      public Boolean getArtifactCleanupProhibited()
      If set, never cleanup artifacts for this stage, if purging artifacts is configured at the server level. Defaults to false.
    • setFetchMaterials

      public void setFetchMaterials(Boolean fetchMaterials)
      If set, performs material updates or checkouts on the agent. Defaults to true.
    • setCleanWorkingDir

      public void setCleanWorkingDir(Boolean cleanWorkingDir)
      If set, this flag will remove all files/directories in the working directory on the agent, before the job starts. Defaults to false.
    • setArtifactCleanupProhibited

      public void setArtifactCleanupProhibited(Boolean artifactCleanupProhibited)
      If set, never cleanup artifacts for this stage, if purging artifacts is configured at the server level. Defaults to false.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class HasEnvironmentVariables<Stage>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class HasEnvironmentVariables<Stage>
    • toString

      public String toString()
      Overrides:
      toString in class HasEnvironmentVariables<Stage>