Skip to content

Commit

Permalink
feat: add Gradle build docker image tasks (#408)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <jeromy@swirldslabs.com>
  • Loading branch information
jeromy-cannon authored Oct 19, 2023
1 parent 7b717ab commit 338cf40
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 12 deletions.
36 changes: 36 additions & 0 deletions docker/kubectl-bats/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id("com.palantir.docker") version "0.35.0"
}

var repo = "ghcr.io"
var registry = "hashgraph/full-stack-testing"
var containerName = "kubectl-bats"
var appVersion = project.version.toString()

docker {
name = "${repo}/${registry}/${containerName}:${appVersion}"
version = appVersion
buildx(true)
if (!System.getenv("CI").isNullOrEmpty()) {
platform("linux/arm64", "linux/amd64")
push(true)
} else {
load(true) // loads the image into the local docker daemon, doesn't support multi-platform
}
}
36 changes: 36 additions & 0 deletions docker/ubi8-init-dind/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id("com.palantir.docker") version "0.35.0"
}

var repo = "ghcr.io"
var registry = "hashgraph/full-stack-testing"
var containerName = "ubi8-init-dind"
var appVersion = project.version.toString()

docker {
name = "${repo}/${registry}/${containerName}:${appVersion}"
version = appVersion
buildx(true)
if (!System.getenv("CI").isNullOrEmpty()) {
platform("linux/arm64", "linux/amd64")
push(true)
} else {
load(true) // loads the image into the local docker daemon, doesn't support multi-platform
}
}
37 changes: 37 additions & 0 deletions docker/ubi8-init-java17/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id("com.palantir.docker") version "0.35.0"
}

var repo = "ghcr.io"
var registry = "hashgraph/full-stack-testing"
var containerName = "ubi8-init-java17"
var appVersion = project.version.toString()

docker {
name = "${repo}/${registry}/${containerName}:${appVersion}"
version = appVersion
files("entrypoint.sh", "network-node.service")
buildx(true)
if (!System.getenv("CI").isNullOrEmpty()) {
platform("linux/arm64", "linux/amd64")
push(true)
} else {
load(true) // loads the image into the local docker daemon, doesn't support multi-platform
}
}
2 changes: 1 addition & 1 deletion fullstack-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

plugins {
id("java-gradle-plugin")
id("com.gradle.plugin-publish").version("1.2.1")
id("com.gradle.plugin-publish") version "1.2.1"
id("com.hedera.fullstack.root")
id("com.hedera.fullstack.conventions")
id("com.hedera.fullstack.maven-publish")
Expand Down
25 changes: 14 additions & 11 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,26 @@
* limitations under the License.
*/

pluginManagement {
includeBuild("build-logic")
// includeBuild("fullstack-gradle-plugin")
}
pluginManagement { includeBuild("build-logic") }

plugins {
id("com.gradle.enterprise").version("3.14.1")
id("com.gradle.enterprise") version "3.14.1"
id("com.hedera.fullstack.settings")
// id("com.hedera.fullstack.fullstack-gradle-plugin")
}

dependencyResolutionManagement {
// includeBuild("fullstack-gradle-plugin")
}

rootProject.name = "full-stack-testing"

includeBuild(".") // https://github.com/gradlex-org/java-module-dependencies/issues/26

// Include the subprojects
include(":docker-kubectl-bats", "docker/kubectl-bats")

include(":docker-ubi8-init-dind", "docker/ubi8-init-dind")

include(":docker-ubi8-init-java17", "docker/ubi8-init-java17")

include(":fullstack-bom")

// Include the subprojects
include(":fullstack-alerting-api")

include(":fullstack-alerting-core")
Expand Down Expand Up @@ -95,3 +93,8 @@ gradleEnterprise {
}
}
}

fun include(name: String, path: String) {
include(name)
project(name).projectDir = File(rootDir, path)
}

0 comments on commit 338cf40

Please sign in to comment.