Skip to content

Commit 85ba388

Browse files
committed
Merge branch 'release/2.0.0-alpha.3' into 2.0-master
2 parents d4ae607 + 0fc5be9 commit 85ba388

File tree

306 files changed

+5134
-4306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+5134
-4306
lines changed

.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.dockerignore
2+
3+
.DS_Store
4+
5+
**/node_modules
6+
.gradle
7+
**/.gradle
8+
!**/build.gradle
9+
!**/settings.gradle
10+
11+
.idea
12+
13+
# **/build/*

.travis.yml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
language: java
2-
jdk:
3-
- oraclejdk8
4-
env:
5-
- NODE_VERSION=6.1
6-
sudo: true
1+
dist: trusty
2+
sudo: required
3+
services:
4+
- docker
5+
76
before_install:
8-
- echo 'America/Los_Angeles' | sudo tee /etc/timezone
9-
- sudo dpkg-reconfigure --frontend noninteractive tzdata
10-
install:
11-
- nvm install $NODE_VERSION
12-
- nvm use $NODE_VERSION
13-
- npm install -g typings
14-
- ./shared/dev-tasks/install-dependencies.sh
7+
- ./.travis/download.sh
8+
159
script:
16-
- nvm use $NODE_VERSION
17-
- if [[ $TRAVIS_SECURE_ENV_VARS == true ]]; then
18-
./gradlew check;
19-
else
20-
./gradlew jshint;
21-
fi
10+
- docker-compose build
11+
- docker-compose run marklogic

.travis/Dockerfile-java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM openjdk:8
2+
VOLUME /code
3+
ADD ./ /code
4+
WORKDIR /code
5+
ENTRYPOINT [ "sh", "-c", "./gradlew check" ]

.travis/Dockerfile-ml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM centos:centos7
2+
3+
ENV LANG C.UTF-8
4+
5+
RUN yum -y install glibc.i686 \
6+
gdb.x86_64 redhat-lsb.x86_64 vim \
7+
bzip2 \
8+
unzip \
9+
xz-utils \
10+
java-1.8.0-openjdk-devel 2>&1 > /dev/null
11+
12+
# Install MarkLogic
13+
COPY ./MarkLogic.rpm /tmp/MarkLogic.rpm
14+
15+
RUN yum -y install /tmp/MarkLogic.rpm 2>&1 > /dev/null
16+
17+
# Expose MarkLogic Server ports - add additional ones for your REST, etc
18+
# endpoints
19+
EXPOSE 7997-8020
20+
21+
# init
22+
COPY .travis/startml.sh /tmp/startml.sh
23+
RUN chmod 755 /tmp/startml.sh
24+
COPY .travis/setup.sh /tmp/setup.sh
25+
RUN chmod 755 /tmp/setup.sh
26+
RUN /tmp/setup.sh
27+
28+
VOLUME /marklogic-data-hub
29+
ADD ./ /marklogic-data-hub
30+
WORKDIR /marklogic-data-hub
31+
32+
RUN ./gradlew tasks 2>&1 > /dev/null
33+
34+
# Define default command (which avoids immediate shutdown)
35+
CMD /tmp/startml.sh && ./gradlew test

