Skip to content

Commit

Permalink
support ARM instance. (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaackuang authored Mar 23, 2022
1 parent 9265bbb commit 1bc2bd1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
29 changes: 28 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,46 @@ ThisBuild /developers := List(
url("https://github.com/conduktor")
)
)
import scala.sys.process.Process

name := "kafka-security-manager"

version := "1.1.0-SNAPSHOT"

scalaVersion := "2.12.15"

lazy val ensureDockerBuildx = taskKey[Unit]("Ensure that docker buildx configuration exists")
lazy val dockerBuildWithBuildx = taskKey[Unit]("Build docker images using buildx")
lazy val dockerBuildxSettings = Seq(
ensureDockerBuildx := {
if (Process("docker buildx inspect multi-arch-builder").! == 1) {
Process("docker buildx create --use --name multi-arch-builder", baseDirectory.value).!
}
},
dockerBuildWithBuildx := {
streams.value.log("Building and pushing image with Buildx")
dockerAliases.value.foreach(alias =>
Process(
"docker buildx build --platform=linux/arm64,linux/amd64 --push -t " + alias + " .",
baseDirectory.value / "target" / "docker" / "stage"
).!
)
},
Docker / publish := Def
.sequential(
Docker / publishLocal,
ensureDockerBuildx,
dockerBuildWithBuildx
)
.value
)

lazy val root = (project in file("."))
.enablePlugins(JavaAppPackaging)
.enablePlugins(DockerPlugin)
.enablePlugins(ClasspathJarPlugin)
.enablePlugins(AshScriptPlugin)

.settings(dockerBuildxSettings)

resolvers ++= Seq(
"Artima Maven Repository" at "https://repo.artima.com/releases",
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.5.8
sbt.version = 1.6.2
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resolvers += Resolver.typesafeRepo("releases")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.6")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9")

resolvers += "Artima Maven Repository" at "https://repo.artima.com/releases"

Expand All @@ -12,7 +12,7 @@ addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")

addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")

Expand Down

0 comments on commit 1bc2bd1

Please sign in to comment.