diff --git a/.github/workflows/zenodo.yaml b/.github/workflows/zenodo.yaml index 5ff63a465a..1ae6ce189d 100644 --- a/.github/workflows/zenodo.yaml +++ b/.github/workflows/zenodo.yaml @@ -38,7 +38,7 @@ jobs: python-version: 3.10.13 - name: (PREPARE) Install Python dependencies - run: pip install -r cmds/zenodo/requirements.txt + run: pip install -r zenodo/requirements.txt ################################################### # diff --git a/.gitignore b/.gitignore index e656d5d302..6857bda11a 100644 --- a/.gitignore +++ b/.gitignore @@ -60,4 +60,9 @@ opentosca-vintner-*.tgz !.yarn/plugins !.yarn/releases !.yarn/sdks -!.yarn/versions \ No newline at end of file +!.yarn/versions + +# choco +*.nupkg +choco/tools/vintner.exe +choco/tools/vintner.exe.asc diff --git a/docs/cmds/interface/template.ejs b/docs/cmds/interface/template.ejs index e672291fbc..1c647af437 100644 --- a/docs/cmds/interface/template.ejs +++ b/docs/cmds/interface/template.ejs @@ -52,6 +52,18 @@ tags: requests.post(SERVER_ADDRESS + "/<%- commands.join('/') -%>") <% } -%> ``` + +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post +<% if (options.filter(o => o.mandatory).length !== 0) { -%> + post(SERVER_ADDRESS + "/<%- commands.join('/') -%>", json=mapOf( +<%- options.filter(o => o.mandatory).map(o => `\t\t"${o.option}" to ${o.option.toUpperCase()}`).join(',\n') %> + )) +<% } else { -%> + post(SERVER_ADDRESS + "/<%- commands.join('/') -%>") +<% } -%> + ``` <% } -%> <% if (options.length !== 0) { %> | Option | Mandatory | Type | Description | diff --git a/docs/docs/contributing/development.md b/docs/docs/contributing/development.md index e2cbd6cdca..b3438f843c 100644 --- a/docs/docs/contributing/development.md +++ b/docs/docs/contributing/development.md @@ -16,11 +16,11 @@ Our branching workflow follows [GitHub Flow](https://docs.github.com/de/get-star Branches should be names as follows -- `fix-short-title` for bug fixes -- `docs-short-title` for documentations - `feature-short-title` for features +- `fix-short-title` for bug fixes - `refactor-short-title` for refactoring -- `imrpove-short-title` for improvements +- `chore-short-title` for chores +- `docs-short-title` for documentations - `project-short-title` for thesis, EnPro, StuPro ... ## Squash and Merge @@ -80,7 +80,8 @@ To run the tests, use yarn test ``` -On pushes to the `main` branch these tests are executed. +On pushes to the `main` branch or on pull requests, the `tests` workflow is triggered. +This workflow runs the tests. ## Lint @@ -143,56 +144,3 @@ yarn patch-package ${package-name} If you need to patch the `package.json`, then append the option `--exclude 'nothing'` as stated in [#311](https://github.com/ds300/patch-package/issues/311){target=_blank}. -## Build - -To locally build the project, run the following command. -This will transpile Javascript inside the `/build` directory. - -```shell linenums="1" -yarn build -``` - -## Package - -{{ linux_only_notice() }} - -To locally package the project, run the following command. -This will package the previously transpiled Javascript using [`pkg`](https://github.com/vercel/pkg){target=_blank} and -generate binaries inside the `/dist` directory. - -```shell linenums="1" -yarn package -``` - -The issue considering the failed bytecode generation of MiniSat is known and can be ignored in our case. - -## Release - -On pushes to the `main` branch, the `release` workflow is triggered. -This workflow runs several tests, builds and packages the project and creates a new release. -Thereby, an existing release and `latest` tag is deleted. -There is only one release at total. -During the workflow the string `__VERSION__` inside a Javascript file is replace with the current commit hash. -The current version can be checked using `vintner --version`. - -## Night - -The `night` workflow is scheduled for every tuesday at 420. -This workflow ensures that the latest release is correctly signed and can be executed. - -## NPM - -There is also a npm package [`opentosca-vintner`](https://www.npmjs.com/package/opentosca-vintner){target=_blank}. -New versions are published manually. -To publish a new version, first update the version number in `package.json` and then run - -````shell linenums="1" -yarn release:npm -```` - -## Zenodo - -There is also a Zenodo record with a unique DOI for OpenTOSCA Vintner: [https://doi.org/10.5281/zenodo.10155277](https://doi.org/10.5281/zenodo.10155277){target=_blank} -To publish a new version, run the Zenodo workflow on GitHub. -This workflow will create a draft of a new version based on the latest GitHub release. -The version must be manually published on Zenodo. \ No newline at end of file diff --git a/docs/docs/contributing/documentation.md b/docs/docs/contributing/documentation.md index 8559c7631d..1c0b42bace 100644 --- a/docs/docs/contributing/documentation.md +++ b/docs/docs/contributing/documentation.md @@ -15,14 +15,8 @@ The documentation is powered by [Material for MkDocs](https://squidfunk.github.i Corresponding files are located in the `docs` directory. Custom macros are implemented in `docs/macros.py` using [mkdocs-macros](https://mkdocs-macros-plugin.readthedocs.io){target=_blank}. -We expect that Python and [pandoc](https://pandoc.org){target=_blank} is already installed. -To install [pandoc](https://pandoc.org){target=_blank} on Ubuntu you might run - -```shell linenums="1" -sudo apt-get install pandoc -``` - -With the following command you can install `mkdocs-material` along with its requirements globally on your system. +First, install all dependencies, such as Python, [pandoc](https://pandoc.org){target=_blank}, mkdocs, PlantUML, etc. globally on your system. +Reload your session after the installation. ```shell linenums="1" yarn docs:install diff --git a/docs/docs/contributing/release.md b/docs/docs/contributing/release.md new file mode 100644 index 0000000000..1aa0bbacf4 --- /dev/null +++ b/docs/docs/contributing/release.md @@ -0,0 +1,71 @@ +--- +tags: +- Contributing +--- + +# Release + +This document contains information about releases. + +## Build + +To locally build the project, run the following command. +This will transpile Javascript inside the `/build` directory. +During the build, the string `__VERSION__` inside a Javascript file is replace with the current commit hash. +The current version can be checked using `vintner --version`. + +```shell linenums="1" +yarn build +``` + +## Package + +{{ linux_only_notice() }} + +To locally package the project, run the following command. +This will package the previously transpiled Javascript using [`pkg`](https://github.com/vercel/pkg){target=_blank} and +generate binaries inside the `/dist` directory. + +```shell linenums="1" +yarn package +``` + +The issue considering the failed bytecode generation of MiniSat is known and can be ignored in our case. + +## GitHub + +On pushes to the `main` branch, the `release` workflow is triggered. +This workflow runs several tests, builds and packages the project and creates a new [GitHub release](https://github.com/OpenTOSCA/opentosca-vintner/releases/tag/latest){target=_blank}. +Thereby, an existing GitHub release and `latest` tag is deleted. +There is only one release at total. + +However, there is also the `build` workflow. +This workflow basically has the same steps as the `release` workflow but does create his own GitHub release and does not deploy the docs. + +## Night + +The `night` workflow is scheduled for every tuesday at 420. +This workflow ensures that the latest release is correctly signed and can be executed. + +## NPM + +There is also a npm package [`opentosca-vintner`](https://www.npmjs.com/package/opentosca-vintner){target=_blank}. +New versions are published manually. +To publish a new version, first update the version number in `package.json` and then run + +````shell linenums="1" +yarn release:npm +```` + +## Docker + +There are also Docker containers: [https://github.com/OpenTOSCA/opentosca-vintner/pkgs/container/opentosca-vintner](https://github.com/OpenTOSCA/opentosca-vintner/pkgs/container/opentosca-vintner){target=_blank}. +They are automatically build and pushed during the Release workflow. + + +## Zenodo + +There is also a Zenodo record with a unique DOI for OpenTOSCA Vintner: [https://doi.org/10.5281/zenodo.10155277](https://doi.org/10.5281/zenodo.10155277){target=_blank}. +To publish a new version, run the Zenodo workflow on GitHub. +This workflow will create a draft of a new version based on the latest GitHub release. +The version must be manually published on Zenodo. diff --git a/docs/docs/contributing/setup.md b/docs/docs/contributing/setup.md index 6e6fad5b2e..19744d5609 100644 --- a/docs/docs/contributing/setup.md +++ b/docs/docs/contributing/setup.md @@ -97,3 +97,16 @@ Prettier should be configured as given in the figure below with the following pa ![IntelliJ Prettier Settings](intellij-prettier.png){class=figure}
Figure 2: IntelliJ Prettier Settings
+ + +## Excluded Directories + +The following directories should be excluded from search by the IDE. + +- `.nyc_output` +- `build` +- `build-docs` +- `coverage` +- `yarn` +- `dist` +- `node_modules` \ No newline at end of file diff --git a/docs/docs/install.ps1 b/docs/docs/install.ps1 new file mode 100644 index 0000000000..c444697887 --- /dev/null +++ b/docs/docs/install.ps1 @@ -0,0 +1,29 @@ +# Bin directory +$userBin = "$env:USERPROFILE\bin" + +# Check if vintner is already installed +if (Get-Command -Name "vintner" -ErrorAction SilentlyContinue) { + Write-Host "vintner is already installed" + exit 1 +} + +# Add bin directory to path +if (-not (Test-Path -Path $userBin)) { + New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\bin" + + $userPath = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) + $newPath = "$userPath$userBin;" + [System.Environment]::SetEnvironmentVariable("PATH", $newPath, [System.EnvironmentVariableTarget]::User) +} + +# Version +$version = if ($env:VERSION) { $env:VERSION } else { "latest" } + +# Install vintner +Invoke-WebRequest -URI "https://github.com/opentosca/opentosca-vintner/releases/download/$version/vintner-win-x64.exe.xz" -OutFile vintner-win-x64.exe.xz +tar -xf vintner-win-x64.exe.xz +Remove-Item vintner-win-x64.exe.xz +Move-Item vintner-win-x64.exe "$userBin\vintner.exe" + +# Init setup +vintner setup init diff --git a/docs/docs/install.sh b/docs/docs/install.sh index 45412e3d5c..184f43544d 100644 --- a/docs/docs/install.sh +++ b/docs/docs/install.sh @@ -3,7 +3,7 @@ set -e if which vintner &>/dev/null; then echo "vintner is already installed" - exit 0 + exit 1 fi if [ "$EUID" -ne 0 ]; then diff --git a/docs/docs/installation.md b/docs/docs/installation.md index ed11be7934..0f1a37daff 100644 --- a/docs/docs/installation.md +++ b/docs/docs/installation.md @@ -148,20 +148,36 @@ docker exec -it vintner /bin/bash ## Script -`vintner` can be installed using our installation script. -The script currently supports only Linux x64 and arm64. +`vintner` can be installed using our installation scripts. For the remaining supported platforms and architectures, see the manual installation. -```shell linenums="1" -curl -fsSL https://vintner.opentosca.org/install.sh | sudo bash - -vintner setup init -``` +=== "Linux x64/ arm64" + ```shell linenums="1" + curl -fsSL https://vintner.opentosca.org/install.sh | sudo bash - + ``` + + To install a specific version, run + + ```shell linenums="1" + curl -fsSL https://vintner.opentosca.org/install.sh | sudo VERSION=${VERSION} bash - + ``` -To install a specific version, run +=== "Windows x64" + ```powershell linenums="1" + Invoke-WebRequest -Uri "https://vintner.opentosca.org/install.ps1" -OutFile install.ps1 + powershell -ExecutionPolicy Bypass -File .\install.ps1 + Remove-Item install.ps1 + ``` + + To install a specific version, run + + ```powershell linenums="1" + Invoke-WebRequest -Uri "https://vintner.opentosca.org/install.ps1" -OutFile install.ps1 + $env:VERSION = "DESIRED_VERSION" + powershell -ExecutionPolicy Bypass -File .\install.ps1 + Remove-Item install.ps1 + ``` -```shell linenums="1" -curl -fsSL https://vintner.opentosca.org/install.sh | sudo VERSION=${VERSION} bash - -``` ## Manual @@ -201,6 +217,31 @@ See [below](#signature) for verifying the signature of the binary. vintner setup init ``` +=== "Windows x64" + First, create the directory `"$env:USERPROFILE\bin"` and add it to your PATH. + We recommend to do this manually. + + ```powershell linenums="1" + $userBin = "$env:USERPROFILE\bin" + if (-not (Test-Path -Path $userBin)) { + New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\bin" + $userPath = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) + $newPath = "$userPath$userBin;" + [System.Environment]::SetEnvironmentVariable("PATH", $newPath, [System.EnvironmentVariableTarget]::User) + } + ``` + + Next, install vintner. + + ```powershell linenums="1" + $userBin = "$env:USERPROFILE\bin" + Invoke-WebRequest -URI https://github.com/opentosca/opentosca-vintner/releases/download/latest/vintner-win-x64.exe.xz -OutFile vintner-win-x64.exe.xz + tar -xf vintner-win-x64.exe.xz + Remove-Item vintner-win-x64.exe.xz + Move-Item vintner-win-x64.exe $userBin\vintner.exe + vintner setup init + ``` + The following binaries are available: | Platform | Architecture | Binary | Archive | Signature | diff --git a/docs/docs/interface.md b/docs/docs/interface.md index b40dba72c7..6885c64fa9 100644 --- a/docs/docs/interface.md +++ b/docs/docs/interface.md @@ -36,6 +36,12 @@ cleans all assets requests.post(SERVER_ADDRESS + "/assets/clean") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/assets/clean") + ``` + ## vintner assets content shows content of an asset @@ -70,6 +76,14 @@ shows content of an asset }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/assets/content", json=mapOf( + "name" to NAME + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | name | true | string | name | @@ -108,6 +122,14 @@ deletes an asset }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/assets/delete", json=mapOf( + "name" to NAME + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | name | true | string | name | @@ -150,6 +172,16 @@ imports an asset }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/assets/import", json=mapOf( + "name" to NAME, + "file" to FILE, + "content" to CONTENT + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | name | true | string | name (must match /^[a-z\-]+$/) | @@ -185,6 +217,12 @@ lists all assets requests.post(SERVER_ADDRESS + "/assets/list") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/assets/list") + ``` + ## vintner info about general information @@ -214,6 +252,12 @@ general information requests.post(SERVER_ADDRESS + "/info/about") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/info/about") + ``` + ## vintner info author open author @@ -243,6 +287,12 @@ open author requests.post(SERVER_ADDRESS + "/info/author") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/info/author") + ``` + ## vintner info contact contact us @@ -272,6 +322,12 @@ contact us requests.post(SERVER_ADDRESS + "/info/contact") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/info/contact") + ``` + ## vintner info dependencies dependencies used to implement vintner @@ -301,6 +357,12 @@ dependencies used to implement vintner requests.post(SERVER_ADDRESS + "/info/dependencies") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/info/dependencies") + ``` + ## vintner info docs open documentation @@ -330,6 +392,12 @@ open documentation requests.post(SERVER_ADDRESS + "/info/docs") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/info/docs") + ``` + ## vintner info license license of vintner @@ -359,6 +427,12 @@ license of vintner requests.post(SERVER_ADDRESS + "/info/license") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/info/license") + ``` + ## vintner info repo open repository @@ -388,6 +462,12 @@ open repository requests.post(SERVER_ADDRESS + "/info/repo") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/info/repo") + ``` + ## vintner instances adapt submit sensor data used for adapting the instance @@ -419,6 +499,15 @@ submit sensor data used for adapting the instance }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/adapt", json=mapOf( + "instance" to INSTANCE, + "inputs" to INPUTS + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -453,6 +542,12 @@ deletes all instances requests.post(SERVER_ADDRESS + "/instances/clean") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/clean") + ``` + ## vintner instances code opens the instance directory in visual studio code @@ -502,6 +597,14 @@ continue instance (deployment) }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/continue", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -541,6 +644,14 @@ deletes instance }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/delete", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -579,6 +690,14 @@ deploys instance }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/deploy", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -619,6 +738,14 @@ display instance info }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/info", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -659,6 +786,15 @@ initializes a new instance }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/init", json=mapOf( + "instance" to INSTANCE, + "template" to TEMPLATE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name (must match /^[a-z\-]+$/) | @@ -698,6 +834,14 @@ inspects variability-resolved service template }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/inspect", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -731,6 +875,12 @@ lists all instances requests.post(SERVER_ADDRESS + "/instances/list") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/list") + ``` + ## vintner instances open opens template directory in a file browser @@ -780,6 +930,14 @@ returns instance outputs }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/outputs", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -819,6 +977,14 @@ returns the path to the instance directory }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/path", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -857,6 +1023,14 @@ resolves variability }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/resolve", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -899,6 +1073,15 @@ swap instance template }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/swap", json=mapOf( + "instance" to INSTANCE, + "template" to TEMPLATE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -933,6 +1116,14 @@ stop adaptation loop of instance }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/unadapt", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -971,6 +1162,14 @@ undeploys instance }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/undeploy", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -1010,6 +1209,14 @@ update instance }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/update", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -1050,6 +1257,14 @@ validates variability-resolved service template }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/instances/validate", json=mapOf( + "instance" to INSTANCE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | instance | true | string | instance name | @@ -1089,6 +1304,14 @@ attests an orchestrator plugin }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/orchestrators/attest", json=mapOf( + "orchestrator" to ORCHESTRATOR + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | orchestrator | true | string | orchestrator plugin | @@ -1127,6 +1350,14 @@ enables an orchestrator plugin }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/orchestrators/enable", json=mapOf( + "orchestrator" to ORCHESTRATOR + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | orchestrator | true | string | orchestrator plugin | @@ -1160,6 +1391,12 @@ initializes unfurl plugin requests.post(SERVER_ADDRESS + "/orchestrators/init/unfurl") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/orchestrators/init/unfurl") + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | venv | false | boolean | enable the use of a virtual environment (default: true) | @@ -1195,6 +1432,12 @@ initializes unfurl-wsl plugin requests.post(SERVER_ADDRESS + "/orchestrators/init/unfurl-wsl") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/orchestrators/init/unfurl-wsl") + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | venv | false | boolean | enable the use of a virtual environment (default: true) | @@ -1230,6 +1473,12 @@ initializes xopera plugin requests.post(SERVER_ADDRESS + "/orchestrators/init/xopera") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/orchestrators/init/xopera") + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | venv | false | boolean | enable the use of a virtual environment (default: true) | @@ -1265,6 +1514,12 @@ initializes xopera-wsl plugin requests.post(SERVER_ADDRESS + "/orchestrators/init/xopera-wsl") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/orchestrators/init/xopera-wsl") + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | venv | false | boolean | enable the use of a virtual environment (default: true) | @@ -1305,6 +1560,14 @@ runs a query and returns the result }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/query", json=mapOf( + "query" to QUERY + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | query | true | string | path to query or query string | @@ -1434,6 +1697,12 @@ benchmarks the variability resolver requests.post(SERVER_ADDRESS + "/setup/benchmark") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/setup/benchmark") + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | io | false | boolean | enable read and writes to the filesystem | @@ -1472,6 +1741,12 @@ cleans up the filesystem requests.post(SERVER_ADDRESS + "/setup/clean") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/setup/clean") + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | force | false | boolean | force clean up | @@ -1516,6 +1791,12 @@ initialises the filesystem requests.post(SERVER_ADDRESS + "/setup/init") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/setup/init") + ``` + ## vintner setup install install utils (Linux is required) @@ -1545,6 +1826,12 @@ install utils (Linux is required) requests.post(SERVER_ADDRESS + "/setup/install") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/setup/install") + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | all | false | boolean | install all utils | @@ -1597,6 +1884,12 @@ returns the path to the home directory requests.post(SERVER_ADDRESS + "/setup/path") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/setup/path") + ``` + ## vintner setup reset resets the filesystem @@ -1626,6 +1919,12 @@ resets the filesystem requests.post(SERVER_ADDRESS + "/setup/reset") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/setup/reset") + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | force | false | boolean | force clean up | @@ -1666,6 +1965,15 @@ enrich conditions }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/enrich", json=mapOf( + "template" to TEMPLATE, + "output" to OUTPUT + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | path to variable service template | @@ -1709,6 +2017,16 @@ initializes a CSAR }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/init", json=mapOf( + "path" to PATH, + "template" to TEMPLATE, + "vintner" to VINTNER + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | path | true | string | path of the directory | @@ -1752,6 +2070,15 @@ read and transforms inputs }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/inputs", json=mapOf( + "path" to PATH, + "output" to OUTPUT + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | path | true | string | path to the variability inputs (supported: [YAML, FeatureIDE ExtendedXML]) | @@ -1793,6 +2120,15 @@ normalize service template }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/normalize", json=mapOf( + "template" to TEMPLATE, + "output" to OUTPUT + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | path to variable service template | @@ -1834,6 +2170,15 @@ packages a directory to a CSAR }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/package", json=mapOf( + "template" to TEMPLATE, + "output" to OUTPUT + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | path to variable service template | @@ -1873,6 +2218,14 @@ plot topology as PlantUML }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/puml/topology", json=mapOf( + "path" to PATH + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | path | true | string | path to service template | @@ -1912,6 +2265,14 @@ plot types as PlantUML (each entity types is plotted separately) }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/puml/types", json=mapOf( + "path" to PATH + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | path | true | string | path to service template | @@ -1954,6 +2315,15 @@ resolves all queries in a given service template }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/query", json=mapOf( + "template" to TEMPLATE, + "output" to OUTPUT + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | path to service template | @@ -1995,6 +2365,15 @@ resolves variability }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/resolve", json=mapOf( + "template" to TEMPLATE, + "output" to OUTPUT + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | path to variable service template | @@ -2040,6 +2419,16 @@ signs a CSAR }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/sign", json=mapOf( + "template" to TEMPLATE, + "output" to OUTPUT, + "key" to KEY + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | path to service template | @@ -2080,6 +2469,14 @@ collects stats of a given service template (experimental) }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/stats", json=mapOf( + "template" to TEMPLATE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | strings... | path to service template | @@ -2118,6 +2515,14 @@ runs tests defined in the CSAR }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/test", json=mapOf( + "path" to PATH + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | path | true | string | path or link to the extracted CSAR | @@ -2158,6 +2563,15 @@ unpackages a CSAR }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/unpackage", json=mapOf( + "template" to TEMPLATE, + "output" to OUTPUT + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | path to variable service template | @@ -2201,6 +2615,16 @@ verify a CSAR }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/template/verify", json=mapOf( + "template" to TEMPLATE, + "signature" to SIGNATURE, + "key" to KEY + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | path to service template | @@ -2236,6 +2660,12 @@ removes all templates requests.post(SERVER_ADDRESS + "/templates/clean") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/templates/clean") + ``` + ## vintner templates code opens the template directory in visual studio code @@ -2285,6 +2715,14 @@ deletes a template }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/templates/delete", json=mapOf( + "template" to TEMPLATE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | template name | @@ -2325,6 +2763,15 @@ imports a new template }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/templates/import", json=mapOf( + "template" to TEMPLATE, + "path" to PATH + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | template name | @@ -2368,6 +2815,14 @@ inspects the variable service template }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/templates/inspect", json=mapOf( + "template" to TEMPLATE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | template name | @@ -2401,6 +2856,12 @@ lists all templates requests.post(SERVER_ADDRESS + "/templates/list") ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/templates/list") + ``` + ## vintner templates open opens template directory in a file browser @@ -2450,6 +2911,14 @@ returns the path to the template directory }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/templates/path", json=mapOf( + "template" to TEMPLATE + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | template | true | string | template name | @@ -2488,6 +2957,14 @@ generates a key }) ``` +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/utils/key", json=mapOf( + "key" to KEY + )) + ``` + | Option | Mandatory | Type | Description | | --- | --- | --- | --- | | key | true | string | key name (must match /^[a-z\-]+$/) | @@ -2520,3 +2997,9 @@ generates a nonce import requests requests.post(SERVER_ADDRESS + "/utils/nonce") ``` + +=== "Kotlin" + ```kotlin linenums="1" + import khttp.post + post(SERVER_ADDRESS + "/utils/nonce") + ``` diff --git a/docs/install.sh b/docs/install.sh old mode 100644 new mode 100755 index 163981506f..2073805dff --- a/docs/install.sh +++ b/docs/install.sh @@ -1,7 +1,20 @@ #!/usr/bin/env bash set -e +# Set working directory +cd "$(dirname "$0")" + +# Update packages sudo apt-get update -y +# Install python +sudo apt-get install python3 python3-pip python-is-python3 -y + # Install requirements for PlantUML -sudo apt-get install default-jre graphviz -y \ No newline at end of file +sudo apt-get install default-jre graphviz -y + +# Install pandoc +sudo apt-get install pandoc -y + +# Install mkdocs +pip install -r requirements.txt \ No newline at end of file diff --git a/docs/mkdocs.yaml b/docs/mkdocs.yaml index 88f5bcb4ad..f2452db55f 100644 --- a/docs/mkdocs.yaml +++ b/docs/mkdocs.yaml @@ -138,6 +138,7 @@ nav: - Contributing: - contributing/setup.md - contributing/development.md + - contributing/release.md - contributing/documentation.md - contributing/code-of-conduct.md - contributing/notes.md diff --git a/package.json b/package.json index 3313a023ee..9ae699b472 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "benchmark": "yarn cli setup benchmark --latex --markdown --io", "server:start": "node -r dotenv/config -r ts-node/register -r tsconfig-paths/register src/cli/index.ts server start", "server:serve": "nodemon -r dotenv/config -r tsconfig-paths/register --ext \"ts,json\" src/cli/index.ts server start", - "docs:install": "cd docs && pip install -r requirements.txt", + "docs:install": "docs/install.sh", "docs:serve": "MKDOCS_IS_DEV=true MKDCOS_REVISION_ENABLED=false bash docs/cmds/mkdocs serve --watch-theme", "docs:open": "open-cli http://localhost:8000", "docs:build": "bash docs/cmds/mkdocs build --strict", @@ -167,7 +167,7 @@ "puml:down": "cd docs && docker-compose down", "large:check": "bash cmds/check-large-files.sh", "release:npm": "npm publish", - "release:zenodo": "python cmds/zenodo/script.py" + "release:zenodo": "python zenodo/script.py" }, "packageManager": "yarn@3.6.3" } diff --git a/cmds/zenodo/requirements.txt b/zenodo/requirements.txt similarity index 100% rename from cmds/zenodo/requirements.txt rename to zenodo/requirements.txt diff --git a/cmds/zenodo/script.py b/zenodo/script.py similarity index 100% rename from cmds/zenodo/script.py rename to zenodo/script.py