From fee08c7384014281579f4112abc25d1a463a5a4d Mon Sep 17 00:00:00 2001 From: George B <705427+georgeblahblah@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:37:54 +0100 Subject: [PATCH] remove sbt-riffraff-artifact we use `@guardian/actions-riff-raff` now instead. --- build.sbt | 27 --------------------------- project/ProjectSettings.scala | 27 +++------------------------ project/plugins.sbt | 2 -- 3 files changed, 3 insertions(+), 53 deletions(-) diff --git a/build.sbt b/build.sbt index e91f3db4e55d..3c701a739d3e 100644 --- a/build.sbt +++ b/build.sbt @@ -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._ @@ -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 diff --git a/project/ProjectSettings.scala b/project/ProjectSettings.scala index 033b8a5b8bf1..13b219cdb44e 100644 --- a/project/ProjectSettings.scala +++ b/project/ProjectSettings.scala @@ -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 @@ -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) @@ -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, ) }, diff --git a/project/plugins.sbt b/project/plugins.sbt index a54b30080b7e..b7623366013f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -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")