add syspec-ide-config.yaml and syspec-office-config.yaml
This commit is contained in:
parent
0659a98532
commit
ce122ac13a
4 changed files with 24 additions and 5 deletions
|
@ -4,7 +4,6 @@ import org.domaindrivenarchitecture.provs.configuration.domain.ConfigFileName
|
||||||
import org.domaindrivenarchitecture.provs.framework.core.readFromFile
|
import org.domaindrivenarchitecture.provs.framework.core.readFromFile
|
||||||
import org.domaindrivenarchitecture.provs.framework.core.toYaml
|
import org.domaindrivenarchitecture.provs.framework.core.toYaml
|
||||||
import org.domaindrivenarchitecture.provs.framework.core.yamlToType
|
import org.domaindrivenarchitecture.provs.framework.core.yamlToType
|
||||||
import org.domaindrivenarchitecture.provs.syspec.domain.CommandSpec
|
|
||||||
import org.domaindrivenarchitecture.provs.syspec.domain.SyspecConfig
|
import org.domaindrivenarchitecture.provs.syspec.domain.SyspecConfig
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileWriter
|
import java.io.FileWriter
|
||||||
|
@ -15,10 +14,10 @@ private const val DEFAULT_CONFIG_FILE = "syspec-config.yaml"
|
||||||
internal fun findSpecConfigFromFile(file: ConfigFileName? = null): Result<SyspecConfig> = runCatching {
|
internal fun findSpecConfigFromFile(file: ConfigFileName? = null): Result<SyspecConfig> = runCatching {
|
||||||
val filePath = file?.fileName ?: DEFAULT_CONFIG_FILE
|
val filePath = file?.fileName ?: DEFAULT_CONFIG_FILE
|
||||||
if ((filePath == DEFAULT_CONFIG_FILE) && !File(filePath).exists()) {
|
if ((filePath == DEFAULT_CONFIG_FILE) && !File(filePath).exists()) {
|
||||||
// provide default config
|
// use default ide config
|
||||||
writeSpecConfigToFile(filePath, SyspecConfig(listOf(CommandSpec("echo just_for_demo", "just_for_demo"))))
|
findSpecConfigFromResource("syspec/syspec-ide-config.yaml")
|
||||||
}
|
}
|
||||||
readFromFile(filePath).yamlToType<SyspecConfig>()
|
readFromFile(filePath).yamlToType()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,5 +29,6 @@ internal fun findSpecConfigFromResource(resourcePath: String): Result<SyspecConf
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------- write ----------------------------------
|
// --------------------------------- write ----------------------------------
|
||||||
|
@Suppress("unused")
|
||||||
internal fun writeSpecConfigToFile(fileName: String = DEFAULT_CONFIG_FILE, config: SyspecConfig) =
|
internal fun writeSpecConfigToFile(fileName: String = DEFAULT_CONFIG_FILE, config: SyspecConfig) =
|
||||||
FileWriter(fileName).use { it.write(config.toYaml()) }
|
FileWriter(fileName).use { it.write(config.toYaml()) }
|
|
@ -0,0 +1,14 @@
|
||||||
|
package:
|
||||||
|
- name: "firefox"
|
||||||
|
- name: "thunderbird"
|
||||||
|
- name: "ssh"
|
||||||
|
- name: "git"
|
||||||
|
- name: "leiningen"
|
||||||
|
|
||||||
|
command:
|
||||||
|
# terraform, python, etc
|
||||||
|
- command: "tfenv -h"
|
||||||
|
- command: "python3 --version"
|
||||||
|
- command: "pip3 --version"
|
||||||
|
- command: "terraform --version"
|
||||||
|
out: "1.0.8"
|
|
@ -0,0 +1,5 @@
|
||||||
|
package:
|
||||||
|
- name: "firefox"
|
||||||
|
- name: "thunderbird"
|
||||||
|
- name: "ssh"
|
||||||
|
- name: "git"
|
Loading…
Reference in a new issue