Skip to content

Commit

Permalink
ci: define platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
QuadStingray committed Oct 10, 2023
1 parent dc8df6f commit 2c6445a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/all_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
strategy:
fail-fast: false
matrix:
docker-platform: [ "linux/amd64", "linux/arm/v7", "linux/arm64/v8", "linux/arm64" ]
docker-platform: [ "linux/amd64", "linux/arm64/v8", "linux/arm64" ]
steps:
- name: Git Checkout
uses: actions/[email protected]
Expand Down
17 changes: 4 additions & 13 deletions build_docker.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,19 @@ import scala.sys.process._
commands += Command.command("ci-docker")((state: State) => {
val semVersion = new Semver(version.value)
if (semVersion.isStable) {
val listOfPlatforms = List("linux/amd64", "linux/arm64/v8", "linux/arm64")

val containerName = s"mongocamp-server:${version.value}"
val listOfPlatforms = List("linux/amd64", "linux/arm/v7", "linux/arm64/v8", "linux/arm64")
val buildCommand = s"docker buildx build --platform=${listOfPlatforms.mkString(",")} . --tag $containerName"
val buildCommand = s"docker buildx build --platform=${listOfPlatforms.mkString(",")} --tag $containerName --push ."
if (buildCommand.!(ProcessLogger(stout => state.log.info(stout), sterr => state.log.info(sterr))) != 0) {
throw new Exception(s"Not zero exit code for build base image: ${containerName}")
}

val pushCommand = s"docker push $containerName"
if (pushCommand.!(ProcessLogger(stout => state.log.info(stout), sterr => state.log.info(sterr))) != 0) {
throw new Exception(s"Not zero exit code for push base image; ${containerName}")
}

// todo: reactivate build if fixed. https://github.com/oracle/graal/issues/7264
// val containerNameCached = s"mongocamp-server:${version.value}-cached"
// val buildCommandCached = s"docker buildx build --platform=${listOfPlatforms.mkString(",")} -f DockerfileJVMCached --build-arg MONGOCAMPVERSION=${version.value} --tag ${containerNameCached} ."
// val buildCommandCached = s"docker buildx build --platform=${listOfPlatforms.mkString(",")} --build-arg MONGOCAMPVERSION=${version.value} --tag ${containerNameCached} -f DockerfileJVMCached --push ."
// if (buildCommandCached.!(ProcessLogger(stout => state.log.info(stout), sterr => state.log.info(sterr))) != 0) {
// throw new Exception(s"Not zero exit code for build cached image: ${containerNameCached}")
// }
//
// val pushCommandCached = s"docker push $containerNameCached"
// if (pushCommandCached.!(ProcessLogger(stout => state.log.info(stout), sterr => state.log.info(sterr))) != 0) {
// throw new Exception(s"Not zero exit code for push cached image: ${containerNameCached}")
// }

state
Expand Down

0 comments on commit 2c6445a

Please sign in to comment.