KBEC-00364 - Moving ElectricFlow Artifacts between Repositories

Summary

If you are trying to move ElectricFlow Artifacts between repositories, depending on whether the two repositories are within a network or not, these are the following steps to move artifacts from one repository to another.

 

Solution

 Scenario 1: Repositories are in-network

If the two repositories are in-network, then you can simply copy the directory structure over from one repository to another and then delete it in the source repository (if moving artifacts). Renaming artifacts during this move will not update metadata in the Commander Database and makes them unretrievable.

 

Scenario 2: Repositories are in separate network or If a renaming is required

You can retrieve artifact from source repository and publish to destination repository. You will use these methods if you want to rename the artifact for any reason. 

Method 1UI 

  1. Create a procedure within the project to retrieve and publish artifact to a new repository.
  2. Create a step named ‘Retrieve Artifact Version’. Utilize the sub procedure EC-Artifact : Retrieve.
    1. If necessary, Retrieve Artifact Version to a temp Directory.
  3. Create a step named ‘Publish Artifact Version’. Utilize the sub procedure EC-artifact : Publish. To change repositories of the publish artifact, you must change the Repository field within the Publish Artifact step. 
    1. If previously retrieved directory to a temp directory, provide file path to the From Directory field.

 

Method 2ectool

Use ectool to retrieve and publish ArtifactVersion. You would use the following commands to retrieve and publish the artifacts.

ectool retrieveArtifactVersions --artifactName  --versionRange 

ectool publishArtifactVersion --artifactName  --version --repositoryName  

 Method 3: Ec-perl

To use EC-perl, you would define either a new Step or File with the following code:

#!/usr/bin/perl
use strict;
use ElectricCommander;
$| = 1;
my $cmdr = new ElectricCommander();
my $artifact = $cmdr->retrieveArtifactVersions({cacheDirectory => "Cache File path if required",
								artifactName => "Artifact Name", 
                                 versionRange => "Version Range",
                                 toDirectory => "Temp Directory",
                                 });

$cmdr->publishArtifactVersion({artifactName => "Artifact Name", 
                                version => "Version Number",
                                repositoryName => "repositoryName",
                   				fromDirectory => "Temp Directory",
                   			});

For more details on ectool or EC-Perl please refer to the link to the Docs.electric-cloud.com:

API Commands - Artifact Management

 

Have more questions? Submit a request

Comments

Powered by Zendesk