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
artifacts:
paths:
- 'build/libs/provs-fatjar.jar'
- 'build/libs/provs.jar'
reports:
# To ensure we've access to this file in the next stage
dotenv: generate_executables.env
@ -105,8 +105,8 @@ release:
ref: '$CI_COMMIT_TAG'
assets:
links:
- name: provs-fatjar.jar
url: https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/${FATJAR_JOB_ID}/artifacts/raw/build/libs/provs-fatjar.jar
- name: provs.jar
url: https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/${FATJAR_JOB_ID}/artifacts/raw/build/libs/provs.jar
after_script:
- 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
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'
version = '0.8.21-SNAPSHOT'
version = '0.8.21'
repositories {
mavenCentral()
@ -98,7 +98,7 @@ task fatJarLatest(type: Jar) {
'Main-Class': 'org.domaindrivenarchitecture.provs.workplace.application.CliKt'
}
with jar
archiveFileName = 'provs-fatjar.jar'
archiveFileName = 'provs.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.
* 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>) {
val cliCommand = parseCli(args)
@ -77,7 +74,7 @@ private fun retrievePassword(cliCommand: CliCommand): Secret? {
if (cliCommand.isValidRemote()) {
if (cliCommand.sshWithPasswordPrompt) {
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) {
password = GopassSecretSource(cliCommand.sshWithGopassPath).secret()
}

View file

@ -39,9 +39,7 @@ class CliCommand(
}
fun parseCli(args: Array<String>): CliCommand {
val parser = ArgParser("provs")
val configFileName by parser.argument(ArgType.String, description = "the config file name to apply").optional()
val parser = ArgParser("java -jar provs.jar")
val remoteHost by parser.option(
ArgType.String, shortName =
@ -51,6 +49,11 @@ fun parseCli(args: Array<String>): CliCommand {
ArgType.Boolean, shortName =
"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(
ArgType.String,
shortName = "u",