.travis/download.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# runs command from parameters and exits with the eoror code of the command
4+
# if it fails
5+
function successOrExit {
6+
"$@"
7+
local status=$?
8+
if [ $status -ne 0 ]; then
9+
echo "$1 exited with error: $status"
10+
exit $status
11+
fi
12+
}
13+
14+
set | grep TRAVIS
15+
16+
test $1 && arg1=$1
17+
18+
ver=${ML_VERSION}
19+
fname=MarkLogic-RHEL7-${ver}.x86_64.rpm
20+
fnamedeb="marklogic_"
21+
fnamedeb=$fnamedeb$ver
22+
suff="_amd64.deb"
23+
fnamedeb=$fnamedeb$suff
24+
25+
echo "Logging in for Download"
26+
curl -s -c cookies.txt --data "email=${MLBUILD_USER}&password=${MLBUILD_PASSWORD}" https://developer.marklogic.com/login > /dev/null 2>&1
27+
28+
echo
29+
echo "Getting Download Link"
30+
dl_link=$(curl -s -b cookies.txt --data "download=/download/binaries/8.0/${fname}" https://developer.marklogic.com/get-download-url | perl -pe 's/.*"path":"([^"]+).*/\1/')
31+
url="https://developer.marklogic.com${dl_link}"
32+
33+
echo "********* Downloading MarkLogic $ver"
34+
successOrExit curl -s -k -o ./MarkLogic.rpm $url

.travis/setup.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
#
3+
# Initializes a virgin MarkLogic installation.
4+
5+
HOST=localhost
6+
ADMINUSER=admin
7+
ADMINPASSWORD=admin
8+
9+
/tmp/startml.sh
10+
11+
until curl -fsS --head --digest --user "$ADMINUSER":"$ADMINPASSWORD" http://"$HOST":8001/admin/v1/timestamp # &>/dev/null
12+
do
13+
echo "MarkLogic hasn't started yet. Retrying in 3 seconds…"
14+
sleep 3
15+
done
16+
17+
# curl -X POST --data "" http://"$HOST":8001/admin/v1/init
18+
echo "Initializing…"
19+
curl --fail --show-error --silent -X POST --data "" http://"$HOST":8001/admin/v1/init 1>/dev/null
20+
if [[ $? != 0 ]] ; then
21+
echo "error on init"
22+
exit 1
23+
fi
24+
echo "Completed initialization. Waiting for restart…"
25+
sleep 20
26+
27+
# curl -fsS --head --digest --user admin:"$ADMINPASSWORD" http://"$HOST":8001/admin/v1/timestamp
28+
# One liner: until curl -fsS --head http://192.168.56.101:8001/admin/v1/timestamp --digest --user admin:admin; do sleep 5; done
29+
30+
31+
until curl -fsS --head --digest --user "$ADMINUSER":"$ADMINPASSWORD" http://"$HOST":8001/admin/v1/timestamp &>/dev/null
32+
do
33+
echo "Restart hasn't completed. Retrying in 3 seconds…"
34+
sleep 3
35+
done
36+
37+
# curl -X POST -H "Content-type: application/x-www-form-urlencoded" --data "admin-username=admin" --data "admin-password=********" http://localhost:8001/admin/v1/instance-admin
38+
echo "Starting instance administration…"
39+
curl --fail --show-error --silent \
40+
-X POST -H "Content-type: application/x-www-form-urlencoded" \
41+
--data "admin-username=${ADMINUSER}" --data "admin-password=${ADMINPASSWORD}" --data "realm=public" \
42+
http://"$HOST":8001/admin/v1/instance-admin 1>/dev/null
43+
if [[ $? != 0 ]] ; then
44+
echo "Error on instance-admin"
45+
exit 1
46+
fi
47+
48+
echo "Completed instance administration. Waiting for restart…"
49+
sleep 10
50+
until curl -fsS --head --digest --user admin:"$ADMINPASSWORD" http://"$HOST":8001/admin/v1/timestamp &>/dev/null
51+
do
52+
echo "Restart hasn't completed. Retrying in 5 seconds…"
53+
sleep 5
54+
done
55+
56+
echo "Turning off log file rotation"
57+
curl --fail --show-error --silent \
58+
-X PUT --digest -u "$ADMINUSER":"$ADMINPASSWORD" -H "Content-type: application/json" \
59+
-d '{"rotate-log-files":"never"}' http://"$HOST":8002/manage/v2/groups/Default/properties &>/dev/null
60+
61+
echo "Done!"
62+
exit 0

.travis/startml.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
export MARKLOGIC_INSTALL_DIR=/opt/MarkLogic
4+
export MARKLOGIC_DATA_DIR=/data
5+
6+
export MARKLOGIC_FSTYPE=ext4
7+
export MARKLOGIC_USER=daemon
8+
export MARKLOGIC_PID_FILE=/var/run/MarkLogic.pid
9+
export MARKLOGIC_MLCMD_PID_FILE=/var/run/mlcmd.pid
10+
export MARKLOGIC_UMASK=022
11+
12+
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/MarkLogic/mlcmd/bin
13+
export LD_LIBRARY_PATH=/opt/MarkLogic/lib:/data/Lib
14+
15+
echo "STARTING MARKLOGIC"
16+
17+
/opt/MarkLogic/bin/MarkLogic

CONTRIBUTING.md

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Looking to build the code from source? Look no further.
2424
You need these to get started
2525

2626
- Java 8 JDK
27-
- Gradle (the newer the better)
27+
- Gradle (3.1 or greater)
2828
- Node JS 6.5 or newer
2929
- Typings `npm -g install typings`
3030
- A decent IDE. IntelliJ is nice.
@@ -36,29 +36,46 @@ To build the entire DHF (marklogic-data-hub.jar, quickstart.war, and ml-data-hub
3636

3737
```bash
3838
cd /path/to/data-hub-project/
39-
gradle build -x test
39+
./gradlew build -x test
4040
```
4141

42-
#### Running your local hub instead of the cloud hosted one
42+
#### Making Changes to the Hub Gradle Plugin
43+
44+
This is for when you are making changes to the ml-data-hub-plugin. This is a gradle plugin that enables Hub Capabilities. Most likely you won't find yourself doing this. You can safely ignore this section.
45+
46+
Still here? Seems you really want to modify the Gradle Plugin. Here's how to tell Gradle to use your local copy instead of the one living up on the Cloud.
47+
4348
```bash
4449
cd /path/to/data-hub-project/
45-
gradle publishToMavenLocal
50+
./gradlew publishToMavenLocal
4651
cd /path/to/data-hub-project/ml-data-hub-plugin
47-
gradle publishToMavenLocal
52+
./gradlew publishToMavenLocal
4853
```
4954

5055
Then in your build.gradle file you will need to use the local version:
5156
```groovy
57+
58+
// this goes at the top above the plugins section
59+
5260
buildscript {
5361
repositories {
5462
mavenLocal()
5563
jcenter()
5664
}
5765
dependencies {
58-
classpath "com.marklogic:ml-data-hub-plugin:(the version number you chose)"
66+
classpath "com.marklogic:ml-data-hub:(the version number you chose)"
5967
}
6068
}
61-
apply plugin: "com.marklogic.ml-data-hub-plugin"
69+
70+
plugins {
71+
...
72+
73+
// comment out this line. It pulls the version from the cloud
74+
// id 'com.marklogic.ml-data-hub' version '2.0.0-alpha.3'
75+
}
76+
77+
// this tells gradle to apply the plugin you included above in the buildscript section
78+
apply plugin: "com.marklogic.ml-data-hub"
6279
```
6380

6481
#### Running the QuickStart UI from source
@@ -69,7 +86,7 @@ You will need to open two terminal windows.
6986
**Terminal window 1** - This runs the webapp.
7087
```bash
7188
cd /path/to/data-hub-project
72-
gradle bootrun
89+
./gradlew bootrun
7390
```
7491

7592
**Terminal window 2** - This runs the Quickstart UI
@@ -112,10 +129,10 @@ your vision does not align with that of a project maintainer.
112129
#### Create a branch for your changes
113130

114131
Okay, so you have decided to fix something. Create a feature branch
115-
and start hacking. **Note** that we use git flow and thus our most recent changes live on the develop branch.
132+
and start hacking. **Note** that we use git flow and thus our most recent changes live on the 2.0-develop branch.
116133

117134
```sh
118-
$ git checkout -b my-feature-branch -t origin/develop
135+
$ git checkout -b my-feature-branch -t origin/2.0-develop
119136
```
120137

121138
#### Formatting code
@@ -165,7 +182,7 @@ Use `git rebase` (not `git merge`) to sync your work from time to time.
165182

166183
```sh
167184
$ git fetch upstream
168-
$ git rebase upstream/develop
185+
$ git rebase upstream/2.0-develop
169186
```
170187

171188

@@ -174,7 +191,7 @@ $ git rebase upstream/develop
174191
Make sure the JUnit tests pass.
175192

176193
```sh
177-
$ gradle test
194+
$ ./gradlew test
178195
```
179196

180197
Make sure that all tests pass. Please, do not submit patches that fail.
@@ -185,6 +202,10 @@ Make sure that all tests pass. Please, do not submit patches that fail.
185202
$ git push origin my-feature-branch
186203
```
187204

205+
#### Agree to the contributor License
206+
207+
Before we can merge your changes, you need to sign a [Contributor License Agreement](http://developer.marklogic.com/products/cla). You only need to do this once.
208+
188209
#### Submit the pull request
189210

190211
Go to https://github.com/username/marklogic-data-hub and select your feature branch. Click
@@ -209,10 +230,10 @@ from the main (upstream) repository:
209230
git push origin --delete my-feature-branch
210231
```
211232

212-
* Check out the develop branch:
233+
* Check out the 2.0-develop branch:
213234

214235
```shell
215-
git checkout develop -f
236+
git checkout 2.0-develop -f
216237
```
217238

218239
* Delete the local branch:
@@ -221,10 +242,10 @@ from the main (upstream) repository:
221242
git branch -D my-feature-branch
222243
```
223244

224-
* Update your develop with the latest upstream version:
245+
* Update your 2.0-develop with the latest upstream version:
225246

226247
```shell
227-
git pull --ff upstream develop
248+
git pull --ff upstream 2.0-develop
228249
```
229250

230251
[issue tracker]: https://github.com/marklogic/marklogic-data-hub/issues

LICENSE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2+
Copyright © 2017 MarkLogic Corporation.
3+
This project and its code and functionality is not representative of MarkLogic Server and is not supported by MarkLogic.
4+
5+
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
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
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.
10+
111
Apache License
212
Version 2.0, January 2004
313
http://www.apache.org/licenses/

0 commit comments

Comments
 (0)