Skip to content

Commit

Permalink
Update Test Suite
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioPinheiro committed Jan 8, 2024
1 parent c4d4bc2 commit 81f90fd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ 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"
MEDIATOR_DID: "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwIiwiciI6W10sImEiOlsiZGlkY29tbS92MiJdfQ.SeyJ0IjoiZG0iLCJzIjoid3M6Ly9sb2NhbGhvc3Q6ODA4MC93cyIsInIiOltdLCJhIjpbImRpZGNvbW0vdjIiXX0"
DIDCOMM_V2_TESTSUITE_VERSION: "58efea198a807559fe635cb67e7e062ad1acfbca"
MEDIATOR_DID: "did:peer:2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsInIiOltdLCJhIjpbImRpZGNvbW0vdjIiXX19.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6IndzOi8vbG9jYWxob3N0OjgwODAvd3MiLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"
steps:
- name: Checkout mediator
uses: actions/checkout@v3
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 32 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -216,13 +243,16 @@ lazy val mediator = project
.settings(
Compile / mainClass := Some("io.iohk.atala.mediator.MediatorStandalone"),
Docker / maintainer := "[email protected]",
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
Expand Down

0 comments on commit 81f90fd

Please sign in to comment.