Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyDallas committed Oct 8, 2024
1 parent d4629dc commit e6f40ac
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 2 deletions.
59 changes: 58 additions & 1 deletion fullstack-examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
* Copyright (C) 2023-2024 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.
Expand All @@ -14,17 +14,74 @@
* limitations under the License.
*/

import com.hedera.fullstack.gradle.plugin.HelmDependencyUpdateTask
import com.hedera.fullstack.gradle.plugin.HelmInstallChartTask
import com.hedera.fullstack.gradle.plugin.HelmReleaseExistsTask
import com.hedera.fullstack.gradle.plugin.HelmTestChartTask
import com.hedera.fullstack.gradle.plugin.HelmUninstallChartTask
import com.hedera.fullstack.gradle.plugin.kind.release.KindArtifactTask

plugins {
id("com.hedera.fullstack.root")
id("com.hedera.fullstack.conventions")
id("com.hedera.fullstack.jpms-modules")
id("com.hedera.fullstack.fullstack-gradle-plugin")
}

dependencies {
// Bill of Materials
implementation(platform("com.hedera.fullstack:fullstack-bom"))
}

tasks.register<HelmInstallChartTask>("helmInstallFstChart") {
createNamespace.set(true)
namespace.set("fst-ns")
release.set("fst")
chart.set("../charts/fullstack-deployment")
}

tasks.register<HelmInstallChartTask>("helmInstallNginxChart") {
createNamespace.set(true)
namespace.set("nginx-ns")
release.set("nginx-release")
chart.set("oci://ghcr.io/nginxinc/charts/nginx-ingress")
}

tasks.register<HelmUninstallChartTask>("helmUninstallNginxChart") {
namespace.set("nginx-ns")
release.set("nginx-release")
}

tasks.register<HelmReleaseExistsTask>("helmNginxExists") {
allNamespaces.set(true)
namespace.set("nginx-ns")
release.set("nginx-release")
}

tasks.register<HelmDependencyUpdateTask>("helmDependencyUpdate") {
chartName.set("../charts/fullstack-deployment")
}

tasks.register<HelmTestChartTask>("helmTestNginxChart") {
namespace.set("nginx-ns")
release.set("nginx-release")
}

// This task will succeed because it only uninstalls if the release exists
tasks.register<HelmUninstallChartTask>("helmUninstallNotAChart") {
release.set("not-a-release")
ifExists.set(true)
}

val kindVersion = "0.20.0"

tasks.register<KindArtifactTask>("kindArtifact") { version.set(kindVersion) }

tasks.check {
dependsOn("helmInstallNginxChart")
dependsOn("helmNginxExists")
dependsOn("helmTestNginxChart")
dependsOn("helmUninstallNginxChart")
dependsOn("helmDependencyUpdate")
dependsOn("helmUninstallNotAChart")
}
16 changes: 15 additions & 1 deletion fullstack-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
* Copyright (C) 2023-2024 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.
Expand All @@ -26,12 +26,26 @@ plugins {

dependencies {
api(platform("com.hedera.fullstack:fullstack-bom"))
implementation("com.hedera.fullstack:fullstack-helm-client")
implementation(kotlin("stdlib-jdk8"))
implementation("net.swiftzer.semver:semver:1.1.2")
testImplementation("org.assertj:assertj-core:3.24.2")
testImplementation(kotlin("test"))
}

gradlePlugin {
plugins {
create("fullstackPlugin") {
id = "com.hedera.fullstack.fullstack-gradle-plugin"
group = "com.hedera.fullstack"
implementationClass = "com.hedera.fullstack.gradle.plugin.FullstackPlugin"
displayName = "Fullstack Plugin"
description =
"The Fullstack Plugin provides tools for working with Fullstack infrastructure."
}
}
}

repositories { mavenCentral() }

kotlin { jvmToolchain(21) }
Expand Down

0 comments on commit e6f40ac

Please sign in to comment.