An SBT plugin to enable Play sites to be served statically.
How Do I Use It?
To use, add the following to your
resolvers += "play-scraper" at "https://dl.cloudsmith.io/public/netlogo/play-scraper/maven/" addSbtPlugin("org.nlogo" % "play-scraper" % "0.8.1")
enablePlugins(org.nlogo.PlayScrapePlugin) scrapeRoutes ++= Seq("/foo", "/bar.js")
You will then have access to the
scrapePlay sbt task, which will scrape the routes specified, plus play assets, and put them in
Note that version 0.7.0 is compatible only with Play 2.5. Versions of play earlier than 2.5 should use 0.6.2.
To enable uploading, set the following keys:
scrapePublishBucketID := Some("your-bucket") scrapePublishRegion := Some("us-east-1") // this is optional. When set, the distribution will be invalidated on upload scrapePublishDistributionID := Some("your-cloudfront-distribution-id")
As well as settings
scrapePublishCredentials via one of the following methods:
- profile credentials (more info), use the following:
scrapePublishCredentials := org.nlogo.PlayScrapePlugin.credentials.fromCredentialsProfile("your credential name")
- environment variables. Note that this expects
AWS_SECRET_ACCESS_KEYto be set in your environment.
scrapePublishCredentials := org.nlogo.PlayScrapePlugin.credentials.fromEnvironmentVariables
Once these values are set, running
scrapeUpload will upload the newly-created play scrape.
Note that if
scrapePublishBucketID isn't set, the task will print a warning but will not error.
How Do I Build It?
Use sbt. Test it using the
The Play Scraper plugin is in the public domain. To the extent possible under law, Uri Wilensky has waived all copyright and related or neighboring rights.
Package repository hosting is graciously provided by Cloudsmith.