This guide explains how to clone a Jenkins folder configuration from Team A to Team C, inheriting pipelines, credentials, and settings.
In this guide, you’ll learn how to clone an existing Jenkins folder configuration—team-a—to a new folder named team-c. By copying the folder, Team C automatically inherits pipelines, credentials, and settings from Team A, ensuring consistency and reducing setup time.
Navigate into the newly created team-c folder. You should see team-a-pipeline listed—this confirms the pipeline configuration has been cloned successfully.
Open the pipeline’s Configure view and compare it to Team A’s pipeline to ensure all stages and steps match.
Since team-c inherits from team-a, it also has access to both the Shared Infrastructure credentials and the Team A credentials. Verify under Credentials → team-c → shared-infrastructure.
In your Jenkinsfile, use a withCredentials block to bind these credentials to environment variables:
Started by user siddharth[Pipeline] Start of Pipeline[Pipeline] nodeRunning on Jenkins in /var/lib/jenkins/workspace/shared-infrastructure/team-c/team-a-pipeline[Pipeline] withCredentialsMasking supported pattern matches of $TEAM_A_USR or $TEAM_A_PSW or $SHARED_DB_USR or $SHARED_DB_PSW[Pipeline] stage[Pipeline] { (Accessing Credentials)[Pipeline] script[Pipeline] echoShared DB Username: shared-DATABASE-username[Pipeline] echoTeam A Username: team-AAAAA-username[Pipeline] }[Pipeline] // script[Pipeline] stage[Pipeline] { (Declarative: Post Actions)[Pipeline] echoBuild completed successfully[Pipeline] }
By cloning team-a into team-c, you ensure all pipelines, credentials, and folder-level configurations are inherited, streamlining setup for new teams and maintaining organizational standards.