Skip to content

Commit 443db04

Browse files
committed
- updating readme
- adding appveyor yaml
1 parent 54cc0be commit 443db04

File tree

3 files changed

+81
-83
lines changed

3 files changed

+81
-83
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,19 @@ $ cd marklogic-data-hub
4646
$ git remote add upstream git://github.com/marklogic/marklogic-data-hub.git
4747
```
4848

49-
All bug fixes and new features go into the dev branch.
50-
5149
We ask that you open an issue in the [issue tracker][] and get agreement from
5250
at least one of the project maintainers before you start coding.
5351

5452
Nothing is more frustrating than seeing your hard work go to waste because
5553
your vision does not align with that of a project maintainer.
5654

57-
5855
#### Create a branch for your changes
5956

6057
Okay, so you have decided to fix something. Create a feature branch
6158
and start hacking:
6259

6360
```sh
64-
$ git checkout -b my-feature-branch -t origin/dev
61+
$ git checkout -b my-feature-branch -t origin/master
6562
```
6663

6764
#### Formatting code

README.md

Lines changed: 2 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -7,85 +7,8 @@ Windows | [![Windows Build status](https://ci.appveyor.com/api/projects/status/k
77

88
Go from nothing to Enterprise Data Hub in a matter of minutes.
99

10-
1110
This project allows you to deploy a skeleton Data Hub into MarkLogic. With some basic configuration you will be running an Enterprise Data Hub in no time.
1211

13-
# Quick Start
14-
Want to get up and running quickly? Try the quick-start jar.
15-
16-
- Download the jar from the [releases page](https://github.com/marklogic/marklogic-data-hub/releases/latest).
17-
- Run the Jar
18-
`java -jar quick-start-1.0.0-alpha.1.jar`
19-
- Open the Quickstart Application in your browser:
20-
http://localhost:8080
21-
22-
23-
# Hacking on the Hub
24-
If you want to start hacking on the internals of the Hub then look here.
25-
26-
#### Clone the Repo
27-
First clone the repo
28-
29-
#### Building the Hub
30-
Note that the Unit tests take a very long time to run. This command skips them
31-
run: `./gradlew build -x test`
32-
33-
#### Running the Hub
34-
run: `./gradlew bootRun`
35-
36-
#### Running Tests
37-
run: `./gradlew test`
38-
39-
#### Using with an IDE
40-
##### Eclipse
41-
To generate eclipse project files run:
42-
`./gradlew eclipse`
43-
44-
Then import the project into eclipse
45-
46-
####Available Transforms
47-
Data Hub has provided several transforms that can be used when installed along with the created entities and flows in the MarkLogic server.
48-
####run-flow
49-
This transform can be used to run the flow when inserting document. It accepts the following `entity-name` and `flow-name`.
50-
51-
#####Use Cases:
52-
53-
1. Using [MarkLogic REST API PUT /v1/documents](http://docs.marklogic.com/REST/PUT/v1/documents)
54-
55-
`curl --anyauth --user <user>:<password> -X PUT -T <documentDirectory> -H "Content-type:<contentType>" 'http://<mlHost>:<port>/<version>/documents?uri=<uri>&transform=run-flow&trans:entity-name=<entityName>&trans:flow-name=<flowName>'`
56-
57-
Example:
58-
59-
`cat ./documents/employee1.xml`
60-
61-
`<employee xmlns="http://company.com/ns/employee">`
62-
`<id>1</id>`
63-
`</employee>`
64-
65-
To insert/update this document with uri '/employee1.xml' into the database 'data-hub-STAGING' (with host 'localhost' and port '8010'), given a user 'admin' with password 'admin' and rest-writer role AND to be able to run the flow 'IngestFlow' of the 'Customer' entity, run the following:
66-
67-
`curl --anyauth --user admin:admin -X PUT -T ./documents/employee1.xml -H "Content-type:application/xml" 'http://localhost:8010/LATEST/documents?uri=/employee1.xml&transform=run-flow&trans:entity-name=Customer&trans:flow-name=IngestFlow'`
68-
69-
This will create a document with uri '/employee1.xml'. The content will depend on the data format of the entity.
70-
71-
If it is JSON ('application/json'), the content will be:
72-
73-
`{`
74-
`"identifier": "/employee1.xml", `
75-
`"content": "<employee xmlns=\"http://company.com/ns/employee\">\n <id>1</id>\n</employee>"`
76-
`}`
77-
78-
Else if it is XML ('application/xml'), it will be:
12+
# Getting Started
7913

80-
`<?xml version="1.0" encoding="UTF-8"?>`
81-
`<envelope xmlns="http://marklogic.com/data-hub/envelope">`
82-
`<headers>`
83-
`</headers>`
84-
`<triples>`
85-
`</triples>`
86-
`<content>`
87-
`<employee xmlns="http://company.com/ns/employee">`
88-
`<id>1</id>`
89-
`</employee>`
90-
`</content>`
91-
`</envelope>`
14+
Head over to our [Getting Started Tutorial](http://marklogic.github.io/marklogic-data-hub/) to get up and running with the Data Hub.

appveyor.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
version: 1.0.{build}
2+
branches:
3+
only:
4+
- master
5+
image: WMF 5
6+
environment:
7+
ML_USER:
8+
secure: nioOZ/YaPcyFoqN9bVZHMllinShpPT+lG1uyi78H23c=
9+
ML_PASSWORD:
10+
secure: LaFtKimqM2zAtGUkciP5RA==
11+
ML_VERSION: 8.0-5.1
12+
install:
13+
- ps: >-
14+
function HttpPost($cookieContainer, $url, $postData) {
15+
$uri = New-Object "System.Uri" "$url"
16+
$webrequest = [System.Net.HTTPWebRequest]::Create($uri)
17+
$webrequest.CookieContainer = $cookieContainer
18+
$webrequest.ContentType = "application/x-www-form-urlencoded"
19+
$webrequest.Method = "POST"
20+
21+
$encoding = New-Object System.Text.ASCIIEncoding
22+
$bytes = $encoding.GetBytes($postData)
23+
$webrequest.ContentLength = $bytes.Length
24+
25+
$newStream = $webrequest.GetRequestStream()
26+
$newStream.Write($bytes, 0, $bytes.Length)
27+
$response = $webrequest.GetResponse().GetResponseStream()
28+
$sr = New-Object System.IO.StreamReader($response)
29+
$respTxt = $sr.ReadToEnd()
30+
$sr.Close()
31+
$response.Dispose()
32+
return $respTxt
33+
}
34+
35+
function downloadFile($cookieContainer, $url, $targetFile) {
36+
$cookie = $cookieContainer.GetCookies("https://developer.marklogic.com")[0]
37+
$cookieTxt = $cookie.NAME + "=" + $cookie.Value
38+
$wc = New-Object System.Net.WebClient
39+
$wc.Headers.Add([System.Net.HttpRequestHeader]::Cookie, $cookieTxt)
40+
$wc.DownloadFile($url, $targetFile)
41+
}
42+
43+
$cookieContainer = New-Object System.Net.CookieContainer
44+
$email = $env:ML_USER
45+
$password = $env:ML_PASSWORD
46+
$loginData = "email=$email&password=$password"
47+
48+
# Login
49+
$url = "https://developer.marklogic.com/login"
50+
$response = HttpPost $cookieContainer $url $loginData
51+
52+
# Get Download url
53+
$ver = $env:ML_VERSION
54+
$fname = "MarkLogic-$ver-amd64.msi"
55+
$url = "https://developer.marklogic.com/get-download-url"
56+
$postData = "download=/download/binaries/8.0/$fname"
57+
$response = HttpPost $cookieContainer $url $postData
58+
$json = $response | ConvertFrom-Json
59+
$downloadLink = $json.path
60+
$downloadLink = "https://developer.marklogic.com$downloadLink"
61+
62+
# Download File
63+
downloadFile $cookieContainer $downloadLink "$PSScriptRoot\$fname"
64+
msiexec /i "$PSScriptRoot\$fname" /quiet /qn /norestart /log install.log
65+
Start-Sleep -s 90
66+
cat .\install.log
67+
Start-Service -displayname "MarkLogic"
68+
HttpPost $cookieContainer "http://localhost:8001/admin/v1/init" ""
69+
Start-Sleep -s 10
70+
$postData = "admin-username=admin&admin-password=admin&realm=public"
71+
HttpPost $cookieContainer "http://localhost:8001/admin/v1/instance-admin" $postData
72+
Start-Sleep -s 10
73+
build: off
74+
test_script:
75+
- ps: >-
76+
c:
77+
cd \projects\marklogic-data-hub
78+
.\gradlew.bat test

0 commit comments

Comments
 (0)