Skip to content

Instantly share code, notes, and snippets.

@topera
Created June 9, 2018 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topera/39aa7b126dce67bf0f565cfb65bd82fd to your computer and use it in GitHub Desktop.
Save topera/39aa7b126dce67bf0f565cfb65bd82fd to your computer and use it in GitHub Desktop.
Gradle task to deploy to AWS Elastic Beanstalk using the aws cli command line tool
task deployEb(type: AWS, group: group) {
description 'Deploys application in AWS Elastic Beanstalk'
doFirst {
run "aws configure set default.region $awsRegionName"
run "aws s3 cp $buildDir/$jarLocal s3://$awsBucketName/$awsJar"
run "aws elasticbeanstalk create-application-version --application-name=$awsAppName --version-label=$buildNumber --source-bundle S3Bucket=$awsBucketName,S3Key=$awsJar"
run "aws elasticbeanstalk update-environment --environment-name=$awsEnvName --version-label=$buildNumber"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment