Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrudin committed Apr 26, 2023
2 parents 0889ae0 + 6ae326f commit 9a3a03b
Show file tree
Hide file tree
Showing 129 changed files with 7,428 additions and 6,553 deletions.
2 changes: 0 additions & 2 deletions .deployment

This file was deleted.

10 changes: 0 additions & 10 deletions .dockerignore

This file was deleted.

16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.java]
indent_size = 4
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ gradle-app.setting
.classpath
.project
.settings/org.eclipse.buildship.core.prefs
package-lock.json
test/bin/
bin/
test/out

# Intellij
.idea

gradle-local.properties

# Directory created after running `npm pack` and extracting the contents of that file
package
17 changes: 17 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Defines files to ignore when running "npm pack"
test
docker
build
.idea
.gradle
.dockerignore
.editorconfig
.gitignore
.jshintrc
CONTRIBUTING.md
Jenkinsfile
*.tar
*.tgz
docs
examples
config/test*
114 changes: 114 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
This guide provides instructions on developing and testing changes to this project.

First, before doing anything, run:

npm install

## Running the default Koop server for ad hoc testing

If you'd like to do some manual ad hoc testing, you should first clone the marklogic-geo-data-services project and read
the CONTRIBUTING guide there for instructions on deploying the examples/sample-project application. That application
installs an app server in your MarkLogic instance on port 8095. You can then run the default Koop server (which does not
require any authentication):

npm start

This will expose a Koop server at http://localhost:80 .

## Running the automated tests

The tests for this project are located in a Gradle project in the `./test` directory. These tests are expected to run
against the test application that is deployed by the marklogic-geo-data-services project. So you'll first need to
follow the CONTRIBUTING guide for that repository in order to deploy the test application in that repository.

These tests depend on hitting 2 different Koop servers:

1. A Koop server on port 8090 that doesn't require authentication.
2. A Koop server on port 8091 that requires MarkLogic-based authentication.

To run the tests with both Koop servers active, do the following:

cd test
./gradlew runKoopServers test

You can also run these tests from Intellij. You'll need to run the Koop servers manually. For most of the tests,
run this first from the root project directory so that you have a Koop server that doesn't require auth and points to
port 8096 in your MarkLogic instance:

npm run start-for-tests

## Testing the provider locally

The ./examples/local-publish-testing project can be used to test publishing this project's npm package to a local
registry and then using it in an example project built with [the Koop CLI](https://koopjs.github.
io/docs/basics/quickstart).

You'll first need a local npm registry. For that, [install verdaccio](https://verdaccio.org/):

npm install -g verdaccio

Then run it:

verdaccio

You can go to http://localhost:4873 to verify that it's running correctly. And you'll need to follow the first
instruction there, which is to add a user:

npm adduser --registry http://localhost:4873

You can add any username/password you want, and the email does not need to be a real address.

Now, publish this project's npm package to the local verdaccio registry (it's okay if you forget to specify the
registry; the operation will fail because you're not authorized to publish to the real npm):

npm publish --registry http://localhost:4873

After doing so, http://localhost:4873/-/web/detail/@koopjs/provider-marklogic should now show the package that you just
published.

You can now run the local-publish-testing project. You'll first need to install the
[Koop CLI](https://koopjs.github.io/docs/basics/quickstart) if you have not already:

npm install -g @koopjs/cli

Now run the local-publish-testing project using the Koop CLI and the package you just published locally:

cd examples/local-publish-testing
npm install
koop serve

This should launch a Koop server on port 8080. You can verify this via the following URLs:

- http://localhost:8080/ = should display "Welcome to Koop!"
- http://localhost:8080/marklogic/rest/services/GDeltExample/FeatureServer/0 = should return a JSON feature service
descriptor

## Testing the application zip

The "Installation Guide" in this project's docs directory describes how a user can download a versioned application
zip to use as a starting point for running a Koop server with the MarkLogic Koop provider in it. You can build and
test this zip locally via the following steps:

1. Run `npm pack` . This will produce a `koopjs-provider-marklogic-(version).tgz` file in the root of this project.
2. Extract the file, which will create a `package` directory (which is gitignore'd).

Then, follow the rest of the steps in the Installation Guide to configure and run the application.

## Testing the documentation locally

The docs for this project are stored in the `./docs` directory as a set of Markdown files. These are published via
[GitHub Pages](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages) using the
configuration found under "Settings / Pages" in this repository.

You can build and test the docs locally by
[following these GitHub instructions](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll),
though you don't need to perform all of those steps since some of the files generated by doing so are already in the
`./docs` directory. You just need to do the following:

1. Install the latest Ruby (rbenv works well for this).
2. Install Jekyll.
3. Go to the docs directory - `cd ./docs` .
4. Run `bundle install` (this may not be necessary due to Gemfile.lock being in version control).
5. Run `bundle exec jekyll serve`.

You can then go to http://localhost:4000 to view the docs.
36 changes: 36 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@Library('shared-libraries') _
pipeline{
agent {label 'devExpLinuxPool'}
options {
checkoutToSubdirectory 'marklogic-koop-provider'
buildDiscarder logRotator(artifactDaysToKeepStr: '7', artifactNumToKeepStr: '', daysToKeepStr: '30', numToKeepStr: '')
}
environment{
JAVA_HOME_DIR="/home/builder/java/jdk-11.0.2"
NODE_HOME_DIR="/home/builder/nodeJs/node-v14.15.4-linux-x64"
GRADLE_DIR =".gradle"
DMC_USER = credentials('MLBUILD_USER')
DMC_PASSWORD = credentials('MLBUILD_PASSWORD')
}
stages{
stage('tests'){
steps{
copyRPM 'Latest','11'
setUpML '$WORKSPACE/xdmp/src/Mark*.rpm'
gitCheckout 'marklogic-geo-data-services','https://github.com/marklogic-community/marklogic-geo-data-services.git','develop';
sh label:'test', script: '''#!/bin/bash
export JAVA_HOME=$JAVA_HOME_DIR
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
export PATH=$NODE_HOME_DIR/bin:$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
cd $WORKSPACE/marklogic-geo-data-services
./gradlew -i mlDeploy loadTestData -PmlUsername=admin -PmlPassword=admin || true
cd $WORKSPACE/marklogic-koop-provider
npm install
cd test
./gradlew runKoopServers test || true
'''
junit '**/build/**/*.xml'
}
}
}
}
22 changes: 10 additions & 12 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
Copyright � 2017 MarkLogic Corporation.

This project and its code and functionality is not representative of MarkLogic Server and is not supported by MarkLogic.
Copyright © 2023 MarkLogic Corporation.

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

http://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.

Apache License
Version 2.0, January 2004
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

Expand Down Expand Up @@ -69,14 +67,14 @@ To apply the Apache License to your work, attach the following boilerplate notic

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
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

http://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.
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.
Loading

0 comments on commit 9a3a03b

Please sign in to comment.