Search in sources :

Example 11 with CodeCommitClient

use of software.amazon.awssdk.services.codecommit.CodeCommitClient in project aws-doc-sdk-examples by awsdocs.

the class PutFile method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <repoName> <branchName> <filePath> <email> <name> <repoPath> <commitId>\n\n" + "Where:\n" + "    repoName - the name of the repository.\n" + "    branchName -  the name of the branch.\n" + "    filePath  - the location of the file on the local drive (i.e., C:/AWS/uploadGlacier.txt).\n" + "    email -  the email of the user whom uploads the file.\n" + "    name -  the name of the user.\n" + "    repoPath -  the location in the repo to store the file.\n" + "    commitId -  the full commit ID of the head commit in the branch (you can retrieve this value from the AWS CodeCommit Console).\n";
    if (args.length != 7) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String repoName = args[0];
    String branchName = args[1];
    String filePath = args[2];
    String email = args[3];
    String name = args[4];
    String repoPath = args[5];
    String commitId = args[6];
    Region region = Region.US_EAST_1;
    CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
    uploadFile(codeCommitClient, filePath, repoName, branchName, email, name, repoPath, commitId);
    codeCommitClient.close();
}
Also used : CodeCommitClient(software.amazon.awssdk.services.codecommit.CodeCommitClient) Region(software.amazon.awssdk.regions.Region)

Example 12 with CodeCommitClient

use of software.amazon.awssdk.services.codecommit.CodeCommitClient in project aws-doc-sdk-examples by awsdocs.

the class CreateBranch method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <repoName> <branchName> <commitId> \n\n" + "Where:\n" + "    repoName - the name of the repository.\n" + "    branchName -  the name of the branch.\n" + "    commitId  - The ID of the commit to point the new branch to. \n";
    if (args.length != 3) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String repoName = args[0];
    String branchName = args[1];
    String commitId = args[2];
    Region region = Region.US_EAST_1;
    CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
    createSpecificBranch(codeCommitClient, repoName, branchName, commitId);
    codeCommitClient.close();
}
Also used : CodeCommitClient(software.amazon.awssdk.services.codecommit.CodeCommitClient) Region(software.amazon.awssdk.regions.Region)

Example 13 with CodeCommitClient

use of software.amazon.awssdk.services.codecommit.CodeCommitClient in project aws-doc-sdk-examples by awsdocs.

the class CreateRepository method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <repoName> \n\n" + "Where:\n" + "    repoName - the name of the repository. \n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String repoName = args[0];
    Region region = Region.US_EAST_1;
    CodeCommitClient codeCommitClient = CodeCommitClient.builder().region(region).build();
    createRepo(codeCommitClient, repoName);
    codeCommitClient.close();
}
Also used : CodeCommitClient(software.amazon.awssdk.services.codecommit.CodeCommitClient) Region(software.amazon.awssdk.regions.Region)

Aggregations

Region (software.amazon.awssdk.regions.Region)13 CodeCommitClient (software.amazon.awssdk.services.codecommit.CodeCommitClient)13