From 2071128371f7ed97806fd8aa1620fe8191946bf8 Mon Sep 17 00:00:00 2001 From: ansgarz Date: Thu, 17 Aug 2023 21:20:34 +0200 Subject: [PATCH] [skip ci] reformat & remove code --- .../provs/desktop/domain/KnownHost.kt | 5 ++++- .../provs/desktop/domain/KnownHostService.kt | 4 +--- .../provs/desktop/infrastructure/DevOps.kt | 14 -------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/KnownHost.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/KnownHost.kt index fa51e38..443bd3a 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/KnownHost.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/KnownHost.kt @@ -7,7 +7,10 @@ package org.domaindrivenarchitecture.provs.desktop.domain */ typealias HostKey = String -open class KnownHost protected constructor(val hostName: String, val hostKeys: List) { +open class KnownHost protected constructor( + val hostName: String, + val hostKeys: List +) { companion object { val GITHUB = KnownHost( "github.com", listOf( diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/KnownHostService.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/KnownHostService.kt index 77e6e0f..4ceb6bb 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/KnownHostService.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/KnownHostService.kt @@ -6,8 +6,6 @@ import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.base.addKnownHos fun Prov.addKnownHosts(knownHosts: List = KnownHost.values()) = task { for (knownHost in knownHosts) { - with(knownHost) { - addKnownHost(hostName, hostKeys, verifyKeys = true) - } + addKnownHost(knownHost.hostName, knownHost.hostKeys, verifyKeys = true) } } \ No newline at end of file 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 178f201..50c4563 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt @@ -15,10 +15,6 @@ fun Prov.installDevOps() = task { installTerraform() installKubectlAndTools() installYq() - // TODO: the can be removed - installAwsCredentials() - // TODO: the can be removed - installDevOpsFolder() } @@ -169,13 +165,3 @@ fun awsCredentials(id: String, key: String): String { aws_secret_access_key = $key """.trimIndent() } - -fun Prov.installDevOpsFolder(): ProvResult = task { - - val dir = "~/.devops/" - - if (!checkDir(dir)) { - createDirs(dir) - } - -}