move VSCode installation from IDE desktop to office desktop
This commit is contained in:
parent
e14db18eb7
commit
de7c1225b9
3 changed files with 28 additions and 20 deletions
|
@ -137,7 +137,10 @@ fun Prov.provisionOfficeDesktop() {
|
||||||
// installNextcloudClient() might not install - might need fix and working test
|
// installNextcloudClient() might not install - might need fix and working test
|
||||||
aptInstall(COMPARE_TOOLS)
|
aptInstall(COMPARE_TOOLS)
|
||||||
|
|
||||||
// optional, as installation of these tools often fail and as they are not considered mandatory
|
// VSCode is also required in office VM (not only in IDE desktop) e.g. as editor
|
||||||
|
installVSCode("python", "clojure")
|
||||||
|
|
||||||
|
// optional, as installation of these tools often fail and as they are not mandatory
|
||||||
optional {
|
optional {
|
||||||
aptInstall(DRAWING_TOOLS)
|
aptInstall(DRAWING_TOOLS)
|
||||||
}
|
}
|
||||||
|
@ -159,7 +162,6 @@ fun Prov.provisionIdeDesktop() {
|
||||||
installHugoByDeb()
|
installHugoByDeb()
|
||||||
|
|
||||||
// IDEs
|
// IDEs
|
||||||
installVSC("python", "clojure")
|
|
||||||
installIntelliJ()
|
installIntelliJ()
|
||||||
|
|
||||||
installKubeconform()
|
installKubeconform()
|
||||||
|
|
|
@ -6,33 +6,33 @@ import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInsta
|
||||||
import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.isPackageInstalled
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.isPackageInstalled
|
||||||
|
|
||||||
|
|
||||||
fun Prov.installVSC(vararg options: String) = task {
|
fun Prov.installVSCode(vararg options: String) = task {
|
||||||
val clojureExtensions = setOf("betterthantomorrow.calva", "DavidAnson.vscode-markdownlint")
|
val clojureExtensions = setOf("betterthantomorrow.calva", "DavidAnson.vscode-markdownlint")
|
||||||
val pythonExtensions = setOf("ms-python.python")
|
val pythonExtensions = setOf("ms-python.python")
|
||||||
|
|
||||||
prerequisitesVSCinstall()
|
installVSCodePrerequisites()
|
||||||
|
|
||||||
installVSCPackage()
|
installVSCPackage()
|
||||||
installVSCodiumPackage()
|
installVSCodiumPackage()
|
||||||
|
|
||||||
if (options.contains("clojure")) {
|
if (options.contains("clojure")) {
|
||||||
installExtensionsCode(clojureExtensions)
|
installVSCodeExtensions(clojureExtensions)
|
||||||
installExtensionsCodium(clojureExtensions)
|
installVSCodiumExtensions(clojureExtensions)
|
||||||
}
|
}
|
||||||
if (options.contains("python")) {
|
if (options.contains("python")) {
|
||||||
installExtensionsCode(pythonExtensions)
|
installVSCodeExtensions(pythonExtensions)
|
||||||
installExtensionsCodium(pythonExtensions)
|
installVSCodiumExtensions(pythonExtensions)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun Prov.prerequisitesVSCinstall() = task {
|
private fun Prov.installVSCodePrerequisites() = task {
|
||||||
aptInstall("curl gpg unzip apt-transport-https")
|
aptInstall("curl gpg unzip apt-transport-https")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Suppress("unused") // only required for installation of vscode via apt
|
@Suppress("unused") // only required for installation of vscode via apt
|
||||||
private fun Prov.installVscWithApt() = task {
|
private fun Prov.installVSCodeWithApt() = task {
|
||||||
val packageName = "code"
|
val packageName = "code"
|
||||||
if (!isPackageInstalled(packageName)) {
|
if (!isPackageInstalled(packageName)) {
|
||||||
// see https://code.visualstudio.com/docs/setup/linux
|
// see https://code.visualstudio.com/docs/setup/linux
|
||||||
|
@ -62,7 +62,7 @@ private fun Prov.installVSCodiumPackage() = task {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun Prov.installExtensionsCode(extensions: Set<String>) = optional {
|
private fun Prov.installVSCodeExtensions(extensions: Set<String>) = optional {
|
||||||
var res = ProvResult(true)
|
var res = ProvResult(true)
|
||||||
for (ext in extensions) {
|
for (ext in extensions) {
|
||||||
res = cmd("code --install-extension $ext")
|
res = cmd("code --install-extension $ext")
|
||||||
|
@ -71,11 +71,11 @@ private fun Prov.installExtensionsCode(extensions: Set<String>) = optional {
|
||||||
// Settings can be found at $HOME/.config/Code/User/settings.json
|
// Settings can be found at $HOME/.config/Code/User/settings.json
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Prov.installExtensionsCodium(extensions: Set<String>) = optional {
|
private fun Prov.installVSCodiumExtensions(extensions: Set<String>) = optional {
|
||||||
var res = ProvResult(true)
|
var res = ProvResult(true)
|
||||||
for (ext in extensions) {
|
for (ext in extensions) {
|
||||||
res = cmd("codium --install-extension $ext")
|
res = ProvResult(res.success && cmd("codium --install-extension $ext").success)
|
||||||
}
|
}
|
||||||
res
|
res
|
||||||
// Settings can be found at $HOME/.config/Code/User/settings.json
|
// Settings can be found at $HOME/.config/VSCodium/User/settings.json
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package org.domaindrivenarchitecture.provs.desktop.infrastructure
|
package org.domaindrivenarchitecture.provs.desktop.infrastructure
|
||||||
|
|
||||||
|
import org.domaindrivenarchitecture.provs.framework.core.remote
|
||||||
import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall
|
||||||
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
|
import org.domaindrivenarchitecture.provs.framework.ubuntu.secret.secretSources.PromptSecretSource
|
||||||
import org.junit.jupiter.api.Assertions.assertTrue
|
import org.junit.jupiter.api.Assertions.assertTrue
|
||||||
import org.junit.jupiter.api.Disabled
|
import org.junit.jupiter.api.Disabled
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
@ -9,14 +10,19 @@ import org.junit.jupiter.api.Test
|
||||||
internal class VSCodeKtTest {
|
internal class VSCodeKtTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled("Test currently not working, needs fix. VSC is installed by snapd which is not currently supported to run inside docker")
|
@Disabled("Remote testing by updating connection details below, then enable test and run it manually.")
|
||||||
fun installVSC() {
|
// Remark: VSCode installs with snap, which does not run in container and cannot be tested by container test.
|
||||||
|
fun installVSCode() {
|
||||||
// given
|
// given
|
||||||
val a = defaultTestContainer()
|
val prov = remote("192.168.56.153", "xx", PromptSecretSource("Remote password").secret()) // machine needs openssh-server installed and sudo possible without pw
|
||||||
a.aptInstall("xvfb libgbm-dev libasound2")
|
prov.aptInstall("xvfb libgbm-dev libasound2")
|
||||||
|
|
||||||
// when
|
// when
|
||||||
val res = a.installVSC("python", "clojure")
|
val res = prov.task {
|
||||||
|
installVSCode("python", "clojure")
|
||||||
|
cmd("code -v")
|
||||||
|
cmd("codium -v")
|
||||||
|
}
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertTrue(res.success)
|
assertTrue(res.success)
|
||||||
|
|
Loading…
Reference in a new issue