Use sbt-publish-rsync rather than our own (#28868)

This commit is contained in:
Arnout Engelen 2020-04-28 11:49:42 +02:00 committed by GitHub
parent 6b5d544deb
commit ad2bd70213
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 33 deletions

View file

@ -77,7 +77,7 @@ It is possible to release a revised documentation to the already existing releas
``` ```
1. If the generated documentation looks good, send it to Gustav: 1. If the generated documentation looks good, send it to Gustav:
```sh ```sh
sbt "akka-docs/deployRsync akkarepo@gustav.akka.io" sbt akka-docs/publishRsync
``` ```
1. Do not forget to push the new branch back to GitHub. 1. Do not forget to push the new branch back to GitHub.

View file

@ -80,7 +80,7 @@ lazy val aggregatedProjects: Seq[ProjectReference] = List[ProjectReference](
lazy val root = Project(id = "akka", base = file(".")) lazy val root = Project(id = "akka", base = file("."))
.aggregate(aggregatedProjects: _*) .aggregate(aggregatedProjects: _*)
.enablePlugins(DeployRsync) .enablePlugins(PublishRsyncPlugin)
.settings(rootSettings: _*) .settings(rootSettings: _*)
.settings(unidocRootIgnoreProjects := Seq(remoteTests, benchJmh, protobuf, protobufV3, akkaScalaNightly, docs)) .settings(unidocRootIgnoreProjects := Seq(remoteTests, benchJmh, protobuf, protobufV3, akkaScalaNightly, docs))
.settings(unmanagedSources in (Compile, headerCreate) := (baseDirectory.value / "project").**("*.scala").get) .settings(unmanagedSources in (Compile, headerCreate) := (baseDirectory.value / "project").**("*.scala").get)
@ -209,7 +209,7 @@ lazy val docs = akkaModule("akka-docs")
.settings(javacOptions += "-parameters") // for Jackson .settings(javacOptions += "-parameters") // for Jackson
.enablePlugins( .enablePlugins(
AkkaParadoxPlugin, AkkaParadoxPlugin,
DeployRsync, PublishRsyncPlugin,
NoPublish, NoPublish,
ParadoxBrowse, ParadoxBrowse,
ScaladocNoVerificationOfDiagrams, ScaladocNoVerificationOfDiagrams,

View file

@ -12,7 +12,7 @@ import sbtunidoc.GenJavadocPlugin.autoImport._
import sbt.Keys._ import sbt.Keys._
import sbt.File import sbt.File
import scala.annotation.tailrec import scala.annotation.tailrec
import DeployRsync.autoImport.deployRsyncArtifacts import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport.publishRsyncArtifacts
import sbt.ScopeFilter.ProjectFilter import sbt.ScopeFilter.ProjectFilter
@ -138,7 +138,7 @@ object UnidocRoot extends AutoPlugin {
if (JdkOptions.isJdk8) Seq("-Xdoclint:none") if (JdkOptions.isJdk8) Seq("-Xdoclint:none")
else Seq("-Xdoclint:none", "--ignore-source-errors", "--no-module-directories") else Seq("-Xdoclint:none", "--ignore-source-errors", "--no-module-directories")
}, },
deployRsyncArtifacts ++= { publishRsyncArtifacts ++= {
val releaseVersion = if (isSnapshot.value) "snapshot" else version.value val releaseVersion = if (isSnapshot.value) "snapshot" else version.value
(Compile / unidoc).value match { (Compile / unidoc).value match {
case Seq(japi, api) => case Seq(japi, api) =>

View file

@ -7,7 +7,7 @@ package akka
import com.lightbend.paradox.sbt.ParadoxPlugin import com.lightbend.paradox.sbt.ParadoxPlugin
import com.lightbend.paradox.sbt.ParadoxPlugin.autoImport._ import com.lightbend.paradox.sbt.ParadoxPlugin.autoImport._
import com.lightbend.paradox.apidoc.ApidocPlugin import com.lightbend.paradox.apidoc.ApidocPlugin
import DeployRsync.autoImport.deployRsyncArtifacts import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport._
import sbt.Keys._ import sbt.Keys._
import sbt._ import sbt._
@ -77,7 +77,7 @@ object Paradox {
name in (Compile, paradox) := "Akka", name in (Compile, paradox) := "Akka",
resolvers += Resolver.jcenterRepo, resolvers += Resolver.jcenterRepo,
ApidocPlugin.autoImport.apidocRootPackage := "akka", ApidocPlugin.autoImport.apidocRootPackage := "akka",
deployRsyncArtifacts += { publishRsyncArtifacts += {
val releaseVersion = if (isSnapshot.value) "snapshot" else version.value val releaseVersion = if (isSnapshot.value) "snapshot" else version.value
((Compile / paradox).value -> s"www/docs/akka/$releaseVersion") ((Compile / paradox).value -> s"www/docs/akka/$releaseVersion")
}) })

View file

@ -8,6 +8,7 @@ import sbt._
import sbt.Keys._ import sbt.Keys._
import java.io.File import java.io.File
import sbtwhitesource.WhiteSourcePlugin.autoImport.whitesourceIgnore import sbtwhitesource.WhiteSourcePlugin.autoImport.whitesourceIgnore
import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport.publishRsyncHost
object Publish extends AutoPlugin { object Publish extends AutoPlugin {
@ -18,6 +19,7 @@ object Publish extends AutoPlugin {
override lazy val projectSettings = Seq( override lazy val projectSettings = Seq(
pomExtra := akkaPomExtra, pomExtra := akkaPomExtra,
publishTo := Some(akkaPublishTo.value), publishTo := Some(akkaPublishTo.value),
publishRsyncHost := "akkarepo@gustav.akka.io",
credentials ++= akkaCredentials, credentials ++= akkaCredentials,
organizationName := "Lightbend Inc.", organizationName := "Lightbend Inc.",
organizationHomepage := Some(url("https://www.lightbend.com")), organizationHomepage := Some(url("https://www.lightbend.com")),
@ -61,27 +63,3 @@ object NoPublish extends AutoPlugin {
override def projectSettings = override def projectSettings =
Seq(skip in publish := true, sources in (Compile, doc) := Seq.empty, whitesourceIgnore := true) Seq(skip in publish := true, sources in (Compile, doc) := Seq.empty, whitesourceIgnore := true)
} }
object DeployRsync extends AutoPlugin {
import scala.sys.process._
import sbt.complete.DefaultParsers._
override def requires = plugins.JvmPlugin
trait Keys {
val deployRsyncArtifacts = taskKey[Seq[(File, String)]]("File or directory and a path to deploy to")
val deployRsync = inputKey[Unit]("Deploy using rsync")
}
object autoImport extends Keys
import autoImport._
override def projectSettings = Seq(
deployRsyncArtifacts := List(),
deployRsync := {
val (_, host) = (Space ~ StringBasic).parsed
deployRsyncArtifacts.value.foreach {
case (from, to) => s"rsync -rvz $from/ $host:$to" !
}
})
}

View file

@ -25,3 +25,4 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("com.hpe.sbt" % "sbt-pull-request-validator" % "1.0.0") addSbtPlugin("com.hpe.sbt" % "sbt-pull-request-validator" % "1.0.0")
addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.24") addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.24")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0") addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPlugin("com.lightbend.sbt" % "sbt-publish-rsync" % "0.2")

View file

@ -322,11 +322,11 @@ fi
echolog "Building docs and pushing to the server..." echolog "Building docs and pushing to the server..."
if [ $dry_run ]; then if [ $dry_run ]; then
echodry "Not actually pushing to server. Commands:" echodry "Not actually pushing to server. Commands:"
echodry " sbt $RELEASE_OPT deployRsync" echodry " sbt $RELEASE_OPT publishRsync"
else else
important ssh ${release_server} "cd ${release_path}/docs/akka; git add .; git commit -m 'before publishing version $version'; true" important ssh ${release_server} "cd ${release_path}/docs/akka; git add .; git commit -m 'before publishing version $version'; true"
# using Scala 2.13 here to avoid the infamous problem with missing AskSupport in classpath # using Scala 2.13 here to avoid the infamous problem with missing AskSupport in classpath
important sbt -Dakka.build.scalaVersion=2.13.0 $RELEASE_OPT "deployRsync ${release_server}" important sbt -Dakka.build.scalaVersion=2.13.0 $RELEASE_OPT publishRsync"
important ssh ${release_server} "cd ${release_path}/docs/akka; git add .; git commit -m 'publish version $version'" important ssh ${release_server} "cd ${release_path}/docs/akka; git add .; git commit -m 'publish version $version'"
fi fi