refactor packages
This commit is contained in:
parent
f5bf7865d5
commit
77f2cf7c10
78 changed files with 232 additions and 235 deletions
|
@ -79,7 +79,7 @@ task fatJar(type: Jar) {
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
||||||
'Implementation-Version': project.version,
|
'Implementation-Version': project.version,
|
||||||
'Main-Class': 'io.provs.entry.EntryKt'
|
'Main-Class': 'io.provs.core.entry.EntryKt'
|
||||||
}
|
}
|
||||||
archivesBaseName = project.name + '-all'
|
archivesBaseName = project.name + '-all'
|
||||||
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
||||||
|
@ -99,7 +99,7 @@ task fatJarLatest(type: Jar) {
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
||||||
'Implementation-Version': project.version,
|
'Implementation-Version': project.version,
|
||||||
'Main-Class': 'io.provs.entry.EntryKt'
|
'Main-Class': 'io.provs.core.entry.EntryKt'
|
||||||
}
|
}
|
||||||
with jar
|
with jar
|
||||||
archiveFileName = 'provs-fat-latest.jar'
|
archiveFileName = 'provs-fat-latest.jar'
|
||||||
|
@ -121,7 +121,7 @@ task uberJar(type: Jar) {
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
||||||
'Implementation-Version': project.version,
|
'Implementation-Version': project.version,
|
||||||
'Main-Class': 'io.provs.entry.EntryKt'
|
'Main-Class': 'io.provs.core.entry.EntryKt'
|
||||||
}
|
}
|
||||||
archiveClassifier = 'uber'
|
archiveClassifier = 'uber'
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ task uberJarLatest(type: Jar) {
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
||||||
'Implementation-Version': project.version,
|
'Implementation-Version': project.version,
|
||||||
'Main-Class': 'io.provs.entry.EntryKt'
|
'Main-Class': 'io.provs.core.entry.EntryKt'
|
||||||
}
|
}
|
||||||
archiveFileName = 'provs-latest.jar'
|
archiveFileName = 'provs-latest.jar'
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package io.provs
|
package io.provs.core
|
||||||
|
|
||||||
import io.provs.platforms.SHELL
|
import io.provs.core.platforms.SHELL
|
||||||
import io.provs.platforms.UbuntuProv
|
import io.provs.core.platforms.UbuntuProv
|
||||||
import io.provs.platforms.WinProv
|
import io.provs.core.platforms.WinProv
|
||||||
import io.provs.processors.LocalProcessor
|
import io.provs.core.processors.LocalProcessor
|
||||||
import io.provs.processors.Processor
|
import io.provs.core.processors.Processor
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum class ProgressType { NONE, DOTS, BASIC, FULL_LOG }
|
enum class ProgressType { NONE, DOTS, BASIC, FULL_LOG }
|
||||||
enum class ResultMode { NONE, LAST, ALL, FAILEXIT }
|
enum class ResultMode { NONE, LAST, ALL, FAILEXIT }
|
||||||
enum class OS { WINDOWS, LINUX }
|
enum class OS { WINDOWS, LINUX }
|
||||||
|
@ -37,7 +36,7 @@ open class Prov protected constructor(
|
||||||
private lateinit var defaultProvInstance: Prov
|
private lateinit var defaultProvInstance: Prov
|
||||||
|
|
||||||
fun defaultInstance(platform: String? = null): Prov {
|
fun defaultInstance(platform: String? = null): Prov {
|
||||||
return if (::defaultProvInstance.isInitialized) {
|
return if (Factory::defaultProvInstance.isInitialized) {
|
||||||
defaultProvInstance
|
defaultProvInstance
|
||||||
} else {
|
} else {
|
||||||
defaultProvInstance = newInstance(platform = platform, name = "default instance")
|
defaultProvInstance = newInstance(platform = platform, name = "default instance")
|
|
@ -1,4 +1,4 @@
|
||||||
package io.provs
|
package io.provs.core
|
||||||
|
|
||||||
|
|
||||||
data class ProvResult(val success: Boolean,
|
data class ProvResult(val success: Boolean,
|
||||||
|
@ -16,6 +16,7 @@ data class ProvResult(val success: Boolean,
|
||||||
(exception?.run { " Exception: " + toString() } ?: "")
|
(exception?.run { " Exception: " + toString() } ?: "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
fun toShortString() : String {
|
fun toShortString() : String {
|
||||||
return "ProvResult:: ${if (success) "Succeeded" else "FAILED"} -- " +
|
return "ProvResult:: ${if (success) "Succeeded" else "FAILED"} -- " +
|
||||||
if (!success)
|
if (!success)
|
|
@ -1,4 +1,4 @@
|
||||||
package io.provs
|
package io.provs.core
|
||||||
|
|
||||||
|
|
||||||
open class Secret(private val value: String) {
|
open class Secret(private val value: String) {
|
|
@ -1,9 +1,10 @@
|
||||||
package io.provs
|
package io.provs.core
|
||||||
|
|
||||||
import io.provs.docker.provideContainer
|
import io.provs.core.docker.provideContainer
|
||||||
import io.provs.processors.ContainerStartMode
|
import io.provs.core.processors.ContainerStartMode
|
||||||
import io.provs.processors.ContainerUbuntuHostProcessor
|
import io.provs.core.processors.ContainerUbuntuHostProcessor
|
||||||
import io.provs.processors.RemoteProcessor
|
import io.provs.core.processors.RemoteProcessor
|
||||||
|
import io.provs.core.tags.Api
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ fun local(): Prov {
|
||||||
* If password is null, connection is done by ssh-key.
|
* If password is null, connection is done by ssh-key.
|
||||||
* Platform (Linux, Windows) must be provided if different from local platform.
|
* Platform (Linux, Windows) must be provided if different from local platform.
|
||||||
*/
|
*/
|
||||||
@Suppress("unused") // used by other libraries resp. KotlinScript
|
@Api // used by other libraries resp. KotlinScript
|
||||||
fun remote(host: String, remoteUser: String, password: Secret? = null, platform: String? = null): Prov {
|
fun remote(host: String, remoteUser: String, password: Secret? = null, platform: String? = null): Prov {
|
||||||
require(host.isNotEmpty(), { "Host must not be empty." })
|
require(host.isNotEmpty(), { "Host must not be empty." })
|
||||||
require(remoteUser.isNotEmpty(), { "Remote user must not be empty." })
|
require(remoteUser.isNotEmpty(), { "Remote user must not be empty." })
|
||||||
|
@ -85,7 +86,7 @@ fun remote(host: String, remoteUser: String, password: Secret? = null, platform:
|
||||||
* parameter useExistingContainer is set to true.
|
* parameter useExistingContainer is set to true.
|
||||||
* If a new container needs to be created, on Linux systems the image _ubuntu_ is used.
|
* If a new container needs to be created, on Linux systems the image _ubuntu_ is used.
|
||||||
*/
|
*/
|
||||||
@Suppress("unused") // used by other libraries resp. KotlinScript
|
@Api // used by other libraries resp. KotlinScript
|
||||||
fun docker(containerName: String = "provs_default", useExistingContainer: Boolean = true): Prov {
|
fun docker(containerName: String = "provs_default", useExistingContainer: Boolean = true): Prov {
|
||||||
|
|
||||||
val os = System.getProperty("os.name")
|
val os = System.getProperty("os.name")
|
|
@ -1,12 +1,11 @@
|
||||||
package io.provs.docker
|
package io.provs.core.docker
|
||||||
|
|
||||||
import io.provs.Prov
|
|
||||||
import io.provs.ProvResult
|
|
||||||
import io.provs.docker.images.DockerImage
|
|
||||||
import io.provs.docker.platforms.*
|
|
||||||
import io.provs.platforms.UbuntuProv
|
|
||||||
import io.provs.processors.ContainerStartMode
|
|
||||||
|
|
||||||
|
import io.provs.core.Prov
|
||||||
|
import io.provs.core.ProvResult
|
||||||
|
import io.provs.core.docker.dockerimages.DockerImage
|
||||||
|
import io.provs.core.docker.platforms.*
|
||||||
|
import io.provs.core.platforms.UbuntuProv
|
||||||
|
import io.provs.core.processors.ContainerStartMode
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds a docker image if not yet existing.
|
* Builds a docker image if not yet existing.
|
||||||
|
@ -19,7 +18,6 @@ fun Prov.dockerProvideImage(image: DockerImage, skipIfExisting: Boolean = true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the specified docker image exists.
|
* Returns true if the specified docker image exists.
|
||||||
*/
|
*/
|
||||||
|
@ -31,7 +29,6 @@ fun Prov.dockerImageExists(imageName: String, sudo: Boolean = true) : Boolean {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and runs a new container with name _containerName_ for image _imageName_ if not yet existing.
|
* Creates and runs a new container with name _containerName_ for image _imageName_ if not yet existing.
|
||||||
* In case the container already exists, the parameter _startMode_ determines
|
* In case the container already exists, the parameter _startMode_ determines
|
||||||
|
@ -75,8 +72,6 @@ fun Prov.runContainer(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fun Prov.exitAndRmContainer(
|
fun Prov.exitAndRmContainer(
|
||||||
containerName: String,
|
containerName: String,
|
||||||
sudo: Boolean = true
|
sudo: Boolean = true
|
|
@ -1,4 +1,4 @@
|
||||||
package io.provs.docker.images
|
package io.provs.core.docker.dockerimages
|
||||||
|
|
||||||
|
|
||||||
interface DockerImage {
|
interface DockerImage {
|
||||||
|
@ -7,9 +7,8 @@ interface DockerImage {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dockerfile based ubuntu image added by a non-root default user.
|
* Provides a docker image based on ubuntu additionally with a non-root default user and sudo isntalled
|
||||||
*/
|
*/
|
||||||
@Suppress("unused") // used by other libraries
|
|
||||||
class UbuntuPlusUser(private val userName: String = "testuser") : DockerImage {
|
class UbuntuPlusUser(private val userName: String = "testuser") : DockerImage {
|
||||||
|
|
||||||
override fun imageName(): String {
|
override fun imageName(): String {
|
|
@ -1,15 +1,15 @@
|
||||||
package io.provs.docker.platforms
|
package io.provs.core.docker.platforms
|
||||||
|
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.docker.containerRuns
|
import io.provs.core.docker.containerRuns
|
||||||
import io.provs.docker.dockerImageExists
|
import io.provs.core.docker.dockerImageExists
|
||||||
import io.provs.docker.exitAndRmContainer
|
import io.provs.core.docker.exitAndRmContainer
|
||||||
import io.provs.docker.images.DockerImage
|
import io.provs.core.docker.dockerimages.DockerImage
|
||||||
import io.provs.escapeSingleQuote
|
import io.provs.core.escapeSingleQuote
|
||||||
import io.provs.fileSeparator
|
import io.provs.core.fileSeparator
|
||||||
import io.provs.hostUserHome
|
import io.provs.core.hostUserHome
|
||||||
import io.provs.platforms.UbuntuProv
|
import io.provs.core.platforms.UbuntuProv
|
||||||
import io.provs.processors.ContainerStartMode
|
import io.provs.core.processors.ContainerStartMode
|
||||||
|
|
||||||
|
|
||||||
fun UbuntuProv.provideContainerPlatform(
|
fun UbuntuProv.provideContainerPlatform(
|
|
@ -1,4 +1,4 @@
|
||||||
package io.provs.entry
|
package io.provs.core.entry
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls a static method of a class.
|
* Calls a static method of a class.
|
|
@ -1,11 +1,11 @@
|
||||||
package io.provs.platforms
|
package io.provs.core.platforms
|
||||||
|
|
||||||
import io.provs.ProgressType
|
import io.provs.core.ProgressType
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.escapeAndEncloseByDoubleQuoteForShell
|
import io.provs.core.escapeAndEncloseByDoubleQuoteForShell
|
||||||
import io.provs.processors.LocalProcessor
|
import io.provs.core.processors.LocalProcessor
|
||||||
import io.provs.processors.Processor
|
import io.provs.core.processors.Processor
|
||||||
|
|
||||||
const val SHELL = "/bin/bash"
|
const val SHELL = "/bin/bash"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package io.provs.platforms
|
package io.provs.core.platforms
|
||||||
|
|
||||||
import io.provs.ProgressType
|
import io.provs.core.ProgressType
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.processors.LocalProcessor
|
import io.provs.core.processors.LocalProcessor
|
||||||
import io.provs.processors.Processor
|
import io.provs.core.processors.Processor
|
||||||
|
|
||||||
|
|
||||||
class WinProv internal constructor(processor : Processor = LocalProcessor(), name: String? = null, progressType: ProgressType)
|
class WinProv internal constructor(processor : Processor = LocalProcessor(), name: String? = null, progressType: ProgressType)
|
|
@ -1,10 +1,11 @@
|
||||||
package io.provs.processors
|
package io.provs.core.processors
|
||||||
|
|
||||||
import io.provs.ProgressType
|
import io.provs.core.ProgressType
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.docker.provideContainer
|
import io.provs.core.docker.provideContainer
|
||||||
import io.provs.escapeAndEncloseByDoubleQuoteForShell
|
import io.provs.core.escapeAndEncloseByDoubleQuoteForShell
|
||||||
import io.provs.platforms.SHELL
|
import io.provs.core.platforms.SHELL
|
||||||
|
import io.provs.core.tags.Api
|
||||||
|
|
||||||
enum class ContainerStartMode {
|
enum class ContainerStartMode {
|
||||||
USE_RUNNING_ELSE_CREATE,
|
USE_RUNNING_ELSE_CREATE,
|
||||||
|
@ -19,12 +20,12 @@ enum class ContainerEndMode {
|
||||||
|
|
||||||
open class ContainerUbuntuHostProcessor(
|
open class ContainerUbuntuHostProcessor(
|
||||||
private val containerName: String = "default_provs_container",
|
private val containerName: String = "default_provs_container",
|
||||||
@Suppress("unused") // suppress false positive warning
|
@Api // suppress false positive warning
|
||||||
private val dockerImage: String = "ubuntu",
|
private val dockerImage: String = "ubuntu",
|
||||||
@Suppress("unused") // suppress false positive warning
|
@Api // suppress false positive warning
|
||||||
private val startMode: ContainerStartMode = ContainerStartMode.USE_RUNNING_ELSE_CREATE,
|
private val startMode: ContainerStartMode = ContainerStartMode.USE_RUNNING_ELSE_CREATE,
|
||||||
private val endMode: ContainerEndMode = ContainerEndMode.KEEP_RUNNING,
|
private val endMode: ContainerEndMode = ContainerEndMode.KEEP_RUNNING,
|
||||||
@Suppress("unused") // suppress false positive warning
|
@Api // suppress false positive warning
|
||||||
private val sudo: Boolean = true
|
private val sudo: Boolean = true
|
||||||
) : Processor {
|
) : Processor {
|
||||||
private val dockerCmd = if (sudo) "sudo docker " else "docker "
|
private val dockerCmd = if (sudo) "sudo docker " else "docker "
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.processors
|
package io.provs.core.processors
|
||||||
|
|
||||||
import io.provs.escapeNewline
|
import io.provs.core.escapeNewline
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
@ -17,7 +17,7 @@ open class LocalProcessor : Processor {
|
||||||
@Suppress("JAVA_CLASS_ON_COMPANION")
|
@Suppress("JAVA_CLASS_ON_COMPANION")
|
||||||
private val log = LoggerFactory.getLogger(javaClass.enclosingClass)
|
private val log = LoggerFactory.getLogger(javaClass.enclosingClass)
|
||||||
|
|
||||||
var charset = if (getOsName().contains("Windows")) Charset.forName("Windows-1252") else Charset.defaultCharset()
|
var charset: Charset = if (getOsName().contains("Windows")) Charset.forName("Windows-1252") else Charset.defaultCharset()
|
||||||
init {
|
init {
|
||||||
log.info("os.name: " + getOsName())
|
log.info("os.name: " + getOsName())
|
||||||
log.info("user.home: " + System.getProperty("user.home"))
|
log.info("user.home: " + System.getProperty("user.home"))
|
|
@ -1,4 +1,4 @@
|
||||||
package io.provs.processors
|
package io.provs.core.processors
|
||||||
|
|
||||||
|
|
||||||
@Suppress("unused") // used externally
|
@Suppress("unused") // used externally
|
|
@ -1,10 +1,12 @@
|
||||||
package io.provs.processors
|
package io.provs.core.processors
|
||||||
|
|
||||||
|
|
||||||
interface Processor {
|
interface Processor {
|
||||||
fun x(vararg args: String): ProcessResult
|
fun x(vararg args: String): ProcessResult
|
||||||
fun xNoLog(vararg args: String): ProcessResult
|
fun xNoLog(vararg args: String): ProcessResult
|
||||||
fun close() {}
|
fun close() {
|
||||||
|
// no action needed for most processors; if action is needed when closing, this method must be overwritten in the subclass
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package io.provs.processors
|
package io.provs.core.processors
|
||||||
|
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.escapeAndEncloseByDoubleQuoteForShell
|
import io.provs.core.escapeAndEncloseByDoubleQuoteForShell
|
||||||
import io.provs.escapeNewline
|
import io.provs.core.escapeNewline
|
||||||
import io.provs.platforms.SHELL
|
import io.provs.core.platforms.SHELL
|
||||||
import net.schmizz.sshj.SSHClient
|
import net.schmizz.sshj.SSHClient
|
||||||
import net.schmizz.sshj.connection.channel.direct.Session
|
import net.schmizz.sshj.connection.channel.direct.Session
|
||||||
import net.schmizz.sshj.connection.channel.direct.Session.Command
|
import net.schmizz.sshj.connection.channel.direct.Session.Command
|
||||||
|
@ -80,7 +80,6 @@ class RemoteProcessor(ip: InetAddress, user: String, password: Secret? = null) :
|
||||||
else
|
else
|
||||||
args.joinToString(separator = " ")
|
args.joinToString(separator = " ")
|
||||||
|
|
||||||
|
|
||||||
var session: Session? = null
|
var session: Session? = null
|
||||||
|
|
||||||
try {
|
try {
|
6
src/main/kotlin/io/provs/core/tags/Api.kt
Normal file
6
src/main/kotlin/io/provs/core/tags/Api.kt
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package io.provs.core.tags
|
||||||
|
|
||||||
|
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION)
|
||||||
|
@Retention(AnnotationRetention.SOURCE)
|
||||||
|
@Suppress("unused") // element is offered to be used externally
|
||||||
|
annotation class Api
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.demos
|
package io.provs.ubuntu.extensions.demos
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.local
|
import io.provs.core.local
|
||||||
|
|
||||||
|
|
||||||
fun Prov.helloWorld() = def {
|
fun Prov.helloWorld() = def {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.demos
|
package io.provs.ubuntu.extensions.demos
|
||||||
|
|
||||||
import io.provs.*
|
import io.provs.core.*
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.server_compounds.monitoring
|
package io.provs.ubuntu.extensions.server_compounds.monitoring
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ubuntu.extensions.server_software.nginx.base.NginxConf
|
import io.provs.ubuntu.extensions.server_software.nginx.base.NginxConf
|
||||||
import io.provs.ubuntu.extensions.server_software.nginx.base.nginxHttpConf
|
import io.provs.ubuntu.extensions.server_software.nginx.base.nginxHttpConf
|
||||||
import io.provs.ubuntu.extensions.server_software.nginx.provisionNginxStandAlone
|
import io.provs.ubuntu.extensions.server_software.nginx.provisionNginxStandAlone
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.server_compounds.monitoring
|
package io.provs.ubuntu.extensions.server_compounds.monitoring
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ubuntu.extensions.server_software.nginx.base.NginxConf
|
import io.provs.ubuntu.extensions.server_software.nginx.base.NginxConf
|
||||||
import io.provs.ubuntu.extensions.server_software.nginx.base.nginxAddLocation
|
import io.provs.ubuntu.extensions.server_software.nginx.base.nginxAddLocation
|
||||||
import io.provs.ubuntu.extensions.server_software.nginx.base.nginxCreateSelfSignedCertificate
|
import io.provs.ubuntu.extensions.server_software.nginx.base.nginxCreateSelfSignedCertificate
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.certbot
|
package io.provs.ubuntu.extensions.server_software.certbot
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.filesystem.base.fileExists
|
import io.provs.ubuntu.filesystem.base.fileExists
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.firewall
|
package io.provs.ubuntu.extensions.server_software.firewall
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.firewall.base
|
package io.provs.ubuntu.extensions.server_software.firewall.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.nexus
|
package io.provs.ubuntu.extensions.server_software.nexus
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.docker.containerRuns
|
import io.provs.core.docker.containerRuns
|
||||||
import io.provs.remote
|
import io.provs.core.remote
|
||||||
import io.provs.ubuntu.filesystem.base.fileExists
|
import io.provs.ubuntu.filesystem.base.fileExists
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
import io.provs.ubuntu.user.base.createUser
|
import io.provs.ubuntu.user.base.createUser
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.nginx
|
package io.provs.ubuntu.extensions.server_software.nginx
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.remote
|
import io.provs.core.remote
|
||||||
import io.provs.ubuntu.filesystem.base.createFile
|
import io.provs.ubuntu.filesystem.base.createFile
|
||||||
import io.provs.ubuntu.filesystem.base.fileExists
|
import io.provs.ubuntu.filesystem.base.fileExists
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.nginx.base
|
package io.provs.ubuntu.extensions.server_software.nginx.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
||||||
fun Prov.nginxAddBasicAuth(user: String, password: Secret) = requireAll {
|
fun Prov.nginxAddBasicAuth(user: String, password: Secret) = requireAll {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.nginx.base
|
package io.provs.ubuntu.extensions.server_software.nginx.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.filesystem.base.*
|
import io.provs.ubuntu.filesystem.base.*
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.nginx.base
|
package io.provs.ubuntu.extensions.server_software.nginx.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ubuntu.filesystem.base.createDirs
|
import io.provs.ubuntu.filesystem.base.createDirs
|
||||||
import io.provs.ubuntu.extensions.server_software.nginx.provisionNginxStandAlone
|
import io.provs.ubuntu.extensions.server_software.nginx.provisionNginxStandAlone
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.prometheus
|
package io.provs.ubuntu.extensions.server_software.prometheus
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ubuntu.extensions.server_software.prometheus.base.*
|
import io.provs.ubuntu.extensions.server_software.prometheus.base.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.prometheus.base
|
package io.provs.ubuntu.extensions.server_software.prometheus.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.local
|
|
||||||
import io.provs.ubuntu.filesystem.base.createDir
|
import io.provs.ubuntu.filesystem.base.createDir
|
||||||
import io.provs.ubuntu.filesystem.base.createFile
|
import io.provs.ubuntu.filesystem.base.createFile
|
||||||
import io.provs.ubuntu.filesystem.base.fileContainsText
|
import io.provs.ubuntu.filesystem.base.fileContainsText
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.prometheus.base
|
package io.provs.ubuntu.extensions.server_software.prometheus.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.docker.containerRuns
|
import io.provs.core.docker.containerRuns
|
||||||
import io.provs.local
|
|
||||||
import io.provs.ubuntu.filesystem.base.createDirs
|
import io.provs.ubuntu.filesystem.base.createDirs
|
||||||
import io.provs.ubuntu.filesystem.base.createFile
|
import io.provs.ubuntu.filesystem.base.createFile
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.workplace
|
package io.provs.ubuntu.extensions.workplace
|
||||||
|
|
||||||
import io.provs.*
|
import io.provs.core.*
|
||||||
import io.provs.processors.RemoteProcessor
|
import io.provs.core.processors.RemoteProcessor
|
||||||
import io.provs.ubuntu.extensions.workplace.base.*
|
import io.provs.ubuntu.extensions.workplace.base.*
|
||||||
import io.provs.ubuntu.git.provisionGit
|
import io.provs.ubuntu.git.provisionGit
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
||||||
fun Prov.installDocker() = def {
|
fun Prov.installDocker() = def {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ubuntu.filesystem.base.createDir
|
import io.provs.ubuntu.filesystem.base.createDir
|
||||||
import io.provs.ubuntu.web.base.downloadFromURL
|
import io.provs.ubuntu.web.base.downloadFromURL
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.filesystem.base.createDir
|
import io.provs.ubuntu.filesystem.base.createDir
|
||||||
import io.provs.ubuntu.filesystem.base.createDirs
|
import io.provs.ubuntu.filesystem.base.createDirs
|
||||||
import io.provs.ubuntu.filesystem.base.createFile
|
import io.provs.ubuntu.filesystem.base.createFile
|
||||||
|
@ -30,11 +30,12 @@ fun Prov.installGopass(version: String = "1.12.7", enforceVersion: Boolean = fal
|
||||||
|
|
||||||
|
|
||||||
fun Prov.configureGopass(gopassRootFolder: String? = null) = def {
|
fun Prov.configureGopass(gopassRootFolder: String? = null) = def {
|
||||||
val gopassRootFolderNonNull = (gopassRootFolder ?: userHome()) + ".password-store"
|
val defaultRootFolder = userHome() + ".password-store"
|
||||||
|
val rootFolder = gopassRootFolder ?: defaultRootFolder
|
||||||
// use default
|
// use default
|
||||||
createDir(gopassRootFolderNonNull)
|
createDir(rootFolder)
|
||||||
createDirs(".config/gopass", "~/")
|
createDirs(".config/gopass")
|
||||||
createFile("~/.config/gopass/config.yml", gopassConfig(gopassRootFolderNonNull))
|
createFile("~/.config/gopass/config.yml", gopassConfig(rootFolder))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.filesystem.base.createDir
|
import io.provs.ubuntu.filesystem.base.createDir
|
||||||
import io.provs.ubuntu.filesystem.base.createDirs
|
import io.provs.ubuntu.filesystem.base.createDirs
|
||||||
import io.provs.ubuntu.filesystem.base.userHome
|
import io.provs.ubuntu.filesystem.base.userHome
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ubuntu.filesystem.base.addTextToFile
|
import io.provs.ubuntu.filesystem.base.addTextToFile
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ubuntu.filesystem.base.createDir
|
import io.provs.ubuntu.filesystem.base.createDir
|
||||||
import io.provs.ubuntu.filesystem.base.createFile
|
import io.provs.ubuntu.filesystem.base.createFile
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.remote
|
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
import io.provs.ubuntu.secret.secretSources.GopassSecretSource
|
|
||||||
import io.provs.ubuntu.secret.secretSources.PlainSecretSource
|
|
||||||
import io.provs.ubuntu.secret.secretSources.PromptSecretSource
|
|
||||||
import io.provs.ubuntu.user.base.whoami
|
import io.provs.ubuntu.user.base.whoami
|
||||||
|
|
||||||
fun Prov.installVirtualBoxGuestAdditions() = def {
|
fun Prov.installVirtualBoxGuestAdditions() = def {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
import io.provs.ubuntu.install.base.aptInstallFromPpa
|
import io.provs.ubuntu.install.base.aptInstallFromPpa
|
||||||
import io.provs.ubuntu.install.base.isPackageInstalled
|
import io.provs.ubuntu.install.base.isPackageInstalled
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.filesystem.base
|
package io.provs.ubuntu.filesystem.base
|
||||||
|
|
||||||
import io.provs.*
|
import io.provs.core.*
|
||||||
import io.provs.platforms.SHELL
|
import io.provs.core.platforms.SHELL
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.git
|
package io.provs.ubuntu.git
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.git.base
|
package io.provs.ubuntu.git.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.filesystem.base.addTextToFile
|
import io.provs.ubuntu.filesystem.base.addTextToFile
|
||||||
import io.provs.ubuntu.filesystem.base.createDir
|
import io.provs.ubuntu.filesystem.base.createDir
|
||||||
import io.provs.ubuntu.filesystem.base.dirExists
|
import io.provs.ubuntu.filesystem.base.dirExists
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.install.base
|
package io.provs.ubuntu.install.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
|
|
||||||
|
|
||||||
private var aptInit = false
|
private var aptInit = false
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package io.provs.ubuntu.keys
|
package io.provs.ubuntu.keys
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.ubuntu.keys.base.configureGpgKeys
|
import io.provs.ubuntu.keys.base.configureGpgKeys
|
||||||
import io.provs.ubuntu.keys.base.configureSshKeys
|
import io.provs.ubuntu.keys.base.configureSshKeys
|
||||||
import io.provs.ubuntu.secret.SecretSourceType
|
import io.provs.ubuntu.secret.SecretSourceType
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.keys.base
|
package io.provs.ubuntu.keys.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.filesystem.base.createDir
|
import io.provs.ubuntu.filesystem.base.createDir
|
||||||
import io.provs.ubuntu.filesystem.base.createFile
|
import io.provs.ubuntu.filesystem.base.createFile
|
||||||
import io.provs.ubuntu.filesystem.base.createSecretFile
|
import io.provs.ubuntu.filesystem.base.createSecretFile
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.keys.base
|
package io.provs.ubuntu.keys.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.filesystem.base.createDir
|
import io.provs.ubuntu.filesystem.base.createDir
|
||||||
import io.provs.ubuntu.filesystem.base.createSecretFile
|
import io.provs.ubuntu.filesystem.base.createSecretFile
|
||||||
import io.provs.ubuntu.keys.KeyPair
|
import io.provs.ubuntu.keys.KeyPair
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.secret
|
package io.provs.ubuntu.secret
|
||||||
|
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.ubuntu.secret.secretSources.*
|
import io.provs.ubuntu.secret.secretSources.*
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.secret.secretSources
|
package io.provs.ubuntu.secret.secretSources
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.ubuntu.secret.SecretSource
|
import io.provs.ubuntu.secret.SecretSource
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.secret.secretSources
|
package io.provs.ubuntu.secret.secretSources
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.ubuntu.secret.SecretSource
|
import io.provs.ubuntu.secret.SecretSource
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.secret.secretSources
|
package io.provs.ubuntu.secret.secretSources
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.ubuntu.secret.SecretSource
|
import io.provs.ubuntu.secret.SecretSource
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.secret.secretSources
|
package io.provs.ubuntu.secret.secretSources
|
||||||
|
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.ubuntu.secret.SecretSource
|
import io.provs.ubuntu.secret.SecretSource
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.secret.secretSources
|
package io.provs.ubuntu.secret.secretSources
|
||||||
|
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.ubuntu.secret.SecretSource
|
import io.provs.ubuntu.secret.SecretSource
|
||||||
import java.awt.FlowLayout
|
import java.awt.FlowLayout
|
||||||
import javax.swing.*
|
import javax.swing.*
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package io.provs.ubuntu.user.base
|
package io.provs.ubuntu.user.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.processors.RemoteProcessor
|
import io.provs.core.processors.RemoteProcessor
|
||||||
import io.provs.ubuntu.filesystem.base.createDirs
|
import io.provs.ubuntu.filesystem.base.createDirs
|
||||||
import io.provs.ubuntu.filesystem.base.fileExists
|
import io.provs.ubuntu.filesystem.base.fileExists
|
||||||
import io.provs.ubuntu.git.provisionGit
|
import io.provs.ubuntu.git.provisionGit
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.utils
|
package io.provs.ubuntu.utils
|
||||||
|
|
||||||
import io.provs.escapeBackslash
|
import io.provs.core.escapeBackslash
|
||||||
import io.provs.escapeDoubleQuote
|
import io.provs.core.escapeDoubleQuote
|
||||||
|
|
||||||
|
|
||||||
// todo: investigate to use .escapeAndEncloseByDoubleQuoteForShell() or similar instead (?)
|
// todo: investigate to use .escapeAndEncloseByDoubleQuoteForShell() or similar instead (?)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.web.base
|
package io.provs.ubuntu.web.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
import io.provs.ubuntu.install.base.isPackageInstalled
|
import io.provs.ubuntu.install.base.isPackageInstalled
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs
|
package io.provs.core
|
||||||
|
|
||||||
import io.provs.docker.provideContainer
|
import io.provs.core.docker.provideContainer
|
||||||
import io.provs.test.tags.ContainerTest
|
import io.provs.test.tags.ContainerTest
|
||||||
import io.provs.test.tags.NonCi
|
import io.provs.test.tags.NonCi
|
||||||
import io.provs.test.testLocal
|
import io.provs.test.testLocal
|
|
@ -1,4 +1,4 @@
|
||||||
package io.provs
|
package io.provs.core
|
||||||
|
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
import io.provs.test.tags.ContainerTest
|
import io.provs.test.tags.ContainerTest
|
|
@ -1,9 +1,9 @@
|
||||||
package io.provs.docker.platforms
|
package io.provs.core.docker.platforms
|
||||||
|
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.docker.containerRuns
|
import io.provs.core.docker.containerRuns
|
||||||
import io.provs.docker.exitAndRmContainer
|
import io.provs.core.docker.exitAndRmContainer
|
||||||
import io.provs.docker.runContainer
|
import io.provs.core.docker.runContainer
|
||||||
import io.provs.test.tags.NonCi
|
import io.provs.test.tags.NonCi
|
||||||
import io.provs.test.testLocal
|
import io.provs.test.testLocal
|
||||||
import org.junit.jupiter.api.Assertions.assertEquals
|
import org.junit.jupiter.api.Assertions.assertEquals
|
|
@ -1,4 +1,4 @@
|
||||||
package io.provs.entry
|
package io.provs.core.entry
|
||||||
|
|
||||||
import org.junit.jupiter.api.AfterEach
|
import org.junit.jupiter.api.AfterEach
|
||||||
import org.junit.jupiter.api.Assertions.assertEquals
|
import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
|
@ -41,7 +41,7 @@ internal class EntryKtTest {
|
||||||
@Test
|
@Test
|
||||||
fun test_without_method_argument() {
|
fun test_without_method_argument() {
|
||||||
// when
|
// when
|
||||||
main("io.provs.entry.EntryTestKt")
|
main("io.provs.core.entry.EntryTestKt")
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("main is fun \n", outContent.toString())
|
assertEquals("main is fun \n", outContent.toString())
|
||||||
|
@ -50,7 +50,7 @@ internal class EntryKtTest {
|
||||||
@Test
|
@Test
|
||||||
fun test_method_main_without_args() {
|
fun test_method_main_without_args() {
|
||||||
// when
|
// when
|
||||||
main("io.provs.entry.EntryTestKt", "main")
|
main("io.provs.core.entry.EntryTestKt", "main")
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("main is fun \n", outContent.toString())
|
assertEquals("main is fun \n", outContent.toString())
|
||||||
|
@ -59,7 +59,7 @@ internal class EntryKtTest {
|
||||||
@Test
|
@Test
|
||||||
fun test_named_method_without_args() {
|
fun test_named_method_without_args() {
|
||||||
// when
|
// when
|
||||||
main("io.provs.entry.EntryTestKt", "testfun")
|
main("io.provs.core.entry.EntryTestKt", "testfun")
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("test is fun \n", outContent.toString())
|
assertEquals("test is fun \n", outContent.toString())
|
||||||
|
@ -68,7 +68,7 @@ internal class EntryKtTest {
|
||||||
@Test
|
@Test
|
||||||
fun test_method_main_with_args() {
|
fun test_method_main_with_args() {
|
||||||
// when
|
// when
|
||||||
main("io.provs.entry.EntryTestKt", "main", "arg1", "arg2")
|
main("io.provs.core.entry.EntryTestKt", "main", "arg1", "arg2")
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("main is fun arg1 arg2\n", outContent.toString())
|
assertEquals("main is fun arg1 arg2\n", outContent.toString())
|
||||||
|
@ -77,7 +77,7 @@ internal class EntryKtTest {
|
||||||
@Test
|
@Test
|
||||||
fun test_named_method_with_args() {
|
fun test_named_method_with_args() {
|
||||||
// when
|
// when
|
||||||
main("io.provs.entry.EntryTestKt", "testfun", "arg1", "arg2")
|
main("io.provs.core.entry.EntryTestKt", "testfun", "arg1", "arg2")
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("test is fun arg1 arg2\n", outContent.toString())
|
assertEquals("test is fun arg1 arg2\n", outContent.toString())
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.platformTest
|
package io.provs.core.platformTest
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.test.tags.NonCi
|
import io.provs.test.tags.NonCi
|
||||||
import io.provs.test.testLocal
|
import io.provs.test.testLocal
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.platformTest
|
package io.provs.core.platformTest
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.test.testLocal
|
import io.provs.test.testLocal
|
||||||
import org.junit.jupiter.api.Assertions.assertEquals
|
import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
|
@ -1,5 +1,6 @@
|
||||||
package io.provs
|
package io.provs.core.processors
|
||||||
|
|
||||||
|
import io.provs.core.newline
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
import io.provs.test.tags.ContainerTest
|
import io.provs.test.tags.ContainerTest
|
||||||
import org.junit.jupiter.api.Assertions.assertEquals
|
import org.junit.jupiter.api.Assertions.assertEquals
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.processors
|
package io.provs.core.processors
|
||||||
|
|
||||||
import io.provs.platforms.SHELL
|
import io.provs.core.platforms.SHELL
|
||||||
import io.provs.test.DEFAULT_START_MODE_TEST_CONTAINER
|
import io.provs.test.DEFAULT_START_MODE_TEST_CONTAINER
|
||||||
import io.provs.test.tags.ContainerTest
|
import io.provs.test.tags.ContainerTest
|
||||||
import io.provs.test.testDockerWithSudo
|
import io.provs.test.testDockerWithSudo
|
|
@ -1,5 +1,9 @@
|
||||||
package io.provs
|
package io.provs.core.processors
|
||||||
|
|
||||||
|
import io.provs.core.Prov
|
||||||
|
import io.provs.core.escapeAndEncloseByDoubleQuoteForShell
|
||||||
|
import io.provs.core.escapeProcentForPrintf
|
||||||
|
import io.provs.core.escapeSingleQuoteForShell
|
||||||
import org.junit.jupiter.api.Assertions.assertEquals
|
import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
import org.junit.jupiter.api.Assertions.assertTrue
|
import org.junit.jupiter.api.Assertions.assertTrue
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
@ -21,7 +25,7 @@ internal class LocalProcessorTest {
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assert(res.success)
|
assert(res.success)
|
||||||
assert(res.out == text)//"abc123!§\\$%&/\"\\äöü'")
|
assert(res.out == text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,35 +1,23 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.firewall
|
package io.provs.ubuntu.extensions.server_software.firewall
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
|
import io.provs.core.docker.dockerProvideImage
|
||||||
import io.provs.docker.dockerProvideImage
|
import io.provs.core.docker.dockerimages.UbuntuPlusUser
|
||||||
import io.provs.docker.exitAndRmContainer
|
import io.provs.core.docker.exitAndRmContainer
|
||||||
import io.provs.docker.images.UbuntuPlusUser
|
import io.provs.core.local
|
||||||
import io.provs.local
|
import io.provs.core.processors.ContainerEndMode
|
||||||
import io.provs.processors.ContainerEndMode
|
import io.provs.core.processors.ContainerStartMode
|
||||||
import io.provs.processors.ContainerStartMode
|
import io.provs.core.processors.ContainerUbuntuHostProcessor
|
||||||
import io.provs.processors.ContainerUbuntuHostProcessor
|
import io.provs.test.tags.NonCi
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
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.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
|
|
||||||
internal class ProvisionFirewallKtTest {
|
internal class ProvisionFirewallKtTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled
|
@NonCi
|
||||||
fun provisionFirewall() {
|
|
||||||
// todo
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Disabled
|
|
||||||
fun resetFirewall() {
|
|
||||||
// todo
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun configureFirewall() {
|
fun configureFirewall() {
|
||||||
// given
|
// given
|
||||||
val dockerImage = UbuntuPlusUser()
|
val dockerImage = UbuntuPlusUser()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.server_software.nginx
|
package io.provs.ubuntu.extensions.server_software.nginx
|
||||||
|
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
|
import io.provs.test.tags.NonCi
|
||||||
import io.provs.ubuntu.filesystem.base.replaceTextInFile
|
import io.provs.ubuntu.filesystem.base.replaceTextInFile
|
||||||
import io.provs.ubuntu.install.base.aptInstall
|
import io.provs.ubuntu.install.base.aptInstall
|
||||||
import io.provs.ubuntu.extensions.server_software.nginx.base.*
|
import io.provs.ubuntu.extensions.server_software.nginx.base.*
|
||||||
|
@ -12,6 +13,7 @@ import org.junit.jupiter.api.Test
|
||||||
internal class ProvisionNginxKtTest {
|
internal class ProvisionNginxKtTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@NonCi
|
||||||
fun provisionNginxStandAlone_customConfig() {
|
fun provisionNginxStandAlone_customConfig() {
|
||||||
// given
|
// given
|
||||||
val a = defaultTestContainer()
|
val a = defaultTestContainer()
|
||||||
|
@ -40,6 +42,7 @@ internal class ProvisionNginxKtTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@NonCi
|
||||||
fun provisionNginxStandAlone_defaultConfig() {
|
fun provisionNginxStandAlone_defaultConfig() {
|
||||||
// given
|
// given
|
||||||
val a = defaultTestContainer()
|
val a = defaultTestContainer()
|
||||||
|
@ -54,6 +57,7 @@ internal class ProvisionNginxKtTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@NonCi
|
||||||
fun provisionNginxStandAlone_sslConfig() {
|
fun provisionNginxStandAlone_sslConfig() {
|
||||||
// given
|
// given
|
||||||
val a = defaultTestContainer()
|
val a = defaultTestContainer()
|
||||||
|
|
|
@ -8,10 +8,12 @@ import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
import org.junit.jupiter.api.Assertions.assertTrue
|
import org.junit.jupiter.api.Assertions.assertTrue
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
|
import io.provs.test.tags.NonCi
|
||||||
|
|
||||||
internal class LocationsKtTest {
|
internal class LocationsKtTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@NonCi
|
||||||
fun nginxIncludeLocationFolders() {
|
fun nginxIncludeLocationFolders() {
|
||||||
// given
|
// given
|
||||||
val a = defaultTestContainer()
|
val a = defaultTestContainer()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.extensions.workplace
|
package io.provs.ubuntu.extensions.workplace
|
||||||
|
|
||||||
import io.provs.Password
|
import io.provs.core.Password
|
||||||
import org.junit.jupiter.api.Assertions.assertTrue
|
import org.junit.jupiter.api.Assertions.assertTrue
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.ProvResult
|
import io.provs.core.ProvResult
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.docker.exitAndRmContainer
|
import io.provs.core.docker.exitAndRmContainer
|
||||||
import io.provs.local
|
import io.provs.core.local
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
import io.provs.test.tags.ContainerTest
|
import io.provs.test.tags.ContainerTest
|
||||||
import io.provs.test.tags.NonCi
|
import io.provs.test.tags.NonCi
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.extensions.workplace.base
|
package io.provs.ubuntu.extensions.workplace.base
|
||||||
|
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.remote
|
import io.provs.core.remote
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
import io.provs.test.tags.ContainerTest
|
import io.provs.test.tags.ContainerTest
|
||||||
import io.provs.ubuntu.filesystem.base.*
|
import io.provs.ubuntu.filesystem.base.*
|
||||||
|
@ -39,7 +39,7 @@ internal class GopassKtTest {
|
||||||
|
|
||||||
// when
|
// when
|
||||||
val res = a.installGopass()
|
val res = a.installGopass()
|
||||||
val res2 = a.configureGopass(a.userHome() + ".password-store")
|
val res2 = a.configureGopass(a.userHome() + gopassRootDir)
|
||||||
val res3 = a.gopassMountStore("exampleStore", "~/exampleStoreFolder")
|
val res3 = a.gopassMountStore("exampleStore", "~/exampleStoreFolder")
|
||||||
|
|
||||||
// then
|
// then
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.keys
|
package io.provs.ubuntu.keys
|
||||||
|
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.condition.EnabledOnOs
|
import org.junit.jupiter.api.condition.EnabledOnOs
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package io.provs.ubuntu.keys.base
|
package io.provs.ubuntu.keys.base
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
import io.provs.test.tags.ContainerTest
|
import io.provs.test.tags.ContainerTest
|
||||||
import io.provs.ubuntu.keys.KeyPair
|
import io.provs.ubuntu.keys.KeyPair
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.keys.base
|
package io.provs.ubuntu.keys.base
|
||||||
|
|
||||||
import io.provs.Secret
|
import io.provs.core.Secret
|
||||||
import io.provs.test.defaultTestContainer
|
import io.provs.test.defaultTestContainer
|
||||||
import io.provs.ubuntu.keys.*
|
import io.provs.ubuntu.keys.*
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package io.provs.ubuntu.utils
|
package io.provs.ubuntu.utils
|
||||||
|
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.test.tags.ContainerTest
|
import io.provs.test.tags.ContainerTest
|
||||||
import org.junit.jupiter.api.Assertions.assertEquals
|
import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package io.provs.test
|
package io.provs.test
|
||||||
|
|
||||||
import io.provs.ProgressType
|
import io.provs.core.ProgressType
|
||||||
import io.provs.Prov
|
import io.provs.core.Prov
|
||||||
import io.provs.docker.dockerImageExists
|
import io.provs.core.docker.dockerImageExists
|
||||||
import io.provs.docker.dockerProvideImage
|
import io.provs.core.docker.dockerProvideImage
|
||||||
import io.provs.docker.images.UbuntuPlusUser
|
import io.provs.core.docker.dockerimages.UbuntuPlusUser
|
||||||
import io.provs.processors.ContainerStartMode
|
import io.provs.core.processors.ContainerStartMode
|
||||||
import io.provs.processors.ContainerUbuntuHostProcessor
|
import io.provs.core.processors.ContainerUbuntuHostProcessor
|
||||||
|
|
||||||
val DEFAULT_START_MODE_TEST_CONTAINER = ContainerStartMode.USE_RUNNING_ELSE_CREATE
|
val DEFAULT_START_MODE_TEST_CONTAINER = ContainerStartMode.USE_RUNNING_ELSE_CREATE
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue