Skip to content
Snippets Groups Projects
Commit 08e610ab authored by Lorenz Boguhn's avatar Lorenz Boguhn
Browse files

Make paths exchangeable by environment variables

parent a733333f
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!108Feature/185 Make Paths Configurable,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
...@@ -5,7 +5,6 @@ import mu.KotlinLogging ...@@ -5,7 +5,6 @@ import mu.KotlinLogging
import theodolite.benchmark.BenchmarkExecution import theodolite.benchmark.BenchmarkExecution
import theodolite.benchmark.KubernetesBenchmark import theodolite.benchmark.KubernetesBenchmark
import theodolite.util.YamlParser import theodolite.util.YamlParser
import java.nio.file.Paths
import kotlin.system.exitProcess import kotlin.system.exitProcess
private val logger = KotlinLogging.logger {} private val logger = KotlinLogging.logger {}
...@@ -15,19 +14,23 @@ object TheodoliteYamlExecutor { ...@@ -15,19 +14,23 @@ object TheodoliteYamlExecutor {
@JvmStatic @JvmStatic
fun main(args: Array<String>) { fun main(args: Array<String>) {
logger.info { "Theodolite started" } logger.info { "Theodolite started" }
val path = Paths.get("").toAbsolutePath().toString()
logger.info { path } val executionPath = System.getenv("THEODOLITE_EXECUTION") ?: "./config/BenchmarkExecution.yaml"
val benchmarkPath = System.getenv("THEODOLITE_BENCHMARK_TYPE") ?: "./config/BenchmarkType.yaml"
val appResource = System.getenv("THEODOLITE_RESOURCES") ?: "./config"
logger.info { "Using $executionPath for BenchmarkExecution" }
logger.info { "Using $benchmarkPath for BenchmarkType" }
logger.info { "Using $appResource for Resources" }
// load the BenchmarkExecution and the BenchmarkType // load the BenchmarkExecution and the BenchmarkType
val parser = YamlParser() val parser = YamlParser()
val benchmarkExecution = val benchmarkExecution =
parser.parse("./config/BenchmarkExecution.yaml", BenchmarkExecution::class.java)!! parser.parse(path = executionPath, E = BenchmarkExecution::class.java)!!
val benchmark = val benchmark =
parser.parse("./config/BenchmarkType.yaml", KubernetesBenchmark::class.java)!! parser.parse(path = benchmarkPath, E = KubernetesBenchmark::class.java)!!
benchmark.path = appResource
//logger.info { benchmark.name.toString() }
benchmark.path = "config/"
val executor = TheodoliteExecutor(benchmarkExecution, benchmark) val executor = TheodoliteExecutor(benchmarkExecution, benchmark)
executor.run() executor.run()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment