Skip to content

Commit

Permalink
remove sbt-riffraff-artifact
Browse files Browse the repository at this point in the history
we use `@guardian/actions-riff-raff` now instead.
  • Loading branch information
georgeblahblah committed Oct 13, 2023
1 parent 7aed40b commit fee08c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 53 deletions.
27 changes: 0 additions & 27 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.gu.riffraff.artifact.RiffRaffArtifact.autoImport._
import play.sbt.routes.RoutesKeys
import com.typesafe.sbt.web.SbtWeb.autoImport._
import com.gu.Dependencies._
Expand Down Expand Up @@ -238,32 +237,6 @@ val main = root()
preview,
rss,
)
.settings(
riffRaffUploadArtifactBucket := Some(
System.getenv().getOrDefault("RIFF_RAFF_ARTIFACT_BUCKET", "aws-frontend-teamcity"),
),
riffRaffUploadManifestBucket := Some(
System.getenv().getOrDefault("RIFF_RAFF_BUILD_BUCKET", "aws-frontend-teamcity"),
),
riffRaffManifestProjectName := "dotcom:all",
riffRaffArtifactResources := Seq(
(admin / Universal / packageBin).value -> s"${(admin / name).value}/${(admin / Universal / packageBin).value.getName}",
(applications / Universal / packageBin).value -> s"${(applications / name).value}/${(applications / Universal / packageBin).value.getName}",
(archive / Universal / packageBin).value -> s"${(archive / name).value}/${(archive / Universal / packageBin).value.getName}",
(article / Universal / packageBin).value -> s"${(article / name).value}/${(article / Universal / packageBin).value.getName}",
(commercial / Universal / packageBin).value -> s"${(commercial / name).value}/${(commercial / Universal / packageBin).value.getName}",
(diagnostics / Universal / packageBin).value -> s"${(diagnostics / name).value}/${(diagnostics / Universal / packageBin).value.getName}",
(discussion / Universal / packageBin).value -> s"${(discussion / name).value}/${(discussion / Universal / packageBin).value.getName}",
(identity / Universal / packageBin).value -> s"${(identity / name).value}/${(identity / Universal / packageBin).value.getName}",
(facia / Universal / packageBin).value -> s"${(facia / name).value}/${(facia / Universal / packageBin).value.getName}",
(faciaPress / Universal / packageBin).value -> s"${(faciaPress / name).value}/${(faciaPress / Universal / packageBin).value.getName}",
(onward / Universal / packageBin).value -> s"${(onward / name).value}/${(onward / Universal / packageBin).value.getName}",
(preview / Universal / packageBin).value -> s"${(preview / name).value}/${(preview / Universal / packageBin).value.getName}",
(rss / Universal / packageBin).value -> s"${(rss / name).value}/${(rss / Universal / packageBin).value.getName}",
(sport / Universal / packageBin).value -> s"${(sport / name).value}/${(sport / Universal / packageBin).value.getName}",
baseDirectory.value / "riff-raff.yaml" -> "riff-raff.yaml",
),
)
val badgeHash = inputKey[Unit]("Generate special badge salts and hashes")
badgeHash := {
import java.math.BigInteger
Expand Down
27 changes: 3 additions & 24 deletions project/ProjectSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import com.gu.versioninfo.VersionInfo
import com.typesafe.sbt.packager.universal.UniversalPlugin
import sbt._
import sbt.Keys._
import com.gu.riffraff.artifact.{BuildInfo, RiffRaffArtifact}
import com.gu.riffraff.artifact.RiffRaffArtifact.autoImport._
import com.gu.Dependencies._
import play.sbt.{PlayAkkaHttpServer, PlayNettyServer, PlayScala}
import com.typesafe.sbt.SbtNativePackager.Universal
Expand Down Expand Up @@ -89,35 +87,17 @@ object ProjectSettings {
)

val testAll = taskKey[Unit]("test all aggregate projects")
val upload = taskKey[Unit]("upload riff-raff artifact from root project")
val testThenUpload =
taskKey[Unit]("Conditional task that uploads to riff raff only if tests pass")

def frontendRootSettings: Seq[Def.Setting[Task[Unit]]] =
List(
testAll := (Test / test)
.all(ScopeFilter(inAggregates(ThisProject, includeRoot = false)))
.value,
upload := (LocalRootProject / riffRaffUpload).value,
testThenUpload := Def
.taskDyn({
testAll.result.value match {
case Inc(inc) =>
Def.task[Unit] {
println("Tests failed, no riff raff upload will be performed.")
throw inc
}
case Value(_) =>
println("Tests passed, uploading artifact to riff raff.")
upload.toTask
}
})
.value,
)

def root(): Project =
Project("root", base = file("."))
.enablePlugins(PlayScala, RiffRaffArtifact, PlayNettyServer)
.enablePlugins(PlayScala, PlayNettyServer)
.disablePlugins(PlayAkkaHttpServer)
.settings(frontendCompilationSettings)
.settings(frontendRootSettings)
Expand All @@ -139,10 +119,9 @@ object ProjectSettings {
buildInfoPackage := buildInfoPackageName,
buildInfoOptions += BuildInfoOption.Traits("app.FrontendBuildInfo"),
buildInfoKeys := {
lazy val buildInfo = BuildInfo(baseDirectory.value)
Seq[BuildInfoKey](
"buildNumber" -> buildInfo.buildIdentifier,
"gitCommitId" -> buildInfo.revision,
"buildNumber" -> sys.env.get("GITHUB_RUN_NUMBER").getOrElse("unknown"),
"gitCommitId" -> sys.env.get("GITHUB_SHA").getOrElse("unknown"),
"buildTime" -> System.currentTimeMillis,
)
},
Expand Down
2 changes: 0 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.1")

addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.3.3")

addSbtPlugin("com.gu" % "sbt-riffraff-artifact" % "1.1.18")

addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.3")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0")
Expand Down

0 comments on commit fee08c7

Please sign in to comment.