v0.8.21 rename fatjar and correct README.md

This commit is contained in:
az 2021-11-25 10:36:05 +01:00
parent c2e2c12e76
commit 2f308cbbb2
5 changed files with 67 additions and 20 deletions

View file

@ -79,7 +79,7 @@ fatjar:
- ./gradlew fatJarLatest - ./gradlew fatJarLatest
artifacts: artifacts:
paths: paths:
- 'build/libs/provs-fatjar.jar' - 'build/libs/provs.jar'
reports: reports:
# To ensure we've access to this file in the next stage # To ensure we've access to this file in the next stage
dotenv: generate_executables.env dotenv: generate_executables.env
@ -105,8 +105,8 @@ release:
ref: '$CI_COMMIT_TAG' ref: '$CI_COMMIT_TAG'
assets: assets:
links: links:
- name: provs-fatjar.jar - name: provs.jar
url: https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/${FATJAR_JOB_ID}/artifacts/raw/build/libs/provs-fatjar.jar url: https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/${FATJAR_JOB_ID}/artifacts/raw/build/libs/provs.jar
after_script: after_script:
- echo "---------- End CI ----------" - echo "---------- End CI ----------"

View file

@ -1,12 +1,59 @@
# Provs-core # Provs framework
Provs is a framework for automating tasks for provisioning reasons and other purposes.
It combines
* being able to use the power of shell commands
* a clear and detailed result summary of the built-in execution handling (incl. failure handling and reporting)
* the convenience and robustness of a modern programming language
### Write once, run everywhere
Tasks can be run
* locally
* remotely
* in a local docker container
* in a remote container
Additionally, it is possible to define a custom processor if needed.
This repo is part of the [provs framework](https://gitlab.com/domaindrivenarchitecture/provs-docs). It provides the core component with
* execution engine
* failure handling
* multiple execution processors
* execution summary and logging
* support for secrets
## Usage ## Usage
For usage examples it is recommended to have a look at [provs-scripts](https://gitlab.com/domaindrivenarchitecture/provs-scripts) or provs-ubuntu-extensions. ### Prerequisites
* A **Java Virtual machine** (JVM) is required.
* Download the latest `provs.jar` from: https://gitlab.com/domaindrivenarchitecture/provs/-/releases
### Show usage options
`java -jar provs.jar -h`
### Provision a desktop workplace locally
Ensure a config file is in place (default config file name is "WorkplaceConfig.yaml") with at least the workplace type specified, e.g.
```type: MINIMAL```
Possible types are currently: MINIMAL, OFFICE or IDE.
Run:
`java -jar provs.jar -l`
### Provision a desktop workplace remotely
`java -jar provs.jar -i -r <ip> -u <remote_username>`
You'll be prompted for the password of the remote user.
## Build the jar-file yourself
* Clone this repo
* Build the fatjar file by `./gradlew fatJarLatest`
* In folder build/libs you'll find the file `provs.jar`
The fatjar is a Java jar-file incl. all required dependencies.

View file

@ -18,7 +18,7 @@ apply plugin: 'kotlinx-serialization'
group = 'org.domaindrivenarchitecture.provs' group = 'org.domaindrivenarchitecture.provs'
version = '0.8.21-SNAPSHOT' version = '0.8.21'
repositories { repositories {
mavenCentral() mavenCentral()
@ -98,7 +98,7 @@ task fatJarLatest(type: Jar) {
'Main-Class': 'org.domaindrivenarchitecture.provs.workplace.application.CliKt' 'Main-Class': 'org.domaindrivenarchitecture.provs.workplace.application.CliKt'
} }
with jar with jar
archiveFileName = 'provs-fatjar.jar' archiveFileName = 'provs.jar'
} }
task uberjarWorkplace(type: Jar) { task uberjarWorkplace(type: Jar) {

View file

@ -12,9 +12,6 @@ import java.io.File
/** /**
* Provisions according to the options either a meissa workplace, reposOnly or gopassOnly. * Provisions according to the options either a meissa workplace, reposOnly or gopassOnly.
* Locally or on a remote machine. If remotely, the remote host and remote user are specified by args parameters. * Locally or on a remote machine. If remotely, the remote host and remote user are specified by args parameters.
*
* Get help with:
* java -jar build/libs/provs-meissa-latest.jar meissa.provs.application.CliKt main -h
*/ */
fun main(args: Array<String>) { fun main(args: Array<String>) {
val cliCommand = parseCli(args) val cliCommand = parseCli(args)
@ -77,7 +74,7 @@ private fun retrievePassword(cliCommand: CliCommand): Secret? {
if (cliCommand.isValidRemote()) { if (cliCommand.isValidRemote()) {
if (cliCommand.sshWithPasswordPrompt) { if (cliCommand.sshWithPasswordPrompt) {
password = password =
PromptSecretSource("Password for user $cliCommand.userName!! on $cliCommand.remoteHost!!").secret() PromptSecretSource("Password for user ${cliCommand.userName!!} on ${cliCommand.remoteHost!!}").secret()
} else if (cliCommand.sshWithGopassPath != null) { } else if (cliCommand.sshWithGopassPath != null) {
password = GopassSecretSource(cliCommand.sshWithGopassPath).secret() password = GopassSecretSource(cliCommand.sshWithGopassPath).secret()
} }

View file

@ -39,9 +39,7 @@ class CliCommand(
} }
fun parseCli(args: Array<String>): CliCommand { fun parseCli(args: Array<String>): CliCommand {
val parser = ArgParser("provs") val parser = ArgParser("java -jar provs.jar")
val configFileName by parser.argument(ArgType.String, description = "the config file name to apply").optional()
val remoteHost by parser.option( val remoteHost by parser.option(
ArgType.String, shortName = ArgType.String, shortName =
@ -51,6 +49,11 @@ fun parseCli(args: Array<String>): CliCommand {
ArgType.Boolean, shortName = ArgType.Boolean, shortName =
"l", description = "provision to local machine - either localHost or remoteHost must be specified" "l", description = "provision to local machine - either localHost or remoteHost must be specified"
) )
val configFileName by parser.option(
ArgType.String,
shortName = "c",
description = "the config file name to apply"
).default("WorkplaceConfig.yaml")
val userName by parser.option( val userName by parser.option(
ArgType.String, ArgType.String,
shortName = "u", shortName = "u",