use of software.amazon.awssdk.regions.Region 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.regions.Region 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.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class DeleteDeploymentGroup method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <appName> <deploymentGroupName>\n\n" + "Where:\n" + " appName - the name of the application. \n" + " deploymentGroupName - the name of the deployment group. \n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String appName = args[0];
String deploymentGroupName = args[1];
Region region = Region.US_EAST_1;
CodeDeployClient deployClient = CodeDeployClient.builder().region(region).build();
delDeploymentGroup(deployClient, appName, deploymentGroupName);
deployClient.close();
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class CreatePipeline method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <name> <roleArn> <s3Bucket> <s3OuputBucket>\n\n" + "Where:\n" + " name - the name of the pipeline to create. \n\n" + " roleArn - the Amazon Resource Name (ARN) for AWS CodePipeline to use. \n\n" + " s3Bucket - the name of the Amazon S3 bucket where the code is located. \n\n" + " s3OuputBucket - the name of the Amazon S3 bucket where the code is deployed. \n\n";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String name = args[0];
String roleArn = args[1];
String s3Bucket = args[2];
String s3OuputBucket = args[3];
Region region = Region.US_EAST_1;
CodePipelineClient pipelineClient = CodePipelineClient.builder().region(region).build();
createNewPipeline(pipelineClient, name, roleArn, s3Bucket, s3OuputBucket);
pipelineClient.close();
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class ListPipelines method main.
public static void main(String[] args) {
Region region = Region.US_EAST_1;
CodePipelineClient pipelineClient = CodePipelineClient.builder().region(region).build();
getAllPipelines(pipelineClient);
pipelineClient.close();
}
Aggregations