use of software.amazon.awssdk.services.codecommit.CodeCommitClient in project aws-doc-sdk-examples by awsdocs.
the class MergeBranches method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <repoName> <targetBranch> <sourceReference> <destinationCommitId>\n\n" + "Where:\n" + " repoName - the name of the repository.\n" + " targetBranch - the branch where the merge is applied.\n" + " sourceReference - the branch of the repository that contains the changes.\n" + " destinationCommitId - a full commit ID.\n";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String repoName = args[0];
String targetBranch = args[1];
String sourceReference = args[2];
String destinationCommitId = args[3];
Region region = Region.US_EAST_1;
CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
merge(codeCommitClient, repoName, targetBranch, sourceReference, destinationCommitId);
codeCommitClient.close();
}
use of software.amazon.awssdk.services.codecommit.CodeCommitClient in project aws-doc-sdk-examples by awsdocs.
the class CodeCommitTest method setUp.
@BeforeAll
public static void setUp() throws IOException, URISyntaxException {
Region region = Region.US_EAST_1;
codeCommitClient = CodeCommitClient.builder().region(region).build();
try (InputStream input = CodeCommitClient.class.getClassLoader().getResourceAsStream("config.properties")) {
Properties prop = new Properties();
if (input == null) {
System.out.println("Sorry, unable to find config.properties");
return;
}
// load a properties file from class path, inside static method
prop.load(input);
// Populate the data members required for all tests
newRepoName = prop.getProperty("newRepoName");
existingRepoName = prop.getProperty("existingRepoName");
newBranchName = prop.getProperty("newBranchName");
existingBranchName = prop.getProperty("existingBranchName");
branchCommitId = prop.getProperty("branchCommitId");
filePath = prop.getProperty("filePath");
name = prop.getProperty("name");
repoPath = prop.getProperty("repoPath");
email = prop.getProperty("email");
targetBranch = prop.getProperty("targetBranch");
prID = prop.getProperty("prID");
} catch (IOException ex) {
ex.printStackTrace();
}
}
use of software.amazon.awssdk.services.codecommit.CodeCommitClient in project aws-doc-sdk-examples by awsdocs.
the class CreatePullRequest method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <repoName> <destinationReference> <sourceReference> \n\n" + "Where:\n" + " repoName - the name of the repository.\n" + " destinationReference - the branch of the repository where the pull request changes are merged.\n" + " sourceReference - the branch of the repository that contains the changes for the pull request.\n";
if (args.length != 3) {
System.out.println(USAGE);
System.exit(1);
}
String repoName = args[0];
String destinationReference = args[1];
String sourceReference = args[2];
Region region = Region.US_EAST_1;
CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
String prId = createPR(codeCommitClient, repoName, destinationReference, sourceReference);
System.out.println("The pull request id is " + prId);
codeCommitClient.close();
}
use of software.amazon.awssdk.services.codecommit.CodeCommitClient in project aws-doc-sdk-examples by awsdocs.
the class DeleteBranch method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <repoName> <branchName> \n\n" + "Where:\n" + " repoName - the name of the repository.\n" + " branchName - the name of the branch. \n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String repoName = args[0];
String branchName = args[1];
Region region = Region.US_EAST_1;
CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
deleteSpecificBranch(codeCommitClient, repoName, branchName);
codeCommitClient.close();
}
use of software.amazon.awssdk.services.codecommit.CodeCommitClient in project aws-doc-sdk-examples by awsdocs.
the class DescribePullRequestEvents method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <prId> \n\n" + "Where:\n" + " prId - the id of the pull request. \n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String prId = args[0];
Region region = Region.US_EAST_1;
CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
describePREvents(codeCommitClient, prId);
codeCommitClient.close();
}
Aggregations