*[YES/NO] Have you followed our code review [guidelines](https://github.com/microsoft/code-with-engineering-playbook/blob/master/pull-requests/code-reviews/readme.md)?
* [YES/NO] Have you added an explanation of what your changes do and why you'd like us to include them?
* [YES/NO] I have updated the documentation accordingly.
* [YES/NO/NA] I have added tests to cover my changes.
* [YES/NO/NA] All new and existing tests passed.
* [YES/NO/NA] My code follows the code style of this project.
* [YES/NO/NA] I ran lint checks locally prior to submission.
## What is the current behavior?
-------------------------------------
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
Issue: Remember to link the workitem to this pull request.
## What is the new behavior?
-------------------------------------
<!-- Please describe the behavior or changes that are being added by this PR. -->
-
-
-
## Does this introduce a breaking change?
-------------------------------------
- [YES/NO]
<!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. -->
## Any relevant logs, error output, etc?
-------------------------------------
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
## Other information
-------------------------------------
<!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
You will need to configure access to the remote maven repository that holds the OSDU dependencies. This file should live within `~/.m2/settings.xml`:
You may need to configure access to the remote maven repository that holds the OSDU dependencies. A default file should live within `~/.m2/settings.xml`:
```bash
$ cat ~/.m2/settings.xml
<?xml version="1.0"encoding="UTF-8"?>
...
...
@@ -98,7 +98,9 @@ $ cat ~/.m2/settings.xml
</settings>
```
### Build and run the application
_A settings file is also conveniently located in ./.mvn/community-maven.settings.xml which is also used for CI/CD processes._
### Build, Run and Test the application Locally
After configuring your environment as specified above, you can follow these steps to build and run the application
...
...
@@ -108,19 +110,16 @@ $ mvn clean package
...
[INFO] BUILD SUCCESS
# run service
# run service locally **REQUIRES SPECIFIC ENVIRONMENT VARIABLES SET**
$ java -jar$(find ./target/ -name'*.jar')
# Test the application **REQUIRES SPECIFIC ENVIRONMENT VARIABLES SET**
$ mvn clean test-f integration-tests/pom.xml
```
### Test the application
_After the service has started it should be accessible via a web browser by visiting [http://localhost:8080/swagger-ui.html](http://localhost:8080/swagger-ui.html). If the request does not fail, you can then run the integration tests._
After the service has started it should be accessible via a web browser by visiting [http://localhost:8080/swagger-ui.html](http://localhost:8080/swagger-ui.html). If the request does not fail, you can then run the integration tests.
```bash
$ mvn clean test-f integration-tests/pom.xml
...
[INFO] BUILD SUCCESS
```
## Debugging
...
...
@@ -165,68 +164,66 @@ As of now, the management APIs that enable user entitlements to be configured ar
}
```
## Deploying service to Azure
## Deploying the Service
Service deployments into Azure are standardized to make the process the same for all services. The steps to deploy into
Service deployments into Azure are standardized to make the process the same for all services if using ADO. The steps to deploy into
Azure can be [found here](https://github.com/Azure/osdu-infrastructure/blob/master/docs/osdu/SERVICE_DEPLOYMENTS.md)
### Manual Deployment
### Manual Deployment Steps
#### Environment Settings
__Environment Settings__
The following environment variables are necessary to properly deploy a service to an Azure OSDU Environment.
Deployment is performed using the [azure-webapp-maven-plugin](https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Web-App).
It is important that the [settings.xml](https://maven.apache.org/settings.html#servers) file has a server block that is used by the plugin for authentication.
The service is typically built by the CI/CD Pipeline with the jar file is deployed into the Project Level Package Repository. This is configured in the pom.xml file _distributionManagement_ block. It is possible _(not recommened)_ to build and deploy the package into a repository manually using a PAT Token with a sufficent authorization level configured as an environment variable `COMMUNITY_MAVEN_TOKEN`.