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

Documentation and publishing #25

Merged
merged 2 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
documentation and gitignore updates
  • Loading branch information
markiantorno committed Oct 28, 2020
commit 4af330018ac98da717d3cd8275697235bdf246f2
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,28 @@ local.properties
# Gradle
.idea/**/gradle.xml
.idea/**/libraries

.idea/**

.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

### Gradle Patch ###
**/build/



# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
Expand Down
83 changes: 70 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,87 @@
### This is _NOT_ the FHIR validator.
### If you're looking for the FHIR validator, please go here: https://github.com/hapifhir/org.hl7.fhir.core
### This project is currently _in active development_ and not released. If your name is not Mark Iantorno, it's probably not a good idea to look at or use any of the code here.
# validator-wrapper
#### This project contains the CLI, Desktop GUI, and Standalone Validation Server for the FHIR Validator

### Proceed at your own risk.
---
| CI Status (master) | Website Docker Image |
| :---: | :---: |
| [![Build Status][Badge-BuildPipelineMaster]][Link-BuildPipelineMaster] | [![Docker Status][Badge-DockerHub]][Link-DockerHub] |

# Validator Wrapper
#### This project contains the CLI, Desktop GUI, and Standalone Validation Server for the FHIR Validator
### Warning
This project is still not "officially" released, and may contain errors/bugs/dragons/smooth-jazz. During this initial
period, your patience is **greatly appreciated**.

| CI Status (master) |
| :---: |
| [![Build Status][Badge-BuildPipelineMaster]][Link-BuildPipelineMaster] |
The validator CLI will still be generated and hosted as normal within the [hapifhir/core.hl7.fhir.core][Link-CoreGithubLatestRelease]
_for now_. Be advised that on release of v1.0 of the this project, we will stop publishing the cli as part of the core,
and users will be expected to download the cli jar from the [latest release][Link-ValidatorWrapperGithubLatestRelease]
of this project.

### CI/CD
All intergration and delivery done on Azure pipelines. Azure project can be viewed [here][Link-AzureProject].
All integration and delivery done on Azure pipelines. Azure project can be viewed [here][Link-AzureProject].

### Maintenance
This project is maintained by [Grahame Grieve][Link-grahameGithub] and [Mark Iantorno][Link-markGithub] on behalf of the FHIR community.
### Docker
Docker image for the fullstack website is stored [on DockerHub][Link-DockerHub], and can be downloaded and run locally.

Updates to the docker image are triggered through the Azure Pipelines CI/CD.

Building Locally
---
This project uses the [gradle build tool][Link-GradleWebpage] to build. In particular, we take advantage of
[Gradle's Kotlin DSL][Link-GradleKotlinDSLPrimer] as an alternative syntax to the traditional Groovy DSL.

To generate the jar containing all resources locally:
1. Ensure you have Gradle [installed on your system][Link-GradleInstall]
2. Generate the [Gradle Wrapper files][Link-GradleWrapper] locally by running the command `gradle wrapper --gradle-version=6.7`
3. Build the project by running the command `./gradlew build`
4. This will generate three jar files in the `/build/libs/` directory. The only one we care about is
`validator-wrapper-jvm-{$project-version}.jar`

Running the jar
---
There are three possible ways this jar can be utilized:
#### As a full-stack hosted server:
Execute the jar by providing the argument `'-startServer'`. This boots the Ktor validation back end and KotlinJS
front-end. Refer to the application.conf file in the resources directory to view the different deployment flavours available.
These deployment types can be set through the environment variable `ENVIRONMENT`. If no such environment variable is
set, the application will default to a `dev` type deployment.

#### As a locally run, short-lived, 'desktop' application:
Execute the jar by providing the argument `'-gui'`. This boots the Ktor server locally on the port 8080, and starts a
wrapped instance of the KotlinJS front end within a Chromium web window to appear as a desktop application. This
wrapped website should mimic all the same functionality of the full KotlinJS website in the full-stack hosted server.
Once the Chromium browser window is closed, the local Ktor server is also shutdown.

#### 3. As the traditional validator clr:
We realize that for many users, the cli is still the primary way in which validation is performed, so we've made
it possible to still execute this jar, as done previously, from the command line. All validator cli functionality
remains as detailed [on the confluence wiki][Link-ValidatorConfluence].

**N.B.**
If you attempt to run this as both a full-stack server and a locally hosted application (by including both the
`startServer` and `-gui` commands from the cli, the full-stack server takes priority, and the desktop version will
not be booted.

### TODO / Known Issues
1. Manual entry validation is a little screwy, bad inputs will cause website to hang and results are not displayed in an intuitive way
2. Localization is not enabled...yet

##### Have you found an issue not listed above? Do you have a feature request? Great! Submit it [here][Link-GitHubIssues] and we'll try to fix it as soon as possible.

### Maintenance
This project is maintained by [Grahame Grieve][Link-grahameGithub] and [Mark Iantorno][Link-markGithub] on behalf of the FHIR community.

[Link-AzureProject]: https://dev.azure.com/fhir-pipelines/validator-wrapper
[Link-BuildPipelineMaster]: https://dev.azure.com/fhir-pipelines/validator-wrapper/_build/latest?definitionId=38&branchName=master
[Link-DockerHub]: https://hub.docker.com/repository/docker/markiantorno/validator-wrapper/general
[Link-CoreGithubLatestRelease]: https://github.com/hapifhir/org.hl7.fhir.core/releases/latest
[Link-ValidatorWrapperGithubLatestRelease]: https://github.com/hapifhir/org.hl7.fhir.validator-wrapper/releases/latest
[Link-GitHubIssues]: https://github.com/hapifhir/org.hl7.fhir.validator-wrapper/issues
[Link-GradleWebpage]: https://gradle.org/
[Link-GradleKotlinDSLPrimer]: https://docs.gradle.org/current/userguide/kotlin_dsl.html
[Link-GradleInstall]: https://gradle.org/install/
[Link-GradleWrapper]: https://docs.gradle.org/current/userguide/gradle_wrapper.html
[Link-ValidatorConfluence]: https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator

[Badge-BuildPipelineMaster]: https://dev.azure.com/fhir-pipelines/validator-wrapper/_apis/build/status/Master%20Branch%20Pipeline?branchName=master
[Badge-DockerHub]: https://img.shields.io/docker/v/markiantorno/validator-wrapper

[Link-grahameGithub]: https://github.com/grahamegrieve
[Link-markGithub]: https://github.com/markiantorno
10 changes: 2 additions & 8 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
* Added gradle task to provide release version to pipelines
* Cleaned up Application boot methods
* Added default dev deployment with option to set environment variable to deploy different configs
* Cleaned up documentation in Ktor files
* Changed prod deployment port and host name
* Add Dockerfile for container deployments
* Default deployment for Docker set to prod settings
* Fixed typo on landing page
* Updated README with instructions and details
* Updated gitignore with gradle dirs
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionUrl=https\:https://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
51 changes: 20 additions & 31 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -44,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -125,8 +109,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down Expand Up @@ -154,19 +138,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
i=$((i+1))
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,9 +159,14 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
21 changes: 1 addition & 20 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -29,11 +13,8 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down