Docs: use different local directory for ghpages repository for snapshots and stable updates.

This commit is contained in:
Mark Harrah 2013-09-22 13:46:34 -04:00
parent 558029eee8
commit 5ecc16df24
1 changed files with 8 additions and 0 deletions

View File

@ -39,6 +39,7 @@ object Docs
def ghPagesSettings = ghpages.settings ++ Seq(
git.remoteRepo := "git@github.com:sbt/sbt.github.com.git",
localRepoDirectory,
ghkeys.synchLocal <<= synchLocalImpl,
cnameFile <<= (sourceDirectory in SphinxSupport.Sphinx) / "CNAME",
latestRelease in ThisBuild := false,
@ -46,6 +47,13 @@ object Docs
GitKeys.gitBranch in ghkeys.updatedRepository := Some("master")
)
def localRepoDirectory = ghkeys.repository := {
// distinguish between building to update the site or not so that CI jobs
// that don't commit+publish don't leave uncommitted changes in the working directory
val status = if(isSnapshot.value) "snapshot" else "public"
Path.userHome / ".sbt" / "ghpages" / status / organization.value / name.value
}
def siteIncludeSxr(prefix: String) = Seq(
mappings in sxr <<= sxr.map(dir => Path.allSubpaths(dir).toSeq),
site.addMappingsToSiteDir(mappings in sxr, prefix)