Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OZ-468: Add docs to create own distribution. #4

Merged
merged 7 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions docs/create-distro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Create Your Own Distribution

!!! tip

Install Git, Maven and Docker Compose

HIS systems, like Ozone, often need to be heavily customized based on local needs. Ozone facilitates implementer's work by providing custom implementation configurations via a series of tools built on Apache Maven. The starting-point for a custom implementation is the Ozone Maven Archetype which creates a skeleton project that serves as a base for any particular customizations an implementation needs.

## Maven Archetype


#### Configure Maven

Edit your Maven `settings.xml` file (often located in `~/.m2/settings.xml`) and add the following block to it:
```xml
<profiles>
<profile>
<id>ozone</id>
<repositories>
<repository>
<id>archetype</id>
<url>https://nexus.mekomsolutions.net/repository/maven-public</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

<activeProfiles>
<activeProfile>ozone</activeProfile>
</activeProfiles>
```


#### Generate the Archetype

To get started, use Maven's archetype tools to generate a new Ozone implementation project. The command for doing this is:

```bash
mvn archetype:generate -DarchetypeArtifactId=maven-archetype -DarchetypeGroupId=com.ozonehis
```

This will prompt you for several key variables for your implementation:

* **distributionName:** A user-friendly name for your distribution. For example, an Ozone implementation for the country of Gruzinia might use "Gruzinia" as the distribution name.
* **groupId:** This is the [Maven groupId](https://maven.apache.org/guides/mini/guide-naming-conventions.html) that will be used for the implementation artifact. For "Ozone Gruzinia", this might be: `gz.moh`.
* **artifactId:** This is the [Maven artifactId](https://maven.apache.org/guides/mini/guide-naming-conventions.html) that will be used for the implementation artifact. For "Ozone Gruzinia", this might be: `ozone-grunzia`.
* **package:** This is a required property, but not used. Just accept the default value, which should be the same as the **groupId**.
* **version:** This is the version number for the distribution, which defaults to `1.0.0-SNAPSHOT`.

This will create a bare-bones Ozone implementation project, which should look like this:

```
<project root>
|
|--configs
| |
| |--openmrs
| | |
| | |--frontend_config
| | |--initializer_config
|--readme
| |--impl-guide.md
|--scripts
|--.gitignore
|--.gitpod.yml
|--pom.xml
|--README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the archectype actually generating not only a Maven project but also a local Git repository?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we're creating a local Git repository. I didn't want to make assumptions about having anything other than Maven installed.

```

From this point on, your can run your new Ozone distribution with the following commands:

## Build & Run
```bash
./scripts/mvnw clean package
```

```bash
source target/go-to-scripts-dir.sh
./start-demo.sh
```

## (optional) Stop & Destroy
```bash
./stop-demo.sh
```

```bash
./destroy-demo.sh
```

Next is to customize Ozone to your needs. Check out to next page to override inherited configurations.
3 changes: 1 addition & 2 deletions docs/impl-guide.md → docs/override-configs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Implementer Guide

!!! info "🚧 Work In Progress"

Coming soon:
- Using the Ozone Maven archetype
- Using the Maven parent
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ repo_name: ozone-his/ozone
nav:
- Implementers:
- Quick Start: 'index.md'
- Implementer Guide: 'impl-guide.md'
- Create Your Own Distribution: 'create-distro.md'
- Override Inherited Configs: 'override-configs.md'
- Users:
- Overview: 'users/overview.md'
- Single Sign-on: 'users/sso.md'
Expand Down