Skip to content
Gradle plugin for deploying WARs to AWS Elastic Beanstalk.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
gradle/wrapper Update Gradle to 4.2 Nov 9, 2017
src AWS instance profile is not used by plugin (#22) Nov 26, 2018
.gitignore
CHANGELOG.md Update changelog Mar 29, 2019
LICENSE Add LICENSE Oct 12, 2017
README.md Release 0.2.2 Mar 29, 2019
build.gradle
gradlew Initial revision. Mar 24, 2015
gradlew.bat Initial revision. Mar 24, 2015
settings.gradle

README.md

gradle-beanstalk-plugin

Gradle plugin for deploying applications to AWS Elastic Beanstalk.

Usage

First, create ~/.aws/credentials with a profile for your app:

[my-profile]
aws_access_key_id=YOUR_ACCESS_KEY_ID
aws_secret_access_key=YOUR_SECRET_ACCESS_KEY

Or set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.

Next, configure some deployments in your build.gradle:

plugins {
    id "fi.evident.beanstalk" version "0.2.22"
}

// beanstalk requires unique version number for each uploaded archive
// SNAPSHOT will be replaced with 'yyyyMMdd.HHmms' label
version = '0.1-SNAPSHOT'

beanstalk {
    profile = 'my-profile' // Only required if using .aws/credentials
    s3Endpoint = "s3-eu-west-1.amazonaws.com"
    beanstalkEndpoint = "elasticbeanstalk.eu-west-1.amazonaws.com"

    deployments {
        // Example to deploy to the same env
        staging {
            file = tasks.war
            application = 'my-app'
            environment = 'my-app-staging'
        }
        // Example to create a new env for each version (to use URL swapping for blue/green deployment)
        production {
            file = tasks.productionWar
            application = 'my-app'
            environment = "my-app-${project.version.replaceAll('\\.', '-')}"
            template = 'default' // Saved configuration name to use to create each env
        }
    }
}

Finally, deploy by running gradle deploy<deployment-name>, e.g. gradle deployStaging.

You can’t perform that action at this time.