Example usage for com.amazonaws.services.elasticbeanstalk AWSElasticBeanstalk createStorageLocation

List of usage examples for com.amazonaws.services.elasticbeanstalk AWSElasticBeanstalk createStorageLocation

Introduction

In this page you can find the example usage for com.amazonaws.services.elasticbeanstalk AWSElasticBeanstalk createStorageLocation.

Prototype

CreateStorageLocationResult createStorageLocation();

Source Link

Document

Simplified method form for invoking the CreateStorageLocation operation.

Usage

From source file:jp.classmethod.aws.gradle.elasticbeanstalk.AWSElasticBeanstalkUploadBundleTask.java

License:Apache License

@Override
public void upload() throws IOException {
    Project project = getProject();//from w ww.j  a  v a2 s.c  o m
    AwsBeanstalkPluginExtension ext = project.getExtensions().getByType(AwsBeanstalkPluginExtension.class);
    AWSElasticBeanstalk eb = ext.getClient();

    SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd'_'HHmmss", Locale.ENGLISH);
    df.setTimeZone(TimeZone.getDefault());
    versionLabel = String.format(Locale.ENGLISH, "%s-%s", project.getVersion().toString(),
            df.format(new Date()));

    String artifactId = project.property("artifactId").toString();

    setBucketName(eb.createStorageLocation().getS3Bucket());
    setKey(String.format(Locale.ENGLISH, "eb-apps/%s/%s-%s.%s",
            new Object[] { artifactId, artifactId, versionLabel, extension }));

    super.upload();
}

From source file:org.xmlsh.aws.gradle.elasticbeanstalk.AWSElasticBeanstalkUploadBundleTask.java

License:BSD License

@Override
public void upload() throws IOException {
    Project project = getProject();/*from w  w  w.j a va  2 s.com*/
    AwsBeanstalkPluginExtension ext = project.getExtensions().getByType(AwsBeanstalkPluginExtension.class);
    AWSElasticBeanstalk eb = ext.getClient();

    SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd'_'HHmmss");
    df.setTimeZone(TimeZone.getDefault());
    versionLabel = String.format("%s-%s", project.getVersion().toString(), df.format(new Date()));

    String artifactId = project.property("artifactId").toString();

    setBucketName(eb.createStorageLocation().getS3Bucket());
    setKey(String.format("eb-apps/%s/%s-%s.%s",
            new Object[] { artifactId, artifactId, versionLabel, extension }));

    super.upload();
}