Last active
January 1, 2020 21:09
-
-
Save TomLous/6f44692f16507e9f50c54ccccc26c9f7 to your computer and use it in GitHub Desktop.
build.sbt part 4 for Medium Post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Task to create helm chart | |
lazy val createImporterHelmChart: Def.Initialize[Task[Seq[File]]] = Def.task { | |
val chartFile = baseDirectory.value / "helm" / "Chart.yaml" | |
val valuesFile = baseDirectory.value / "helm" / "values.yaml" | |
val chartContents = | |
s"""# Generated by build.sbt. Please don't manually update | |
|apiVersion: v1 | |
|name: $domain-${name.value} | |
|version: ${version.value} | |
|appVersion: ${version.value} | |
|description: Sample ETL Job for Medium Post | |
|home: http://bit.ly/spark-k8s | |
|sources: | |
| - https://github.com/TomLous/medium-spark-k8s | |
|maintainers: | |
| - name: Tom Lous | |
| email: [email protected] | |
| url: https://lous.info | |
|""".stripMargin | |
val valuesContents = | |
s"""# Generated by build.sbt. Please don't manually update | |
|version: ${version.value} | |
|sparkVersion: ${sparkVersion} | |
|image: $domain/${name.value}:${version.value} | |
|imageRegistry: | |
|jar: local://$targetDockerJarPath/$domain-${name.value}.jar | |
|mainClass: ${(Compile / run / mainClass).value.getOrElse("__MAIN_CLASS__")} | |
|fileDependencies: [] | |
|""".stripMargin | |
IO.write(chartFile, chartContents) | |
IO.write(valuesFile, valuesContents) | |
Seq(chartFile, valuesFile) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment