Skip to content

Commit 878a1d7

Browse files
committed
#282 - updating to latest ML download
1 parent 7130b1d commit 878a1d7

File tree

1 file changed

+78
-78
lines changed

1 file changed

+78
-78
lines changed

appveyor.yml

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +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
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.8
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)