From dc641b10e867eaac62a1e188153afccacc99f6d2 Mon Sep 17 00:00:00 2001 From: davidpoltorak-io <109518299+davidpoltorak-io@users.noreply.github.com> Date: Wed, 23 Nov 2022 16:16:27 +0400 Subject: [PATCH] chore(shared): move api folder into runnable and reset build settings for dockerRepository and version.sbt (#152) * chore(shared): move API folder for mercury and prism-agent into service / runnable folder * build(mercury): revert dockerRepository change back to ghcr.io and reset version to next snapshot version 0.3.0-SNAPSHOT * chore(mercury): updated README to be clear why API folder moved --- mercury/README.md | 7 ++----- .../api/mercury-cloud-agent-openapi.yaml | 0 .../api/mercury-mediator-openapi.yaml | 1 + mercury/mercury-mediator/build.sbt | 4 ++-- mercury/mercury-mediator/version.sbt | 2 +- prism-agent/{ => service}/api/http/castor/parameters.yaml | 0 prism-agent/{ => service}/api/http/castor/schemas.yaml | 0 prism-agent/{ => service}/api/http/pollux/parameters.yaml | 0 prism-agent/{ => service}/api/http/pollux/schemas.yaml | 0 .../{ => service}/api/http/prism-agent-openapi-spec.yaml | 3 ++- prism-agent/service/build.sbt | 2 +- 11 files changed, 9 insertions(+), 10 deletions(-) rename mercury/{ => mercury-mediator}/api/mercury-cloud-agent-openapi.yaml (100%) rename mercury/{ => mercury-mediator}/api/mercury-mediator-openapi.yaml (99%) rename prism-agent/{ => service}/api/http/castor/parameters.yaml (100%) rename prism-agent/{ => service}/api/http/castor/schemas.yaml (100%) rename prism-agent/{ => service}/api/http/pollux/parameters.yaml (100%) rename prism-agent/{ => service}/api/http/pollux/schemas.yaml (100%) rename prism-agent/{ => service}/api/http/prism-agent-openapi-spec.yaml (99%) diff --git a/mercury/README.md b/mercury/README.md index 4a5c2570e5..38501e9b25 100644 --- a/mercury/README.md +++ b/mercury/README.md @@ -2,12 +2,9 @@ We are following the directory structure defined in [RFC 0013 - Service-Oriented BB API Dependency Management](https://input-output.atlassian.net/wiki/spaces/ATB/pages/3534848001/RFC+0013+-+Service-Oriented+BB+API+Dependency+Management). -**Folders:** - -- `api`: - Contains the API's for the Mercury Building Block. +> Note: The API folder has been moved into the `mercury-mediator` folder which does not conform with the published RFC - however - this change is required to ensure the CI process detects commits related to API changes and publishes the runnable image containing the API spec. - **Warning:** this folder is a dependicy of `prism-mediator`/`build.sbt`'s `apiBaseDirectory` property. +**Folders:** - `mercury-library`: Is our project implementation of the DID Comm and DID Comm protocols. diff --git a/mercury/api/mercury-cloud-agent-openapi.yaml b/mercury/mercury-mediator/api/mercury-cloud-agent-openapi.yaml similarity index 100% rename from mercury/api/mercury-cloud-agent-openapi.yaml rename to mercury/mercury-mediator/api/mercury-cloud-agent-openapi.yaml diff --git a/mercury/api/mercury-mediator-openapi.yaml b/mercury/mercury-mediator/api/mercury-mediator-openapi.yaml similarity index 99% rename from mercury/api/mercury-mediator-openapi.yaml rename to mercury/mercury-mediator/api/mercury-mediator-openapi.yaml index b6539f0ee8..c270e417e2 100644 --- a/mercury/api/mercury-mediator-openapi.yaml +++ b/mercury/mercury-mediator/api/mercury-mediator-openapi.yaml @@ -9,6 +9,7 @@ info: servers: - url: "https://k8s-dev.atalaprism.io/mediator/" + - url: "http://localhost/mediator/" tags: - name: Mailbox Mediator diff --git a/mercury/mercury-mediator/build.sbt b/mercury/mercury-mediator/build.sbt index 51ac9f3673..6c52d0d2ea 100644 --- a/mercury/mercury-mediator/build.sbt +++ b/mercury/mercury-mediator/build.sbt @@ -16,7 +16,7 @@ inThisBuild( // Custom keys val apiBaseDirectory = settingKey[File]("The base directory for Castor API specifications") -ThisBuild / apiBaseDirectory := baseDirectory.value / ".." / "api" +ThisBuild / apiBaseDirectory := baseDirectory.value / "api" ThisBuild / resolvers += Resolver.githubPackages("input-output-hk", "atala-prism-building-blocks") lazy val V = new { @@ -88,7 +88,7 @@ lazy val mediator = project githubTokenSource := TokenSource.Environment("ATALA_GITHUB_TOKEN"), // ### Build Docker Image ### Docker / maintainer := "atala-coredid@iohk.io", - Docker / dockerRepository := Some("atala-prism.io"), + Docker / dockerRepository := Some("ghcr.io"), Docker / dockerUsername := Some("input-output-hk"), Docker / githubOwner := "atala-prism-building-blocks", Docker / dockerUpdateLatest := true, diff --git a/mercury/mercury-mediator/version.sbt b/mercury/mercury-mediator/version.sbt index 5d0f74aafc..8c7e5e0d8c 100644 --- a/mercury/mercury-mediator/version.sbt +++ b/mercury/mercury-mediator/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.1.0" +ThisBuild / version := "0.3.0-SNAPSHOT" diff --git a/prism-agent/api/http/castor/parameters.yaml b/prism-agent/service/api/http/castor/parameters.yaml similarity index 100% rename from prism-agent/api/http/castor/parameters.yaml rename to prism-agent/service/api/http/castor/parameters.yaml diff --git a/prism-agent/api/http/castor/schemas.yaml b/prism-agent/service/api/http/castor/schemas.yaml similarity index 100% rename from prism-agent/api/http/castor/schemas.yaml rename to prism-agent/service/api/http/castor/schemas.yaml diff --git a/prism-agent/api/http/pollux/parameters.yaml b/prism-agent/service/api/http/pollux/parameters.yaml similarity index 100% rename from prism-agent/api/http/pollux/parameters.yaml rename to prism-agent/service/api/http/pollux/parameters.yaml diff --git a/prism-agent/api/http/pollux/schemas.yaml b/prism-agent/service/api/http/pollux/schemas.yaml similarity index 100% rename from prism-agent/api/http/pollux/schemas.yaml rename to prism-agent/service/api/http/pollux/schemas.yaml diff --git a/prism-agent/api/http/prism-agent-openapi-spec.yaml b/prism-agent/service/api/http/prism-agent-openapi-spec.yaml similarity index 99% rename from prism-agent/api/http/prism-agent-openapi-spec.yaml rename to prism-agent/service/api/http/prism-agent-openapi-spec.yaml index 45bb32ff78..036b098661 100644 --- a/prism-agent/api/http/prism-agent-openapi-spec.yaml +++ b/prism-agent/service/api/http/prism-agent-openapi-spec.yaml @@ -2,12 +2,13 @@ openapi: 3.0.1 info: title: PrismAgent OpenAPI specification description: OpenAPI specification for Decentralized Identifiers (DID) Operations - version: 1.0.0 + version: 0.1.0 contact: name: Core DID email: atala-coredid@iohk.io servers: - url: "https://k8s-dev.atalaprism.io/prism-agent/" + - url: "http://localhost/prism-agent" components: securitySchemes: diff --git a/prism-agent/service/build.sbt b/prism-agent/service/build.sbt index 8398e39dfd..94045c3f38 100644 --- a/prism-agent/service/build.sbt +++ b/prism-agent/service/build.sbt @@ -9,7 +9,7 @@ inThisBuild( Seq( organization := "io.iohk.atala", scalaVersion := "3.2.0", - apiBaseDirectory := baseDirectory.value / "../api", + apiBaseDirectory := baseDirectory.value / "api", fork := true, run / connectInput := true, versionScheme := Some("semver-spec"),