Updated on 2024-11-15 GMT+08:00

Cloning a Pipeline

You can clone a pipeline to generate a new pipeline based on the existing pipeline configuration.

Prerequisites

The pipeline has been created and is not in the Running state. For details, see Creating a Pipeline.

Cloning a Pipeline

  1. Log in to ServiceStage.
  2. Choose Continuous Delivery > Pipeline.
  3. Use either of the following methods to go to the Clone Pipeline page:

    • Directly clone: Select the pipeline and choose More > Clone.
    • View details and then clone: Click the pipeline. On the Pipeline Details page displayed, click Clone.

  4. ServiceStage automatically loads configurations of the clone pipeline. You can then modify the configurations as required by referring to the following table.

    Template Name

    Description

    Empty Template

    You need to add a pipeline model.

    1. Click the Empty Template card.
    2. Add a build job.
      1. Click Select Build Job.
      2. Select a build job.

        If there is no build job, create one by referring to Creating a Source Code Job or Creating a Package Job.

      3. Click OK.

      Repeat this step to add more build jobs. The build job must belong to the enterprise project set in 3.

    3. Add a deployment environment
      1. Click Add Environment.
      2. Click and enter an environment name.
      3. Click to save the environment name.
      4. Select the deployed application component in the build job and click OK.

        If there is no application component in the environment, create and deploy one by referring to Creating and Deploying a Component Based on a Container Using UI Configurations and Creating and Deploying a Component Based on a Container Using YAML Configurations.

        Click Change Component to select another component.

      5. Select Build Job: Select the added build job for build.
      6. Build Output: Set the archive path of the image generated by the build job.
      7. Click OK.

      Repeat this step to add more deployment environments.

    4. Set pipeline approval.
      1. Click on an environment card.
      2. Set Approval Mode.

        By all: The pipeline can be executed only after all selected approvers approve the deployment.

        By one person: The pipeline can be executed after any approver approves the deployment.

      3. Set Approved By.

        You can select multiple approvers. The system automatically loads all subaccounts of the account.

    Simple Template

    The "build" model is automatically added to compile and build the source code of the code library.

    1. Select Simple Template.
    2. Click Create.
    3. Add a build job.
      1. Click on a build job card.
      2. Select a build job.

        If there is no build job, create one by referring to Creating a Source Code Job or Creating a Package Job.

      3. Click OK.

        Click Select Build Job to add multiple build jobs. The build job must belong to the enterprise project set in Creating a Pipeline.

    4. (Optional) Add a deployment environment.
      1. Click Add Environment.
      2. Click and enter an environment name.
      3. Click to save the environment name.
      4. Select the deployed application component in the build job and click OK.

        If there is no application component in the environment, create and deploy one by referring to Creating and Deploying a Component Based on a Container Using UI Configurations and Creating and Deploying a Component Based on a Container Using YAML Configurations.

        Click Change Component to select another component.

      5. Select Build Job: Select the added build job for build.
      6. Build Output: Set the archive path of the image generated by the build job.
      7. Click OK.

      Repeat this step to add more deployment environments.

    5. Set pipeline approval.
      If a deployment environment is added, you can set pipeline approval.
      1. Click on an environment card.
      2. Set Approval Mode.

        By all: The pipeline can be executed only after all selected approvers approve the deployment.

        By one person: The pipeline can be executed after any approver approves the deployment.

      3. Set Approved By.

        You can select multiple approvers. The system automatically loads all subaccounts of the account.

    Common Template

    The "Build/Production environment" model is automatically added to compile and build the source code of the code library, and the generated software package or image is continuously released to the production environment.

    1. Select Common Template.
    2. Click Create.
    3. Add a build job.
      1. Click on a build job card.
      2. Select a build job.

        If there is no build job, create one by referring to Creating a Source Code Job or Creating a Package Job.

      3. Click OK.

        Click Select Build Job to add multiple build jobs. The build job must belong to the enterprise project set in Creating a Pipeline.

    4. Add a deployment environment
      1. Click Add Environment.
      2. Click on the empty environment card. The Add Environment dialog box is displayed.
      3. Click and enter an environment name.
      4. Click to save the environment name.
      5. Select the deployed application component in the build job and click OK.

        If there is no application component in the environment, create and deploy one by referring to Creating and Deploying a Component Based on a Container Using UI Configurations and Creating and Deploying a Component Based on a Container Using YAML Configurations.

        Click Change Component to select another component.

      6. Select Build Job: Select the added build job for build.
      7. Build Output: Set the archive path of the image generated by the build job.
      8. Click OK.

      Repeat this step to add more deployment environments.

    5. Set pipeline approval.
      1. Click on an environment card.
      2. Set Approval Mode.

        By all: The pipeline can be executed only after all selected approvers approve the deployment.

        By one person: The pipeline can be executed after any approver approves the deployment.

      3. Set Approved By.

        You can select multiple approvers. The system automatically loads all subaccounts of the account.

  5. Determine whether to start the pipeline:

    • If yes, click Create and Execute to save the settings and start the pipeline. After the pipeline is started, its status is Successful .

      If the pipeline need to be approved, it is in the To be confirmed state during component deployment. The pipeline can continue to run only after you notify the approvers for approval. For details, see Approving a Pipeline.

    • If no, click Create to save the settings only. After the pipeline is created, its status is Not executed.

    To view the pipeline, see Viewing Pipeline Details.