Skip to content

Commit

Permalink
Merge branch 'gamzaliev__open-source-update-1.12' into 'release-1.12'
Browse files Browse the repository at this point in the history
Updates from corporate version

See merge request development/we/node/open-source-node!10
  • Loading branch information
rgamzaliev committed Jun 8, 2023
2 parents bc8af05 + 531198b commit 8d89e7a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ publish-images-dockerhub:
- compile
- assembly-node-jar
- assembly-generator-jar
before_script:
- mkdir -p $HOME/.docker
- echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
script:
- docker login -u "${DOCKERHUB_USER}" -p "${DOCKERHUB_PASSWORD}"
- docker login -u "${REGISTRY_USER}" -p "${REGISTRY_PASSWORD}" "${REGISTRY}"

# Pull latest image for using cache
- docker pull "${REGISTRY}/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:latest" || true

Expand Down
5 changes: 3 additions & 2 deletions generator/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Test / javaOptions += "-Dnode.crypto.type=WAVES"

inConfig(Compile) {
Seq(
mainClass := Some("com.wavesenterprise.generator.GeneratorLauncher"),
mainClass := Some("com.wavesenterprise.generator.GeneratorLauncher"),
packageSrc / publishArtifact := false,
packageBin / publishArtifact := false,
packageDoc / publishArtifact := false
Expand All @@ -19,7 +19,7 @@ addArtifact(Compile / assembly / artifact, assembly)

inTask(assembly) {
Seq(
test := {},
test := {},
assemblyJarName := s"generators-${version.value}.jar",
assemblyMergeStrategy := {
case PathList("META-INF", "io.netty.versions.properties") => MergeStrategy.concat
Expand All @@ -38,6 +38,7 @@ inTask(assembly) {
case "application.conf" => MergeStrategy.concat
case path if path.endsWith("module-info.class") => MergeStrategy.discard
case PathList("google", "protobuf", xs @ _*) => MergeStrategy.first
case PathList("mozilla", "public-suffix-list.txt") => MergeStrategy.first
case other => (assembly / assemblyMergeStrategy).value(other)
}
)
Expand Down
5 changes: 3 additions & 2 deletions node/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name := "node"

inConfig(Compile) {
Seq(
mainClass := Some("com.wavesenterprise.Application"),
mainClass := Some("com.wavesenterprise.Application"),
packageSrc / publishArtifact := false,
packageBin / publishArtifact := false,
packageDoc / publishArtifact := false
Expand Down Expand Up @@ -48,7 +48,7 @@ Compile / sourceGenerators += nodeVersionSource

inTask(assembly) {
Seq(
test := {},
test := {},
assemblyJarName := s"node-${version.value}.jar",
assemblyMergeStrategy := {
case PathList("META-INF", "io.netty.versions.properties") => MergeStrategy.concat
Expand All @@ -65,6 +65,7 @@ inTask(assembly) {
case path if path.endsWith("module-info.class") => MergeStrategy.discard
case "META-INF/maven/com.kohlschutter.junixsocket/junixsocket-native-common/pom.properties" => MergeStrategy.first
case PathList("google", "protobuf", xs @ _*) => MergeStrategy.first
case PathList("mozilla", "public-suffix-list.txt") => MergeStrategy.first
case other => (assembly / assemblyMergeStrategy).value(other)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,29 @@ package com.wavesenterprise.docker
import cats.implicits._
import com.github.dockerjava.api.DockerClient
import com.github.dockerjava.core.{DefaultDockerClientConfig, DockerClientImpl}
import com.github.dockerjava.httpclient5.ApacheDockerHttpClient
import com.wavesenterprise.settings.dockerengine.DockerEngineSettings
import com.github.dockerjava.jaxrs.JerseyDockerHttpClient
import com.wavesenterprise.docker.DockerEngine.BasicAuthenticationRequestFilter

object DockerClientBuilder {
def createDockerClient(settings: DockerEngineSettings): Either[Throwable, DockerClient] = Either.catchNonFatal {
val configBuilder = DefaultDockerClientConfig.createDefaultConfigBuilder
val clientBuilder = new JerseyDockerHttpClient.Builder()
val clientBuilder = new ApacheDockerHttpClient.Builder()

settings.dockerHost.foreach(dockerHost => configBuilder.withDockerHost(dockerHost.toString))
settings.dockerAuth.foreach(dockerAuth => clientBuilder.clientRequestFilters(Array(new BasicAuthenticationRequestFilter(dockerAuth))))
settings.dockerAuth.foreach(dockerAuth => {
configBuilder.withRegistryUsername(dockerAuth.username)
configBuilder.withRegistryUsername(dockerAuth.password)
})

val config = configBuilder.build()
val dockerHttpClient = clientBuilder.dockerHost(config.getDockerHost).sslConfig(config.getSSLConfig).build()

DockerClientImpl.getInstance(config, dockerHttpClient)
}

def createDefaultApacheDockerClient(): DockerClient = {
val configBuilder = DefaultDockerClientConfig.createDefaultConfigBuilder
val clientBuilder = new ApacheDockerHttpClient.Builder()

val config = configBuilder.build()
val dockerHttpClient = clientBuilder.dockerHost(config.getDockerHost).sslConfig(config.getSSLConfig).build()
Expand Down
10 changes: 3 additions & 7 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,16 @@ object Dependencies {
"org.scalatestplus" %% "scalacheck-1-14" % "3.1.0.0"
)

val dockerJavaVersion = "3.2.5"
val dockerJavaVersion = "3.3.0"
lazy val docker = Seq(
"com.github.docker-java" % "docker-java-api" % dockerJavaVersion,
"com.github.docker-java" % "docker-java-transport-httpclient5" % dockerJavaVersion,
("com.github.docker-java" % "docker-java-transport-jersey" % dockerJavaVersion)
.exclude("com.google.guava", "guava")
.exclude("org.bouncycastle", "*")
)

lazy val itDocker = Seq(
("com.spotify" % "docker-client" % "8.16.0")
.exclude("com.google.guava", "guava")
)

lazy val itKit = scalatest ++ itDocker ++ Seq(
lazy val itKit = scalatest ++ docker ++ Seq(
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-properties" % "2.11.1",
asyncHttpClient
)
Expand Down
5 changes: 3 additions & 2 deletions transactions-signer/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ libraryDependencies ++= Dependencies.console ++

inConfig(Compile) {
Seq(
mainClass := Some("com.wavesenterprise.TxSignerApplication"),
mainClass := Some("com.wavesenterprise.TxSignerApplication"),
packageSrc / publishArtifact := false,
packageBin / publishArtifact := false,
packageDoc / publishArtifact := false
Expand All @@ -19,7 +19,7 @@ addArtifact(Compile / assembly / artifact, assembly)

inTask(assembly) {
Seq(
test := {},
test := {},
assemblyJarName := s"transactions-signer-${version.value}.jar",
assemblyMergeStrategy := {
case PathList("META-INF", "io.netty.versions.properties") => MergeStrategy.concat
Expand All @@ -29,6 +29,7 @@ inTask(assembly) {
case PathList("com", "sun", "activation", xs @ _*) => MergeStrategy.discard
case path if path.endsWith("module-info.class") => MergeStrategy.discard
case PathList("google", "protobuf", xs @ _*) => MergeStrategy.first
case PathList("mozilla", "public-suffix-list.txt") => MergeStrategy.first
case other => (assembly / assemblyMergeStrategy).value(other)
}
)
Expand Down

0 comments on commit 8d89e7a

Please sign in to comment.