-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate sbt-gh-pages to create GH Pages from Scaladoc
- Loading branch information
1 parent
34cdaa0
commit a03ce7b
Showing
9 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" | ||
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv" | ||
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} | ||
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} | ||
|
||
git config --global user.name "$USER" | ||
git config --global user.email "$TRAVIS_BUILD_NUMBER@$TRAVIS_COMMIT" | ||
|
||
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in project/travis-deploy-key.enc -out project/travis-deploy-key -d | ||
chmod 600 project/travis-deploy-key | ||
|
||
eval "$(ssh-agent -s)" | ||
ssh-add project/travis-deploy-key | ||
|
||
sbt ghpagesPushSite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport._ | ||
import com.typesafe.sbt.site.SitePlugin.autoImport.makeSite | ||
import com.typesafe.sbt.SbtGit.GitKeys.{gitBranch, gitRemoteRepo} | ||
|
||
import sbt.Keys._ | ||
import sbt._ | ||
|
||
object ScalaDocSettings { | ||
|
||
val settings = Seq( | ||
ghpagesPushSite := (ghpagesPushSite dependsOn makeSite).value, | ||
ghpagesNoJekyll := false, | ||
gitRemoteRepo := "[email protected]:snowplow/snowplow-scala-analytics-sdk.git", | ||
gitBranch := Some("gh-pages"), | ||
excludeFilter in ghpagesCleanSite := "index.html" | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
# This script is used for initializing the gh-pages branch | ||
|
||
PROJECT_NAME=snowplow-scala-analytics-sdk | ||
[email protected]:snowplow/snowplow-scala-analytics-sdk.git | ||
|
||
# Using a fresh, temporary clone is safest for this procedure | ||
pushd /tmp | ||
git clone $PROJECT_REPO | ||
cd $PROJECT_NAME | ||
|
||
# Create branch with no history or content | ||
git checkout --orphan gh-pages | ||
git rm -rf . | ||
|
||
# Create index.html file in order to redirect main page | ||
# to /latest/api | ||
cat > index.html <<- EOM | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Project Documentation</title> | ||
<script language="JavaScript"> | ||
<!-- | ||
function doRedirect() | ||
{ | ||
window.location.replace("latest/api"); | ||
} | ||
doRedirect(); | ||
//--> | ||
</script> | ||
</head> | ||
<body> | ||
<a href="latest/api">Go to the project documentation | ||
</a> | ||
</body> | ||
</html> | ||
EOM | ||
|
||
git add index.html | ||
|
||
# Establish the branch existence | ||
git commit --allow-empty -m "Initialize gh-pages branch" | ||
git push origin gh-pages | ||
|
||
# Return to original working copy clone, we're finished with the /tmp one | ||
popd | ||
rm -rf /tmp/$PROJECT_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Project Documentation</title> | ||
<script language="JavaScript"> | ||
<!-- | ||
function doRedirect() | ||
{ | ||
window.location.replace("latest/api"); | ||
} | ||
|
||
doRedirect(); | ||
//--> | ||
</script> | ||
</head> | ||
<body> | ||
<a href="latest/api">Go to the project documentation | ||
</a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.3") | ||
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.5.0") | ||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") | ||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.0") | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3") |
Binary file not shown.