Skip to content

Commit

Permalink
Remove traces of TeamCity (#26642)
Browse files Browse the repository at this point in the history
* Remove teamcity-specific artifacts

We moved to building with GitHub Actions in #26058 and so we do not need to keep TeamCity-related code around.

* remove sbt-riffraff-artifact

we use `@guardian/actions-riff-raff` now instead.
  • Loading branch information
georgeblahblah authored Oct 16, 2023
1 parent 9ddd439 commit dd6832b
Show file tree
Hide file tree
Showing 18 changed files with 7 additions and 423 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
5 changes: 0 additions & 5 deletions common/app/common/configuration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,6 @@ class GuardianConfiguration extends GuLogging {
lazy val token = configuration.getStringProperty("github.token")
}

object teamcity {
lazy val host = configuration.getMandatoryStringProperty("teamcity.host")
lazy val internalHost = configuration.getMandatoryStringProperty("teamcity.internalhost")
}

object ajax {
lazy val url = configuration.getStringProperty("ajax.url").getOrElse("")
lazy val nonSecureUrl =
Expand Down
3 changes: 0 additions & 3 deletions common/conf/env/DEVINFRA.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ weather.api.key=none

images.signature-salt=none

teamcity.host=
riffraff.url=

#general
Expand Down Expand Up @@ -106,8 +105,6 @@ weather.api.key=none
# Radiator
riffraff.url=https://localhost
riffraff.apikey=none
teamcity.host=http://localhost
teamcity.internalhost=http://localhost

facebook.graphApi.accessToken=fake-access-token

Expand Down
116 changes: 0 additions & 116 deletions dev/post-integration-test-hook.sh

This file was deleted.

9 changes: 0 additions & 9 deletions dev/teamcity/dist-assetmonitor-tc

This file was deleted.

51 changes: 0 additions & 51 deletions dev/teamcity/dist-assets-tc

This file was deleted.

14 changes: 0 additions & 14 deletions dev/teamcity/dist-npm-tc

This file was deleted.

39 changes: 0 additions & 39 deletions dev/teamcity/dist-publish-assets-tc

This file was deleted.

11 changes: 0 additions & 11 deletions dev/teamcity/test-root-tc

This file was deleted.

6 changes: 1 addition & 5 deletions docs/03-dev-howtos/10-testing-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,4 @@ The simplest way to do that is to spin up a new Auto scaling Group in environmen
1. delete the ASG and Launch config

## Building a branch with frontend
1. click the ... icon next to Run in [dotcom frontend](https://teamcity.gutools.co.uk/viewType.html?buildTypeId=dotcom_master) build
1. change the BranchName in the parameters screen to your branch
1. run the build - it will create the build and upload to riffraff
1. deploy the build with riffraff to TEST

1. deploy the build of your branch with riffraff to TEST
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
"jest": "^26.6.3",
"jest-environment-jsdom": "^26.6.2",
"jest-environment-jsdom-global": "^2.0.4",
"jest-teamcity-reporter": "^0.6.2",
"listr": "^0.14.3",
"lodash.merge": "^4.6.2",
"lodash.takewhile": "^4.6.0",
Expand Down Expand Up @@ -207,7 +206,6 @@
"ophan/ng": "ophan-tracker-js",
"ophan/embed": "ophan-tracker-js/build/ophan.embed"
},
"testResultsProcessor": "jest-teamcity-reporter",
"setupFilesAfterEnv": [
"<rootDir>/dev/jest.setupTestFrameworkScriptFile.js"
],
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
Loading

0 comments on commit dd6832b

Please sign in to comment.