-
Notifications
You must be signed in to change notification settings - Fork 6
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c716166
Add docs are starting with the archetype
ibacher 802063b
Update docs/custom-implementation.md
ibacher 533e7b6
OZ-450: Updated Quick Start and added implementer guide placeholder. …
rbuisson a23fc35
OZ-468: Add docs for Maven Archetype
rbuisson 80795de
Merge branch 'main' into ibacher-add-archetype-docs
rbuisson 40987c7
OZ-468: Remove impl-guide.md
rbuisson 344bd2e
Complete + format create-distro.md
mks-d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Create Your Own Distribution of Ozone HIS | ||
|
||
## Why your own distribution? | ||
|
||
Beyond experimenting with the Quick Start guide, implementers and integrators of Ozone HIS will soon discover the need to provide their own configurations and possibly bespoke customizations to Ozone HIS. We recommend to do so through creating and managing your own distribution of Ozone HIS. | ||
|
||
Ozone provides a series Apache Maven-based tools to facilitate the assembly of your own tailored HIS distribution. This starts with the _Ozone Maven Archetype_. | ||
|
||
## The Ozone Maven Archetype | ||
|
||
!!! tip "Prequisites" | ||
|
||
Install [Git](https://github.com/git-guides/install-git), [Maven](https://www.baeldung.com/install-maven-on-windows-linux-mac) Maven and [Docker Compose](https://docs.docker.com/compose/install/) | ||
|
||
The Ozone Maven Archetype generates a foundational skeleton project, providing a customizable base for any specific implementation requirements. | ||
|
||
### 1) Configure Maven | ||
|
||
Edit your Maven `settings.xml` file (usually located at `~/.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> | ||
``` | ||
|
||
### 2) Generate the archetype | ||
|
||
Use Maven's archetype tools to generate a new Ozone implementation project structure: | ||
|
||
```bash | ||
mvn org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate -DarchetypeArtifactId=maven-archetype -DarchetypeGroupId=com.ozonehis | ||
``` | ||
|
||
This will prompt you for several key variables for your Maven project: | ||
|
||
| Prompt variable | Sample value | Explanation | | ||
|--------------------|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `distributionName` | `Ozone Gruzinia` | A name for your distribution. For example, a reference Ozone implementation for the imaginary country of Gruzinia could be named "Ozone Gruzinia". | | ||
| `groupId` | `gz.moh` | The [Maven group ID](https://maven.apache.org/guides/mini/guide-naming-conventions.html) that will be used for the implementation artifact. For "Ozone Gruzinia" this might be something like `gz.moh`. | | ||
| `artifactId` | `ozone-gruzinia` | The [Maven artifact ID](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-gruzinia`. | | ||
| `package` | `gz.moh` | A required property, but not used. To make it easy just accept the default value, which should default to be the same as the `groupId`. | | ||
| `version` | `1.0.0-SNAPSHOT` | The version number for the distribution, it starts by default at `1.0.0-SNAPSHOT`. | | ||
|
||
|
||
This will create a bare-bones Ozone implementation project that should look like this: | ||
```bash | ||
ozone-gruzinia/ | ||
├── README.md | ||
├── config | ||
│ └── openmrs | ||
│ ├── frontend_config | ||
│ └── initializer_config | ||
├── pom.xml | ||
├── readme | ||
│ └── impl-guide.md | ||
└── scripts | ||
├── mvnw | ||
├── mvnw.cmd | ||
├── mvnwDebug | ||
└── mvnwDebug.cmd | ||
``` | ||
|
||
## Available commands | ||
|
||
|Action|Command| | ||
|:----|:----| | ||
|Build the distribution|<pre>./scripts/mvnw clean package</pre>| | ||
|Run the distribution|<pre>source target/go-to-scripts-dir.sh<br/><br/>./start-demo.sh</pre>| | ||
|Stop the distribution|<pre>./stop-demo.sh</pre>| | ||
|Destroy the distribution|<pre>./destroy-demo.sh</pre>| | ||
|
||
You are now ready to tailor Ozone to fit your specific requirements. Proceed to the following page for guidance on how to override default configurations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be merging this for now, but I would like to hear from you (@ibacher, @rbuisson) about this table presentation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems right. The last two commands do assume you're in the directory the
./start-demo.sh
script is launched from, but I don't know how to make that clear.