diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt index 2f8f35d..0da3e0b 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt @@ -71,6 +71,7 @@ fun Prov.installKubeconform() = task { sha256sum = "2b4ebeaa4d5ac4843cf8f7b7e66a8874252b6b71bc7cbfc4ef1cbf85acec7c07" ) cmd("sudo tar -xzf $packedFilename -C $installationPath", tmpDir) + deleteFile("$tmpDir/$packedFilename") } else { ProvResult(true, out = "Kubeconform $version already installed") } @@ -95,6 +96,7 @@ fun Prov.installKubectl() = task { sha256sum = "4685bfcf732260f72fce58379e812e091557ef1dfc1bc8084226c7891dd6028f" ) cmd("sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl", dir = tmpDir) + deleteFile("$tmpDir/kubectl") } fun Prov.configureKubectlBashCompletion() = task { diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Gopass.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Gopass.kt index 3ba0783..a9d6ad6 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Gopass.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Gopass.kt @@ -5,6 +5,7 @@ import org.domaindrivenarchitecture.provs.framework.core.ProvResult import org.domaindrivenarchitecture.provs.framework.core.Secret import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.* import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall +import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.checkPackage import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.isPackageInstalled import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.base.gpgFingerprint import org.domaindrivenarchitecture.provs.framework.ubuntu.web.base.downloadFromURL @@ -17,7 +18,7 @@ fun Prov.installGopass( sha256sum: String = "409ed5617e64fa2c781d5e2807ba7fcd65bc383a4e110f410f90b590e51aec55" ) = taskWithResult { - if (isPackageInstalled("gopass") && !enforceVersion) { + if (checkPackage("gopass") && !enforceVersion) { return@taskWithResult ProvResult(true) } if (checkGopassVersion(version)) { @@ -37,8 +38,10 @@ fun Prov.installGopass( if (result.success) { cmd("sudo dpkg -i $path/gopass_${version}_linux_amd64.deb") // Cross-check if installation was successful + deleteFile("$path/$filename") return@taskWithResult ProvResult(checkGopassVersion(version)) } else { + deleteFile("$path/$filename") return@taskWithResult ProvResult(false, err = "Gopass could not be installed. " + result.err) } } diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GraalVM.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GraalVM.kt index 5e1df62..83aedbb 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GraalVM.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GraalVM.kt @@ -2,6 +2,7 @@ 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.filesystem.base.deleteFile import org.domaindrivenarchitecture.provs.framework.ubuntu.web.base.downloadFromURL const val GRAAL_VM_VERSION = "21.0.2" @@ -23,6 +24,7 @@ fun Prov.installGraalVM() = task { ) createDirs(installationPath, sudo = true) cmd("sudo tar -C $installationPath -xzf $packedFilename", tmpDir) + deleteFile("$tmpDir/$packedFilename") val graalInstPath = installationPath + (cmd("ls /usr/lib/jvm/|grep -e graalvm-community-openjdk-$GRAAL_VM_VERSION").out?.replace("\n", "")) cmd("sudo ln -sf $graalInstPath/lib/svm/bin/native-image /usr/local/bin/native-image") } diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Hugo.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Hugo.kt index a149fad..2a5ff2a 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Hugo.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Hugo.kt @@ -1,6 +1,7 @@ package org.domaindrivenarchitecture.provs.desktop.infrastructure import org.domaindrivenarchitecture.provs.framework.core.Prov +import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.deleteFile import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.userHome import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptPurge @@ -26,6 +27,7 @@ fun Prov.installHugoByDeb() = task { aptInstall("gnupg2") downloadFromURL(downloadUrl, filename, downloadDir, sha256sum = sha256sum) cmd("dpkg -i $downloadDir/$filename", sudo = true) + deleteFile("$downloadDir/$filename") } }