Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Latest commit

 

History

History
102 lines (67 loc) · 2.03 KB

README.md

File metadata and controls

102 lines (67 loc) · 2.03 KB

sbt-aws-eb

This SBT plugin adds support for using Amazon Elastic Beanstalk.

Installation

Add this to your project/plugins.sbt file:

resolvers += "Sonatype OSS Release Repository" at "https://oss.sonatype.org/content/repositories/releases/"

addSbtPlugin("com.chatwork" % "sbt-aws-eb" % "1.0.39")

Usage

  • Please set the required files to the application bundle to ebBundleTargetFiles.
region in aws := com.amazonaws.regions.Regions.AP_NORTHEAST_1

ebBundleTargetFiles in aws <<= Def.task {
  val base = baseDirectory.value
  val packageJarFile = (packageBin in Compile).value
  Seq(
    (base / "Dockerfile", "Dockerfile"),
    (base / "Dockerrun.aws.json", "Dockerrun.aws.json"),
    (packageJarFile, packageJarFile.name)
  )
}

ebS3BucketName in aws := "sbt-aws-eb"

ebS3CreateBucket in aws := true // if necessary
  • Build application-bundle
$ sbt aws::ebBuildBundle
  • Upload application-bundle
$ sbt aws::ebUploadBundle
  • Create Application
$ sbt aws::ebApplicationCreateOrUpdateAndWait
  • Create Configuration Template
$ sbt aws::ebConfigurationTemplateCreateOrUpdate
  • Create Application Version
$ sbt aws::ebApplicationVersionCreateOrUpdateAndWait
  • Create Environment(env parameter is Environment Name, It's a dynamic option that does not use the value(ebEnvironmentName) of the on build.sbt.)
$ sbt aws::ebEnvironmentCreateOrUpdateAndWait [env=staging]
  • List Available Solution Stacks
aws::ebListAvailableSolutionStacks

Auto Deploying

Add this to your build.sbt file.

ebDeploySettings

Execute auto deploying command.

$ sbt aws::ebDeploy

Following is aws::ebDeploy's automatic task process.

aws::ebEnvironmentCreateOrUpdateAndWait -> aws::ebApplicationVersionCreateOrUpdateAndWait -> aws::ebConfigurationTemplateCreateOrUpdate -> aws::ebApplicationCreateOrUpdateAndWait

Appendix

Play2 Application Integration by sbt-assembly