This SBT plugin adds support for using Amazon Elastic Beanstalk.
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")
- 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
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