Skip to content

Commit

Permalink
Started documenting the Company level.
Browse files Browse the repository at this point in the history
  • Loading branch information
pme123 committed Dec 16, 2024
1 parent e4cc15b commit 2f4159c
Show file tree
Hide file tree
Showing 29 changed files with 501 additions and 175 deletions.
28 changes: 28 additions & 0 deletions 00-docs/src/docs/company/00-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 00-docs
This provides a template or starting point for the documentation of your company project.

For documentation, we use [laika](https://typelevel.org/Laika/latest/table-of-content.html).

The following files you need to adjust:

```bash
00-docs/src/docs
| - contact.md
| - instructions.md
| - pattern.md
| - statistics.md
```

The following files will be created by `.helper.scala prepareDocs`:

```bash
00-docs/src/docs
| - dependencies
| - helium
| - catalog.md
| - devStatistics.md
| - index.md
| - overviewDependencies.md
| - release.md
```
So do **not adjust** them manually.
1 change: 1 addition & 0 deletions 00-docs/src/docs/company/02-bpmn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 02-bpmn
1 change: 1 addition & 0 deletions 00-docs/src/docs/company/03-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 03-api
1 change: 1 addition & 0 deletions 00-docs/src/docs/company/03-dmn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 03-dmn
1 change: 1 addition & 0 deletions 00-docs/src/docs/company/03-simulation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 03-simulation
1 change: 1 addition & 0 deletions 00-docs/src/docs/company/03-worker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 03-worker
1 change: 1 addition & 0 deletions 00-docs/src/docs/company/04-helper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 04-helper
20 changes: 20 additions & 0 deletions 00-docs/src/docs/company/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Development

This describes the development process of the company project (`mycompany-camundala/helper.scala`).

Make sure `helper.scala` is executable:

```bash
cd ~/dev-mycompany/mycompany-camundala
chmod +x helper.scala
```

@:callout(info)
To update this project, use `../helperCompany init` - see [Init Company].
@:@

## publish

## prepareDocs

## publishDocs
14 changes: 14 additions & 0 deletions 00-docs/src/docs/company/directory.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

laika.navigationOrder = [
intro.md
sbt.md
00-docs.md
02-bpmn.md
03-api.md
03-dmn.md
03-simulation.md
03-worker.md
04-helper.md
development.md
postman.md
]
75 changes: 75 additions & 0 deletions 00-docs/src/docs/company/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{%
helium.site.pageNavigation.enabled = false
%}

# Introduction

A Company Project handles the specific configuration for the company.

@:callout(info)
Make sure you have [init the company](../development/initCompany.md).

In this process many files are generated and some are replaced.

Only files with the comment `DO NOT ADJUST` will be replaced.
So if you add custom code, make sure to remove this comment.

We recommend you make a comment what you have changed,
so you can easily update the file from time to time.
(just add the `DO NOT ADJUST` comment again)

If there is no `DO NOT ADJUST` comment, you need to delete it if you want the newest version of this file.

Normally these files have the comment: `// This file was created with .. - to reset delete it and run the command.`.
@:@

The layout looks similar to a BPMN project:
```bash
myCompany-camundala
| 00-docs
| 02-bpmn
| 03-api
| 03-dmn
| 03-simulation
| 03-worker
| 04-helper
| project
| build.sbt
| helper.scala

```

To setup the Company Project, follow these steps:

1. Open the `mycompany-camundala` directory with your IDE (I use Intellij).
1. Import the sbt project. The project should compile without errors.
1. **[sbt]**

The build tool (`project`, `build.sbt`).

1. **[00-docs]**

The company's documentation.
1. **[02-bpmn]**

General configurations and code for the _BPMN DSL_.
1. **[03-api]**

General configurations and code for the _Api DSL_.
1. **[03-dmn]**

General configurations and code for the _DmnTester DSL_.
1. **[03-simulation]**

General configurations and code for the _Simulation DSL_.
1. **[03-worker]**

General configurations and code for the _Worker DSL_.
1. **[04-helper]**

General configurations and code for the development process of the projects,
Including the Company project.

1. **[Development]**

The `helper.scala` script supports the development process.
10 changes: 10 additions & 0 deletions 00-docs/src/docs/company/postman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Postman
We use postman to test the APIs and deploy our projects.

## Test the APIs

TODO

## Deploy the Projects

TODO
40 changes: 40 additions & 0 deletions 00-docs/src/docs/company/sbt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# sbt

The _sbt_ files are structured as follows:

```bash
myCompany-camundala
| project
| | build.properties
| | plugins.sbt
| | ProjectDef.scala
| | Settings.scala
| build.sbt

```

## build.properties
Contains _only_ the sbt version.
(updated automatically)

## plugins.sbt
Defines the plugins used in the project.
(updated automatically)

## ProjectDef.scala
Defines the project naming (_organisation, name, version_).
(updated automatically)

You should **not adjust** this file, as in is used in the development process.

## Settings.scala
Contains the settings for the build project.
(updated automatically)

## build.sbt
Top level of the build definition. Make your adjustments here.

Check it for the _**TODOs**_ and adjust them to your needs.

At the moment you need at least define the _repository_ settings.

7 changes: 7 additions & 0 deletions 00-docs/src/docs/development/createProject.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{%
helium.site.pageNavigation.enabled = false
%}
# Create Project

**Experimental**

@:callout(info)
Make sure you have [setup the company project](../company/intro.md).
@:@

Creating a Project is done in two steps:

1. Create the project directory and the Helper Script.
Expand Down
3 changes: 3 additions & 0 deletions 00-docs/src/docs/development/initCompany.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{%
helium.site.pageNavigation.enabled = false
%}
# Init Company
**Experimental**

Expand Down
11 changes: 9 additions & 2 deletions 00-docs/src/docs/development/intro.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{%
helium.site.pageNavigation.enabled = false
%}
# Introduction

## Pre-Requisites
Expand All @@ -11,11 +14,15 @@ There are three phases in the development process:
1. **[Init Company]**

Create the directory structure and common files to get you started with _Camundala_.

1. **[Setup Company Project](../company/intro.md)**

2. **[Create Project]**
A Company Project handles the specific configuration for the company.

1. **[Create Project]**

Create the project directory and the Helper Script for the project development.

3. **[Project Development]**
1. **[Project Development]**

Tasks to support the project development.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import camundala.helper.dev.update.createIfNotExists
import java.time.LocalDate

case class CompanyDocsGenerator(companyCamundala: os.Path):
private lazy val companyProjectName = companyCamundala.last
private lazy val docsBase = companyCamundala / s"00-docs"
private lazy val docsSrc = docsBase / "src" / "docs"

Expand Down Expand Up @@ -39,12 +40,39 @@ case class CompanyDocsGenerator(companyCamundala: os.Path):
private lazy val instructions =
createIfNotExists(
docsSrc / "instructions.md",
s"""|## Create This Page
s"""|## Create a Release
|This is a semi-automatic process. This should be done either to prepare a Release or after a Release.
|
|@:callout(info)
|Be aware this requires a Postman Account and a collection, that runs the deployment.
|
|See [Setup Postman]($${camundala.docs}/company/postman.html)
|@:@
|Do the following steps:
|
|- TODO describe your process here
|- Check out this project _${companyProjectName}_: `git clone https://YOUR_REPO/$companyProjectName.git`
|- Configure the Release - edit _00-docs/CONFIG.conf_.
|- Copy the old Versions from _00-docs/VERSIONS.conf_ to _00-docs/VERSIONS_PREVIOUS.conf_.
|- Copy the Versions of the Release to _00-docs/VERSIONS.conf_ from Postman [Manage Deploy: YOUR_ENVIRONMENT](https://YOUR_POSTMAN_URL).
|```
| // START VERSIONS
|
| // Project
| myProjectVersion = "0.8.11" // new
| ...
| // END VERSIONS
| ```
|- Prepare Docs Release: `00-docs/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_.
|- Publish Docs: `00-docs/helper.scala publishDocs`
|- Check the result on [MyCompany Documentation](https://YOUR_DOCUMENTATION)
|""".stripMargin
)

Expand Down Expand Up @@ -72,7 +100,7 @@ case class CompanyDocsGenerator(companyCamundala: os.Path):
)
private lazy val style =
createIfNotExists(
docsSrc / "style.md",
docsSrc / "style.css",
s"""|.mermaid svg {
| height: 400px;
|}
Expand Down Expand Up @@ -125,6 +153,7 @@ case class CompanyDocsGenerator(companyCamundala: os.Path):
|// what is the release about (abstract as markup)
|release.notes = \"\"\"
|- TODO: Describe the Release here
|\"\"\"
|""".stripMargin
)
private def versions(name: String) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ case class CompanyGenerator()(using config: DevConfig):
createOrUpdate(os.pwd / "helperCompany.scala", CompanyScriptCreator().companyHelper)
// sbt
CompanySbtGenerator().generate
// company-camundala
// helper.scala
createOrUpdate(companyCamundala / "helper.scala", CompanyScriptCreator().companyCamundalaHelper)
// docs
CompanyDocsGenerator(companyCamundala).generate
end generate
Expand Down
Loading

0 comments on commit 2f4159c

Please sign in to comment.