add kubeconform
This commit is contained in:
parent
7a506e07d4
commit
d187a8423c
3 changed files with 51 additions and 0 deletions
|
@ -160,4 +160,6 @@ fun Prov.provisionIdeDesktop() {
|
||||||
// IDEs
|
// IDEs
|
||||||
installVSC("python", "clojure")
|
installVSC("python", "clojure")
|
||||||
installIntelliJ()
|
installIntelliJ()
|
||||||
|
|
||||||
|
installKubeconform()
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package org.domaindrivenarchitecture.provs.desktop.infrastructure
|
||||||
|
|
||||||
|
import org.domaindrivenarchitecture.provs.framework.core.Prov
|
||||||
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDirs
|
||||||
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.web.base.downloadFromURL
|
||||||
|
|
||||||
|
|
||||||
|
fun Prov.installKubeconform() = task {
|
||||||
|
// check for latest stable release on: https://github.com/yannh/kubeconform/releases
|
||||||
|
val version = "0.6.4"
|
||||||
|
val installationPath = "~/bin/"
|
||||||
|
val filename = "kubeconform-linux-amd64"
|
||||||
|
val packedFilename = "$filename.tar.gz"
|
||||||
|
|
||||||
|
createDirs(installationPath)
|
||||||
|
|
||||||
|
downloadFromURL(
|
||||||
|
"https://github.com/yannh/kubeconform/releases/download/v$version/$packedFilename",
|
||||||
|
path = installationPath,
|
||||||
|
sha256sum = "2b4ebeaa4d5ac4843cf8f7b7e66a8874252b6b71bc7cbfc4ef1cbf85acec7c07"
|
||||||
|
)
|
||||||
|
cmd("tar -xvf $packedFilename", installationPath)
|
||||||
|
cmd("chmod +x kubeconform", installationPath)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package org.domaindrivenarchitecture.provs.desktop.infrastructure
|
||||||
|
|
||||||
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.checkFile
|
||||||
|
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
|
||||||
|
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assertions.*
|
||||||
|
|
||||||
|
class KubeconformKtTest {
|
||||||
|
|
||||||
|
@ContainerTest
|
||||||
|
fun installKubeconform() {
|
||||||
|
// given
|
||||||
|
val prov = defaultTestContainer()
|
||||||
|
|
||||||
|
// when
|
||||||
|
val res = prov.installKubeconform()
|
||||||
|
|
||||||
|
// then
|
||||||
|
assertTrue(res.success)
|
||||||
|
assertTrue(prov.checkFile("bin/kubeconform"))
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue