fix installKubectlAndTools
This commit is contained in:
parent
906deb4ac7
commit
e1b4dabb26
2 changed files with 4 additions and 5 deletions
|
@ -39,7 +39,7 @@ fun Prov.installKubectlAndTools(): ProvResult = task {
|
||||||
val resourcePath = "org/domaindrivenarchitecture/provs/desktop/infrastructure"
|
val resourcePath = "org/domaindrivenarchitecture/provs/desktop/infrastructure"
|
||||||
|
|
||||||
task("installKubectl") {
|
task("installKubectl") {
|
||||||
val kubeConfigFile = "~/.bashrc.d/kubectl.sh"
|
val kubeConfigFile = ".bashrc.d/kubectl.sh"
|
||||||
if (!checkFile(kubeConfigFile)) {
|
if (!checkFile(kubeConfigFile)) {
|
||||||
// prerequisites -- see https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
|
// prerequisites -- see https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
|
||||||
cmd("sudo apt-get update")
|
cmd("sudo apt-get update")
|
||||||
|
@ -48,6 +48,7 @@ fun Prov.installKubectlAndTools(): ProvResult = task {
|
||||||
cmd("echo \"deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main\" | sudo tee /etc/apt/sources.list.d/kubernetes.list")
|
cmd("echo \"deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main\" | sudo tee /etc/apt/sources.list.d/kubernetes.list")
|
||||||
|
|
||||||
// kubectl and bash completion
|
// kubectl and bash completion
|
||||||
|
cmd("sudo apt update")
|
||||||
aptInstall("kubectl")
|
aptInstall("kubectl")
|
||||||
cmd("kubectl completion bash >> /etc/bash_completion.d/kubernetes", sudo = true)
|
cmd("kubectl completion bash >> /etc/bash_completion.d/kubernetes", sudo = true)
|
||||||
createDir(".bashrc.d")
|
createDir(".bashrc.d")
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.domaindrivenarchitecture.provs.desktop.infrastructure
|
package org.domaindrivenarchitecture.provs.desktop.infrastructure
|
||||||
|
|
||||||
import org.domaindrivenarchitecture.provs.framework.core.getResourceAsText
|
import org.domaindrivenarchitecture.provs.framework.core.getResourceAsText
|
||||||
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.checkFile
|
||||||
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDir
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDir
|
||||||
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDirs
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDirs
|
||||||
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.fileContainsText
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.fileContainsText
|
||||||
|
@ -30,10 +31,7 @@ internal class DevOpsKtTest {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
assertTrue(
|
assertTrue(
|
||||||
defaultTestContainer().fileContainsText(
|
defaultTestContainer().checkFile("/etc/bash_completion.d/kubernetes", sudo = true)
|
||||||
"/etc/bash_completion.d/kubernetes",
|
|
||||||
"\nkubectl completion bash\n"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue