CreateClone(string cloneName, string deployName, string branchName, string repoUrl, string imagePath, string destPath) { // FIXME: implement image if (cloneName != null) { // if deployment requested or image path is provided if (imagePath != null || deployName != null) { PyRevit.DeployFromImage( cloneName, deploymentName: deployName, branchName: branchName, imagePath: imagePath, destPath: destPath ); } // otherwise clone the full repo else { PyRevit.DeployFromRepo( cloneName, deploymentName: deployName, branchName: branchName, repoUrl: repoUrl, destPath: destPath ); } } }
public void DeployFromImage_Full_Test() { var testCloneBranch = "master"; PyRevit.DeployFromImage( cloneName: testCloneName, deploymentName: null, branchName: null, imagePath: null, destPath: TempPath ); var clone = PyRevit.GetRegisteredClone(testCloneName); PyRevit.UnregisterClone(clone); Assert.AreEqual(testCloneBranch, clone.Branch, string.Format("{0} != {1}", testCloneBranch, clone.Branch)); }
public void DeployFromImage_WithOptions_Test() { var testCloneDeployment = "core"; var testCloneBranch = "develop"; PyRevit.DeployFromImage( cloneName: testCloneName, deploymentName: testCloneDeployment, branchName: testCloneBranch, imagePath: null, destPath: TempPath ); var clone = PyRevit.GetRegisteredClone(testCloneName); PyRevit.UnregisterClone(clone); Assert.AreEqual(testCloneDeployment, clone.Deployment.Name, string.Format("{0} != {1}", testCloneDeployment, clone.Deployment.Name)); Assert.AreEqual(testCloneBranch, clone.Branch, string.Format("{0} != {1}", testCloneBranch, clone.Branch)); }