Skip to content

Commit

Permalink
build(iris): automate iris-service docker release process (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
abalias committed Nov 9, 2022
1 parent a873090 commit 3327d1c
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 8 deletions.
10 changes: 10 additions & 0 deletions iris/service/CHANGELOG.md
@@ -0,0 +1,10 @@
# iris-service-v0.1.0 (2022-11-09)

### Bug Fixes

* iris: align type signature (#72 (https://github.com/input-output-hk/atala-prism-building-blocks/issues/72)) (a19a781 (https://github.com/input-output-hk/atala-prism-building-blocks/commit/a19a7814c3fc1e1cc89a861ae3942bf4a5fbad0a))

### Features

* iris: ATL-1791 Implement blockchain syncer functionality (#49 (https://github.com/input-output-hk/atala-prism-building-blocks/issues/49)) (431b657 (https://github.com/input-output-hk/atala-prism-building-blocks/commit/431b6575b8df2f4744285b1c5e2dd56072fa874c))
* shared: Add environmnet configuration for Iris DB and bump scala version in other components to enable build (#96 (https://github.com/input-output-hk/atala-prism-building-blocks/issues/96)) (a5b583f (https://github.com/input-output-hk/atala-prism-building-blocks/commit/a5b583f445b7efd31987cf9ca017bc544a877986))
41 changes: 34 additions & 7 deletions iris/service/build.sbt
@@ -1,27 +1,42 @@
import Dependencies._
import sbt.Keys.testFrameworks
import sbtghpackages.GitHubPackagesPlugin.autoImport._
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._

// Custom keys
val apiBaseDirectory = settingKey[File]("The base directory for Iris gRPC specifications")
ThisBuild / apiBaseDirectory := baseDirectory.value / "../api"

def commonProject(project: Project): Project =
project.settings(
version := "0.1.0-SNAPSHOT",
inThisBuild(
Seq(
organization := "io.iohk.atala",
scalaVersion := "3.2.0",
fork := true,
run / connectInput := true,
versionScheme := Some("semver-spec"),
githubOwner := "input-output-hk",
githubRepository := "atala-prism-building-blocks",
githubTokenSource := TokenSource.Environment("ATALA_GITHUB_TOKEN")
)
)

def commonProject(project: Project): Project =
project.settings(
githubTokenSource := TokenSource.Environment("ATALA_GITHUB_TOKEN"),
versionScheme := Some("semver-spec"),
resolvers += Resolver
.githubPackages("input-output-hk", "atala-prism-sdk"),
.githubPackages("input-output-hk"),
// Needed for Kotlin coroutines that support new memory management mode
resolvers +=
"JetBrains Space Maven Repository" at "https://maven.pkg.jetbrains.space/public/p/kotlinx-coroutines/maven",
)

// Project definitions
lazy val root = commonProject(project)
lazy val root = project
.in(file("."))
.settings(
name := "iris-service-root"
)
.aggregate(core, sql, server)

lazy val core = commonProject(project)
Expand Down Expand Up @@ -49,10 +64,22 @@ lazy val server = commonProject(project)
name := "iris-server",
libraryDependencies ++= serverDependencies,
Docker / maintainer := "atala-coredid@iohk.io",
Docker / dockerRepository := Some("atala-prism.io"),
// Docker / packageName := s"atala-prism/${packageName.value}",
Docker / dockerUsername := Some("input-output-hk"),
Docker / githubOwner := "atala-prism-building-blocks",
Docker / dockerRepository := Some("ghcr.io"),
Docker / dockerUpdateLatest := true,
dockerExposedPorts := Seq(8081),
dockerBaseImage := "openjdk:11"
)
.enablePlugins(JavaAppPackaging, DockerPlugin)
.dependsOn(core, sql)

releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
//runClean,
//runTest,
setReleaseVersion,
ReleaseStep(releaseStepTask(server / Docker / publish)),
setNextVersion
)
55 changes: 55 additions & 0 deletions iris/service/package.json
@@ -0,0 +1,55 @@
{
"name": "iris-service",
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"conventional-changelog-conventionalcommits": "^5.0.0",
"gradle-semantic-release-plugin": "1.7.3",
"husky": "^8.0.1",
"pinst": "^3.0.0",
"prettier": "^2.7.1",
"semantic-release": "^19.0.3",
"semantic-release-monorepo": "^7.0.5"
},
"extends": "semantic-release-monorepo",
"release": {
"branches": [
{
"name": "main"
},
{
"name": "prerelease/iris-service",
"prerelease": "snapshot"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec",
{
"prepareCmd": "sbt \"release release-version ${nextRelease.version} next-version ${nextRelease.version}-SNAPSHOT with-defaults\""
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"version.sbt",
"CHANGELOG.md"
],
"message": "chore(release): cut iris-service image ${nextRelease.version} release [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
}
2 changes: 1 addition & 1 deletion iris/service/project/Dependencies.scala
Expand Up @@ -9,7 +9,7 @@ object Dependencies {
val akka = "2.6.19"
val doobie = "1.0.0-RC2"
val zioCatsInterop = "3.3.0"
val prismSdk = "v1.3.3-snapshot-1657194253-992dd96"
val prismSdk = "v1.4.1"
val shared = "0.1.0"
val enumeratum = "1.7.0"
val zioTest = "2.0.2"
Expand Down
1 change: 1 addition & 0 deletions iris/service/project/plugins.sbt
@@ -1,3 +1,4 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.11")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
1 change: 1 addition & 0 deletions iris/service/version.sbt
@@ -0,0 +1 @@
ThisBuild / version := "0.1.0-SNAPSHOT"

0 comments on commit 3327d1c

Please sign in to comment.