Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Package as a debian artifact #27758

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ jobs:
-Duser.timezone=Australia/Sydney \
-jar ./bin/sbt-launch.jar clean compile assets scalafmtCheckAll test Universal/packageBin


- name: Admin Debian Package
run: |
java \
-Xmx6144M \
-XX:ReservedCodeCacheSize=128m \
-Dsbt.log.noformat=true \
-XX:+UseParallelGC \
-DAPP_SECRET="fake_secret" \
-Duser.timezone=Australia/Sydney \
-jar ./bin/sbt-launch.jar admin/Debian/packageBin

- name: Test Summary
uses: test-summary/action@v2
with:
Expand All @@ -71,6 +83,7 @@ jobs:
- static/hash
admin:
- admin/target/universal/admin.zip
- admin/target/admin_0.1.0-SNAPSHOT_all.deb
applications:
- applications/target/universal/applications.zip
archive:
Expand Down
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ val sport = application("sport")
val discussion = application("discussion").dependsOn(commonWithTests).aggregate(common)

val admin = application("admin")
.enablePlugins(JDebPackaging, SystemdPlugin)
.dependsOn(commonWithTests)
.aggregate(common)
.settings(
Expand Down
13 changes: 8 additions & 5 deletions project/ProjectSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package com.gu

import com.gu.versioninfo.VersionInfo
import com.typesafe.sbt.packager.universal.UniversalPlugin
import sbt._
import sbt.Keys._
import com.gu.Dependencies._
import play.sbt.{PlayPekkoHttpServer, PlayNettyServer, PlayScala}
import sbt.*
import sbt.Keys.*
import com.gu.Dependencies.*
import play.sbt.{PlayNettyServer, PlayPekkoHttpServer, PlayScala}
import com.typesafe.sbt.SbtNativePackager.Universal
import com.typesafe.sbt.packager.Keys.packageName
import com.typesafe.sbt.packager.archetypes.systemloader.SystemdPlugin
import com.typesafe.sbt.packager.debian.JDebPackaging
import sbtbuildinfo.{BuildInfoKey, BuildInfoOption, BuildInfoPlugin}
import sbtbuildinfo.BuildInfoKeys.{buildInfoKeys, buildInfoOptions, buildInfoPackage}

Expand Down Expand Up @@ -60,7 +62,8 @@ object ProjectSettings {
}

val frontendTestSettings = Seq(
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-u", s"test-results/scala-${scalaVersion.value}", "-o"),
Test / testOptions += Tests
.Argument(TestFrameworks.ScalaTest, "-u", s"test-results/scala-${scalaVersion.value}", "-o"),
concurrentRestrictions in Global := List(Tags.limit(Tags.Test, 4)),
// Copy unit test resources https://groups.google.com/d/topic/play-framework/XD3X6R-s5Mc/discussion
Test / unmanagedClasspath += (baseDirectory map { bd => Attributed.blank(bd / "test") }).value,
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ logLevel := Level.Warn
libraryDependencies ++= Seq(
"joda-time" % "joda-time" % "2.12.7",
"org.joda" % "joda-convert" % "2.2.3",
"org.vafer" % "jdeb" % "1.13" artifacts Artifact("jdeb", "jar", "jar"),
)

resolvers ++= Resolver.sonatypeOssRepos("releases")
Expand Down