Skip to content

Commit

Permalink
Added Company development documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
pme123 committed Dec 30, 2024
1 parent 0ef49da commit 5e66874
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 12 deletions.
70 changes: 65 additions & 5 deletions 00-docs/src/docs/company/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,68 @@ To update this project, use `cd ..` and then `./helperCompany init` - see [Init
@:@

## publish
TODO
## prepareDocs
TODO
## publishDocs
TODO

Creates a new Release for the Company project (`company-camundala`) and publishes to the repository(e.g. Artifactory)

Usage:
```
./helper.scala publish <VERSION>
```

Example:
```
./helper.scala publish 0.2.5
```
The same steps are executed as for the `publish` command in any project.
See [project publish](../development/projectDev.md#publish).

## Company Documentation
This is a semi-automatic process. This should be done either to prepare a Release or after a Release.

@:callout(info)
At the moment this is based on using **Postman** and a **WebDAV** server.

So get in touch if you have a different setup.
@:@

Do the following steps:

- Open the `company-camundala` project in your IDE.
- Configure the Release - edit `00-docs/CONFIG.conf`.
- Copy the actual Production Versions of the Release (`00-docs/VERSIONS.conf`) to `00-docs/VERSIONS_PREVIOUS.conf` from [Postman].
- Copy the new Versions of the Release to `00-docs/VERSIONS.conf` from [Postman].
```
// START VERSIONS
// Workers
companyAccountingWorkerVersion = "1.8.11"
...
// Project
companyAccountingVersion = "0.8.11"
...
// END VERSIONS
```
See [Deploy the Projects]

### prepareDocs
Prepare the company documentation.

```bash
./helper.scala prepareDocs
```
@:callout(warning)
Be aware that this overwrites `release.md`
@:@

- Manually adjust the Release Notes _release.md_.
- You can check the result, using the _Sbt_ command _laikaPreview_ on [localhost](http://localhost:4242/index.html)
- If you change the Versions you need to reload _SBT_.

### publishDocs
Release the company documentation.

```bash
./helper.scala publishDocs
```

- Check the result on your Company Documentation Page.
24 changes: 22 additions & 2 deletions 00-docs/src/docs/company/postman.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,28 @@ We use postman to test the APIs and deploy our projects.

## Test the APIs

TODO
In the process of publishing the APIs, we also create a Postman Collection.

You find the Postman Collection in the `projectBaseDir/03-api/PostmanOpenApi.yml` directory of the project.

## Deploy the Projects

TODO
This is used when you deploy the projects to the camunda Engine.

You need a folder in a Postman Collection. The folder name is `deploy_manifest`.

This folder will be run from top to bottom. So you need to:
- authenticate to the [Camunda REST API](https://docs.camunda.org/rest/camunda-bpm-platform/7.22/#tag/Deployment)
- configure the deployment for the local environment
- call the Camunda REST API to deploy the project
- test the deployment with another call to the API.

You need to provide the following configuration:

```scala
case class PostmanConfig(
collectionId: String,
localDevEnvId: String,
envApiKey: String = "POSTMAN_API_KEY"
)
```
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ case class CompanyScriptCreator()(using config: DevConfig):
s"""#!/usr/bin/env -S scala shebang
|$helperCompanyDoNotAdjustText
|
|//> using dep valiant::${config.companyName}-camundala-helper:${config.versionConfig.companyCamundalaVersion}
|//> using dep ${config.companyName}::${config.companyName}-camundala-helper:${config.versionConfig.companyCamundalaVersion}
|
|import ${config.companyName}.camundala.helper.*
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import os.proc

import java.util.Date

case class DeployHelper(deployConfig: PostmanConfig) extends Helpers:
case class DeployHelper(postmanConfig: PostmanConfig) extends Helpers:

val collectionId = deployConfig.collectionId
val envId = deployConfig.localDevEnvId
val postmanApiKey = sys.env(deployConfig.envApiKey)
val collectionId = postmanConfig.collectionId
val envId = postmanConfig.localDevEnvId
val postmanApiKey = sys.env(postmanConfig.envApiKey)

def deploy(integrationTest: Option[String] = None): Unit =
println(s"Publishing Project locally")
Expand Down

0 comments on commit 5e66874

Please sign in to comment.