From 5a88036bde21a59801cc6d774004822da35dac6f Mon Sep 17 00:00:00 2001 From: FabioPinheiro Date: Mon, 8 Jan 2024 20:45:22 +0000 Subject: [PATCH] Update Test Suite --- .github/workflows/integration-tests.yml | 2 +- README.md | 7 +++-- build.sbt | 34 +++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 6f125440..5a349e99 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -25,7 +25,7 @@ jobs: ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }} ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} REPORTS_DIR: "didcomm-v2-mediator-test-suite/target/site/serenity" - DIDCOMM_V2_TESTSUITE_VERSION: "13882b256bfdbe8ba738c2798dffc0ce25ca52e4" + DIDCOMM_V2_TESTSUITE_VERSION: "58efea198a807559fe635cb67e7e062ad1acfbca" MEDIATOR_DID: "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ.SeyJ0IjoiZG0iLCJzIjoid3M6Ly9sb2NhbGhvc3Q6ODA4MC93cyIsInIiOltdLCJhIjpbImRpZGNvbW0vdjIiXX0" steps: - name: Checkout mediator diff --git a/README.md b/README.md index 9df66ef7..e2159efb 100644 --- a/README.md +++ b/README.md @@ -114,11 +114,14 @@ By default mediator will start on port 8080 You can open the `http://localhost:8080/` URL in a web browser, and it will show a QR code that serves as an out-of-band invitation for the Mediator. ## How to run mediator as docker image + ### Docker only + It is possible to run everything with a single command with Docker compose docker-compose.yml The latest stable image version is available in the IOHK repositories. -To build a docker image locally, run NODE_OPTIONS=--openssl-legacy-provider sbt docker:publishLocal. -``` +To build a docker image locally, run `NODE_OPTIONS=--openssl-legacy-provider sbt docker:publishLocal`. + +```shell shell> cd atala-prism-mediator shell> NODE_OPTIONS=--openssl-legacy-provider sbt docker:publishLocal shell> MEDIATOR_VERSION=$(sbt "print mediator/version" --error) docker-compose up diff --git a/build.sbt b/build.sbt index 230a1957..fd769d27 100644 --- a/build.sbt +++ b/build.sbt @@ -7,6 +7,33 @@ inThisBuild( ) ) +import scala.sys.process.Process +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 +) + /** Versions */ lazy val V = new { val scalaDID = "0.1.0-M17" @@ -216,13 +243,16 @@ lazy val mediator = project .settings( Compile / mainClass := Some("io.iohk.atala.mediator.MediatorStandalone"), Docker / maintainer := "atala-coredid@iohk.io", - Docker / dockerUsername := Some("input-output-hk"), - Docker / dockerRepository := Some("ghcr.io"), + // Docker / dockerUsername := Some("input-output-hk"), + // Docker / dockerRepository := Some("ghcr.io"), + Docker / dockerUsername := Some("fabio"), + Docker / dockerRepository := Some("registry.fmgp.app"), Docker / packageName := "atala-prism-mediator", dockerExposedPorts := Seq(8080), dockerBaseImage := "openjdk:11", dockerUpdateLatest := true, ) + .settings(dockerBuildxSettings) .settings(Test / parallelExecution := false) .settings( // WebScalaJSBundlerPlugin