An SBT plugin to enable Play sites to be served statically.
To use, add the following to your plugins.sbt
resolvers += "play-scraper" at "https://dl.cloudsmith.io/public/netlogo/play-scraper/maven/"
addSbtPlugin("org.nlogo" % "play-scraper" % "0.8.1")In your build.sbt, add:
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 target/play-scrape.
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_ACCESS_KEY_ID/AWS_ACCESS_KEYandAWS_SECRET_KEY/AWS_SECRET_ACCESS_KEYto be set in your environment.
scrapePublishCredentials := org.nlogo.PlayScrapePlugin.credentials.fromEnvironmentVariablesOnce 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.
Use sbt. Test it using the scripted task.
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.
